*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --dirt: #5c3d2e;
  --dirt-dark: #2a1810;
  --dirt-light: #8b5a3c;
  --pink-nose: #e8789a;
  --gold: #f5c542;
  --cream: #f5e6d3;
  --ansem-brown: #6b4423;
  --grass: #4a7c59;
  --pixel-shadow: #1a0f0a;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--dirt-dark);
  color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

.bg-grain {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(139, 90, 60, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(74, 124, 89, 0.15) 0%, transparent 50%),
    linear-gradient(180deg, #1a0f0a 0%, #2a1810 40%, #1a0f0a 100%);
  z-index: -2;
}

.floating-dirt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.floating-dirt span {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--dirt-light);
  border-radius: 50%;
  opacity: 0.3;
  animation: float-dirt 12s infinite ease-in-out;
}

.floating-dirt span:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.floating-dirt span:nth-child(2) { left: 85%; top: 15%; animation-delay: 2s; width: 4px; height: 4px; }
.floating-dirt span:nth-child(3) { left: 50%; top: 60%; animation-delay: 4s; }
.floating-dirt span:nth-child(4) { left: 25%; top: 80%; animation-delay: 1s; width: 8px; height: 8px; }
.floating-dirt span:nth-child(5) { left: 70%; top: 45%; animation-delay: 3s; }

@keyframes float-dirt {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.2; }
  50% { transform: translateY(-30px) rotate(180deg); opacity: 0.5; }
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
  background: rgba(26, 15, 10, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(139, 90, 60, 0.3);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge {
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.8;
  transition: opacity 0.2s, color 0.2s;
}

nav a.nav-buy {
  color: #86efac;
  opacity: 1;
}

nav a.nav-x {
  color: #fff;
  opacity: 1;
}

nav a:hover {
  opacity: 1;
  color: var(--gold);
}

nav a.nav-buy:hover {
  color: #bbf7d0;
}

nav a.nav-x:hover {
  color: #ddd;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
}

.hero-tag {
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  color: var(--pink-nose);
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.hero-title {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(2rem, 8vw, 4.5rem);
  line-height: 1.3;
  margin-bottom: 1rem;
  text-shadow: 4px 4px 0 var(--pixel-shadow);
}

.title-line {
  display: block;
}

.title-line.accent {
  color: var(--gold);
}

.hero-sub {
  font-size: 1.1rem;
  max-width: 480px;
  opacity: 0.85;
  margin-bottom: 2.5rem;
}

/* Logo centerpiece */
.hero-logo-wrap {
  position: relative;
  margin: 2rem 0 3rem;
  animation: bob 3s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.logo-ring {
  position: absolute;
  inset: -20px;
  border: 3px solid var(--gold);
  border-radius: 50%;
  opacity: 0.4;
  animation: pulse-ring 2.5s ease-out infinite;
}

.logo-ring.ring-2 {
  inset: -35px;
  border-color: var(--pink-nose);
  animation-delay: 0.5s;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 0; }
}

.hero-logo {
  width: min(320px, 70vw);
  height: min(320px, 70vw);
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid var(--dirt-light);
  box-shadow:
    0 0 0 4px var(--gold),
    0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 -10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
}

.logo-shadow {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 20px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.5) 0%, transparent 70%);
  z-index: 1;
}

/* Equation */
.hero-equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  margin-bottom: 2.5rem;
}

.parent-card {
  background: rgba(92, 61, 46, 0.5);
  border: 2px solid var(--dirt-light);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
  transition: transform 0.2s, border-color 0.2s;
}

.parent-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
}

.parent-card.result {
  background: rgba(245, 197, 66, 0.15);
  border-color: var(--gold);
}

.parent-photo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--dirt-light);
  margin-bottom: 0.5rem;
}

.parent-card.result .parent-photo {
  border-color: var(--gold);
}

.parent-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.parent-role {
  font-size: 0.7rem;
  opacity: 0.65;
  margin-top: 0.15rem;
}

.equation-op {
  font-family: "Press Start 2P", monospace;
  font-size: 1.25rem;
  color: var(--gold);
}

.cta-btn {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: var(--gold);
  color: var(--dirt-dark);
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  border: 3px solid var(--pixel-shadow);
  box-shadow: 4px 4px 0 var(--pixel-shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.cta-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--pixel-shadow);
}

.cta-btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--pixel-shadow);
}

/* Contract Address */
.ca-panel {
  position: relative;
  width: min(760px, 100%);
  margin-bottom: 2.5rem;
  padding: 2rem 1.75rem 1.75rem;
  background: linear-gradient(160deg, rgba(42, 24, 16, 0.95) 0%, rgba(26, 15, 10, 0.98) 100%);
  border: 3px solid var(--gold);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(245, 197, 66, 0.2),
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(245, 197, 66, 0.08);
  text-align: center;
  overflow: hidden;
}

.ca-panel-glow {
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(245, 197, 66, 0.06), transparent 30%);
  animation: ca-spin 8s linear infinite;
  pointer-events: none;
}

@keyframes ca-spin {
  to { transform: rotate(360deg); }
}

.ca-label {
  position: relative;
  display: block;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.55rem, 2vw, 0.7rem);
  color: var(--gold);
  letter-spacing: 0.15em;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.ca-address-btn {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 1rem;
  padding: 1.1rem 1.25rem;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(139, 90, 60, 0.6);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  text-align: center;
}

.ca-address-btn:hover {
  border-color: var(--gold);
  background: rgba(245, 197, 66, 0.06);
  transform: translateY(-2px);
}

.ca-address-btn code {
  display: block;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: clamp(0.75rem, 3.2vw, 1.05rem);
  font-weight: 600;
  word-break: break-all;
  color: var(--cream);
  line-height: 1.55;
  letter-spacing: 0.02em;
}

.ca-tap {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--pink-nose);
  opacity: 0.75;
  font-family: "Space Grotesk", sans-serif;
}

.ca-copy-lg {
  position: relative;
  width: 100%;
  max-width: 280px;
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.copy-icon {
  margin-right: 0.35rem;
}

.ca-copy-btn {
  flex-shrink: 0;
  padding: 0.65rem 1.1rem;
  background: var(--gold);
  color: var(--dirt-dark);
  border: 2px solid var(--pixel-shadow);
  border-radius: 999px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--pixel-shadow);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.ca-copy-btn:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--pixel-shadow);
}

.ca-copy-btn.copied {
  background: var(--grass);
  color: white;
}

.ca-copy-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.ca-hint {
  position: relative;
  margin-top: 0.65rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  opacity: 0.55;
}

.ca-actions {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.ca-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  border: 2px solid var(--pixel-shadow);
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  box-shadow: 4px 4px 0 var(--pixel-shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.ca-action-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--pixel-shadow);
}

.ca-action-btn.pump {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: #052e16;
}

.ca-action-btn.twitter {
  background: #fff;
  color: #0f0f0f;
}

.footer-ca {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(245, 197, 66, 0.08);
  border: 1px solid rgba(245, 197, 66, 0.25);
  border-radius: 12px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.footer-ca-label {
  font-family: "Press Start 2P", monospace;
  font-size: 0.45rem;
  color: var(--gold);
}

.footer-ca code {
  font-size: clamp(0.6rem, 2vw, 0.75rem);
  word-break: break-all;
  opacity: 0.85;
}

.footer-link {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
}

.footer-link:hover {
  color: var(--cream);
}

@media (max-width: 520px) {
  .ca-actions {
    grid-template-columns: 1fr;
  }

  .ca-panel {
    padding: 1.5rem 1.1rem;
  }
}

/* Sections */
section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.section-label {
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  color: var(--pink-nose);
  margin-bottom: 0.75rem;
  letter-spacing: 0.08em;
}

section h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 2.5rem;
  font-weight: 700;
}

/* Story */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.story-card {
  background: rgba(92, 61, 46, 0.35);
  border: 2px solid rgba(139, 90, 60, 0.5);
  border-radius: 16px;
  padding: 1.75rem;
  transition: border-color 0.2s;
}

.story-card:hover {
  border-color: var(--dirt-light);
}

.story-card.highlight {
  border-color: var(--gold);
  background: rgba(245, 197, 66, 0.08);
}

.story-card .step {
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  color: var(--gold);
  display: block;
  margin-bottom: 0.75rem;
}

.story-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.story-card p {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Parents */
.parents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.parent-profile {
  background: rgba(26, 15, 10, 0.6);
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(139, 90, 60, 0.4);
}

.profile-photo-wrap {
  display: flex;
  justify-content: center;
  padding: 1.25rem 1.25rem 0;
}

.profile-photo {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--dirt-light);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.parent-profile.niglett .profile-photo {
  border-color: var(--gold);
}

.profile-header {
  font-family: "Press Start 2P", monospace;
  font-size: 0.65rem;
  padding: 1rem;
  text-align: center;
  letter-spacing: 0.05em;
}

.profile-header.ansem {
  background: linear-gradient(135deg, #3d2914, #6b4423);
}

.profile-header.diglett {
  background: linear-gradient(135deg, #4a3020, #8b5a3c);
}

.profile-header.niglett-h {
  background: linear-gradient(135deg, #8b6914, var(--gold));
  color: var(--dirt-dark);
}

.parent-profile ul {
  list-style: none;
  padding: 1.25rem 1.5rem 1.5rem;
}

.parent-profile li {
  font-size: 0.85rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(139, 90, 60, 0.2);
}

.parent-profile li:last-child {
  border-bottom: none;
}

.parent-profile.niglett {
  border-color: var(--gold);
}

/* Stats */
.stats-panel {
  background: rgba(26, 15, 10, 0.7);
  border: 3px solid var(--dirt-light);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.stat-row {
  display: grid;
  grid-template-columns: 120px 1fr 50px;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-row:last-child {
  margin-bottom: 0;
}

.stat-name {
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  color: var(--gold);
}

.stat-bar {
  height: 14px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(139, 90, 60, 0.5);
}

.stat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--grass), #6db87a);
  border-radius: 7px;
  transition: width 1.2s ease-out;
}

.stat-fill.gold {
  background: linear-gradient(90deg, #c9a020, var(--gold));
}

.stat-val {
  font-weight: 700;
  font-size: 0.85rem;
  text-align: right;
}

.dex-entry {
  font-style: italic;
  font-size: 1rem;
  line-height: 1.7;
  padding: 1.5rem 2rem;
  border-left: 4px solid var(--pink-nose);
  background: rgba(232, 120, 154, 0.08);
  border-radius: 0 12px 12px 0;
}

.dex-entry cite {
  display: block;
  margin-top: 0.75rem;
  font-style: normal;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Gallery */
.gallery {
  text-align: center;
  padding-bottom: 3rem;
}

.gallery-logo img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--gold);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.gallery-caption {
  margin-top: 1rem;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  border-top: 2px solid rgba(139, 90, 60, 0.3);
  font-size: 0.8rem;
  opacity: 0.7;
}

.footer-small {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 600px) {
  nav {
    gap: 0.75rem;
  }

  nav a {
    font-size: 0.75rem;
  }

  .hero-equation {
    flex-direction: column;
  }

  .equation-op {
    transform: rotate(90deg);
  }

  .stat-row {
    grid-template-columns: 90px 1fr 40px;
    gap: 0.5rem;
  }
}
