/* ============================================================
   MIGOLAND
   ============================================================ */

:root {
  /* forest base */
  --plum-900: #08200f;
  --plum-800: #0d2917;
  --plum-700: #133a22;
  --plum-600: #1c4d30;
  /* warm accents */
  --peach:    #b6e08a;
  --coral:    #ff9e4d;
  --gold:     #ffd36e;
  --gold-deep:#ffb84d;
  /* text */
  --cream:    #fbf7e9;
  --cream-dim:#dfe7cf;
  --muted:    #9bbf9f;

  --glow-coral: 0 0 40px rgba(255,158,77,.45);
  --glow-gold:  0 0 36px rgba(255,211,110,.55);

  --maxw: 1180px;
  --ease: cubic-bezier(.22,1,.36,1);

  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-pixel: "Silkscreen", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--cream);
  background: var(--plum-800);
  line-height: 1.6;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- film grain texture ---------- */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  --pad-y: .85rem; --pad-x: 1.5rem;
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.02rem; letter-spacing: .01em;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px; cursor: pointer; border: 0;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
  white-space: nowrap;
}
.btn-sm { --pad-y: .55rem; --pad-x: 1.1rem; font-size: .95rem; }
.btn-lg { --pad-y: 1rem;   --pad-x: 1.9rem; font-size: 1.12rem; }

.btn-play {
  color: #173a0f;
  background: linear-gradient(135deg, var(--gold) 0%, var(--coral) 100%);
  box-shadow: 0 8px 24px rgba(255,158,77,.34), inset 0 1px 0 rgba(255,255,255,.45);
}
.btn-play:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 14px 34px rgba(255,158,77,.5), var(--glow-gold), inset 0 1px 0 rgba(255,255,255,.5); }
.btn-play:active { transform: translateY(-1px) scale(.99); }
.btn-play .arrow { transition: transform .25s var(--ease); }
.btn-play:hover .arrow { transform: translateX(4px); }

.btn-ghost {
  color: var(--cream);
  background: rgba(255,246,233,.06);
  border: 1.5px solid rgba(255,246,233,.28);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255,246,233,.13); border-color: var(--gold); transform: translateY(-3px); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  transition: background .35s var(--ease), backdrop-filter .35s var(--ease), box-shadow .35s var(--ease);
}
.site-header.scrolled {
  background: rgba(20,16,42,.78);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(255,211,110,.12), 0 10px 30px rgba(0,0,0,.3);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.wordmark {
  font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
  color: var(--cream); letter-spacing: -.01em;
  display: inline-flex; align-items: center; gap: .5rem;
}
.wordmark-dot {
  width: .62em; height: .62em; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold), var(--coral));
  box-shadow: var(--glow-coral);
}
.wordmark-sm { font-size: 1.3rem; }
.header-nav { display: flex; align-items: center; gap: 1.6rem; }
.nav-link { font-weight: 600; color: var(--cream-dim); font-size: .98rem; transition: color .2s; }
.nav-link:hover { color: var(--gold); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: clamp(620px, 96svh, 1000px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: clamp(2rem, 7vh, 5rem);
  overflow: hidden;
  isolation: isolate;
}

/* --- the illustrated scene --- */
.scene { position: absolute; inset: 0; z-index: -2; }
.scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* twinkling stars */
.star { animation: twinkle 3.4s ease-in-out infinite; transform-origin: center; }
.star.s2 { animation-duration: 4.2s; animation-delay: .8s; }
.star.s3 { animation-duration: 2.8s; animation-delay: 1.4s; }
@keyframes twinkle { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* glowing windows pulse softly */
.win { filter: drop-shadow(0 0 7px rgba(255,184,77,.85)); animation: winglow 5s ease-in-out infinite; }
.bld-castle .win { animation-delay: .6s; }
.bld-house  .win { animation-delay: 1.1s; }
.bld-tower  .win { animation-delay: 1.7s; }
@keyframes winglow { 0%,100% { opacity: .82; } 50% { opacity: 1; } }

.flag { animation: flagwave 3s ease-in-out infinite; transform-origin: left center; }
@keyframes flagwave { 0%,100% { transform: scaleX(1); } 50% { transform: scaleX(.86); } }

.jet { animation: jet 2.6s ease-in-out infinite; transform-origin: bottom center; }
@keyframes jet { 0%,100% { transform: scaleY(.85); opacity: .65; } 50% { transform: scaleY(1.05); opacity: .95; } }

/* drifting clouds */
.clouds { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.cloud {
  position: absolute; border-radius: 100px;
  background: radial-gradient(ellipse at 50% 60%, rgba(255,246,233,.92), rgba(255,209,160,.55) 70%, transparent);
  filter: blur(2px); opacity: .8;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; border-radius: 100px;
  background: inherit;
}
.cloud-1 { width: 200px; height: 46px; top: 16%; left: -260px; animation: drift 58s linear infinite; }
.cloud-1::before { width: 110px; height: 90px; top: -38px; left: 36px; }
.cloud-1::after  { width: 80px;  height: 64px; top: -22px; left: 110px; }
.cloud-2 { width: 150px; height: 36px; top: 28%; left: -220px; opacity: .6; animation: drift 78s linear infinite; animation-delay: -30s; }
.cloud-2::before { width: 84px; height: 66px; top: -28px; left: 30px; }
.cloud-3 { width: 240px; height: 52px; top: 9%; left: -320px; opacity: .5; animation: drift 96s linear infinite; animation-delay: -60s; }
.cloud-3::before { width: 120px; height: 96px; top: -42px; left: 60px; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 360px)); } }

/* string lights */
.string-lights { position: absolute; top: 8%; left: 0; right: 0; height: 260px; z-index: -1; pointer-events: none; }
.lights-svg { width: 100%; height: 100%; }
.bulb {
  position: absolute; left: var(--x); top: var(--y);
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6e9, var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 0 10px 2px rgba(255,211,110,.85);
  animation: bulbpulse 3.2s ease-in-out infinite; animation-delay: var(--d);
}
@keyframes bulbpulse { 0%,100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.12); } }

/* avatars hanging out */
.avatars {
  position: absolute; left: 50%; bottom: clamp(2%, 7vh, 9%);
  transform: translateX(-50%);
  width: min(420px, 78vw); height: 170px;
  display: flex; align-items: flex-end; justify-content: center; gap: clamp(-10px, -2vw, 0px);
  z-index: -1;
}
.avatar { width: 96px; height: auto; filter: drop-shadow(0 10px 18px rgba(0,0,0,.35)); }
.av-1 { animation: float 4.4s ease-in-out infinite; }
.av-2 { width: 112px; margin: 0 -8px 0 -8px; z-index: 2; animation: float 4s ease-in-out infinite .4s; }
.av-3 { animation: float 4.8s ease-in-out infinite .9s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* hero copy */
.hero-copy {
  position: relative; z-index: 2;
  text-align: center; max-width: 720px;
  padding: 0 22px;
}
.pixel-stamp {
  display: inline-block;
  font-family: var(--font-pixel); font-size: .62rem; letter-spacing: .12em;
  color: var(--gold);
  padding: .5rem .85rem; border-radius: 8px;
  background: rgba(26,19,48,.5);
  border: 1px solid rgba(255,211,110,.35);
  text-shadow: 0 0 12px rgba(255,211,110,.5);
  margin-bottom: 1.3rem;
}
.hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(3.2rem, 11vw, 6.4rem); line-height: .94;
  margin: 0 0 1.1rem; letter-spacing: -.02em;
  color: var(--cream);
  text-shadow: 0 4px 40px rgba(0,0,0,.35);
}
.hero-title .is-back {
  background: linear-gradient(100deg, var(--gold), var(--coral) 60%, var(--peach));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 22px rgba(255,158,77,.4));
}
.hero-sub {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  color: var(--cream-dim); margin: 0 auto 1.8rem; max-width: 38ch;
}
.hero-sub strong { color: var(--cream); font-weight: 700; }
.hero-cta { display: flex; gap: .85rem; justify-content: center; flex-wrap: wrap; }
.trust {
  margin-top: 1.5rem; font-size: .92rem; color: var(--muted);
  display: inline-flex; align-items: center; gap: .5rem;
}
.trust-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #6ee7a8;
  box-shadow: 0 0 8px #6ee7a8; animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

.hero-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 160px; z-index: 1;
  background: linear-gradient(to bottom, transparent, var(--plum-800));
  pointer-events: none;
}

/* ============================================================
   SECTION SHELL
   ============================================================ */
.eyebrow {
  font-family: var(--font-display); font-weight: 600;
  text-transform: uppercase; letter-spacing: .16em; font-size: .82rem;
  color: var(--coral); margin: 0 0 .7rem;
}
.eyebrow-gold { color: var(--gold); }
.section-head { margin-bottom: 2.6rem; }
.section-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.06;
  margin: 0; letter-spacing: -.015em; color: var(--cream);
}

/* ---------- NOSTALGIA ---------- */
.nostalgia { padding: clamp(4rem, 10vh, 7rem) 0; background: var(--plum-800); position: relative; }
.nostalgia .eyebrow { font-size: 1rem; text-transform: none; letter-spacing: .01em; color: var(--gold); margin-bottom: 2rem; }
.nostalgia-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.big-line {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.4rem, 3.4vw, 2.15rem); line-height: 1.32;
  color: var(--cream); margin: 0;
}
.nostalgia-aside p { margin: 0 0 .35rem; font-size: 1.15rem; color: var(--cream-dim); }
.nostalgia-aside .emph {
  margin-top: 1.1rem; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.25rem,3vw,1.6rem); line-height: 1.25;
  color: var(--gold); text-shadow: 0 0 24px rgba(255,211,110,.35);
}

/* ---------- FEATURES ---------- */
.features { padding: clamp(4rem, 10vh, 7rem) 0; background: linear-gradient(180deg, var(--plum-800), var(--plum-900)); }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.card {
  position: relative; padding: 1.8rem 1.5rem 1.7rem;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(58,33,96,.55), rgba(26,19,48,.55));
  border: 1px solid rgba(255,246,233,.09);
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(120% 80% at 50% -10%, rgba(255,211,110,.16), transparent 60%);
  opacity: 0; transition: opacity .3s var(--ease); pointer-events: none;
}
.card:hover { transform: translateY(-6px); border-color: rgba(255,211,110,.4); box-shadow: 0 20px 44px rgba(0,0,0,.34), var(--glow-coral); }
.card:hover::after { opacity: 1; }
.card-icon {
  width: 64px; height: 64px; margin-bottom: 1.1rem;
  border-radius: 16px; padding: 6px;
  background: rgba(255,246,233,.06);
  border: 1px solid rgba(255,246,233,.1);
}
.card-icon svg { width: 100%; height: 100%; }
.card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.28rem; margin: 0 0 .4rem; color: var(--cream); }
.card p { margin: 0; font-size: .98rem; color: var(--cream-dim); }

/* ---------- BETTER ---------- */
.better { padding: clamp(4rem, 10vh, 7rem) 0; background: var(--plum-900); }
.better-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.better-row li {
  display: flex; flex-direction: column; gap: .35rem;
  padding-top: 1.3rem; border-top: 2px solid rgba(255,211,110,.22);
}
.better-row .check {
  font-size: 1.3rem; color: var(--gold); margin-bottom: .2rem; line-height: 1;
  filter: drop-shadow(0 0 8px rgba(255,211,110,.5));
}
.better-row strong { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; color: var(--cream); }
.better-row span:not(.check) { font-size: .96rem; color: var(--muted); }

/* ---------- CTA BAND ---------- */
.cta-band {
  position: relative; overflow: hidden;
  padding: clamp(4.5rem, 12vh, 8rem) 0;
  background:
    radial-gradient(120% 130% at 50% 120%, rgba(255,158,77,.4), transparent 60%),
    linear-gradient(180deg, var(--plum-900), var(--plum-700));
  text-align: center;
}
.cta-glow {
  position: absolute; left: 50%; top: 60%; transform: translate(-50%,-50%);
  width: 680px; height: 680px; max-width: 130vw;
  background: radial-gradient(circle, rgba(255,211,110,.32), transparent 62%);
  filter: blur(20px); pointer-events: none;
}
.cta-inner { position: relative; z-index: 1; }
.cta-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 4.4rem); line-height: 1; margin: 1.1rem 0 .8rem;
  letter-spacing: -.02em;
  background: linear-gradient(100deg, var(--gold), var(--peach) 55%, var(--coral));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 30px rgba(255,158,77,.4));
}
.cta-sub { font-size: clamp(1.05rem,2.4vw,1.25rem); color: var(--cream-dim); max-width: 40ch; margin: 0 auto 2rem; }
.cta-actions { display: flex; gap: .85rem; justify-content: center; flex-wrap: wrap; }
.pixel-stamp-light { color: var(--cream); border-color: rgba(255,246,233,.3); background: rgba(255,246,233,.06); }

/* ---------- FOOTER ---------- */
.site-footer { background: var(--plum-900); padding: 3.2rem 0 2.4rem; border-top: 1px solid rgba(255,246,233,.08); }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; }
.footer-tag { font-family: var(--font-display); color: var(--cream-dim); margin: .6rem 0 .9rem; font-size: 1.05rem; }
.pixel-stamp-foot { font-size: .56rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.3rem; }
.footer-nav a { color: var(--cream-dim); font-weight: 600; font-size: .96rem; transition: color .2s; }
.footer-nav a:hover { color: var(--gold); }
.footer-fine { margin-top: 2.2rem; }
.footer-fine p { font-size: .78rem; color: rgba(182,164,200,.7); max-width: 60ch; margin: 0; line-height: 1.5; }

/* ============================================================
   REVEAL ANIMATIONS (page-load stagger + on-scroll)
   ============================================================ */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--delay, 0s);
}
/* hero reveals fire on load automatically */
.hero .reveal { animation: heroReveal .8s var(--ease) forwards; animation-delay: var(--delay, 0s); }
@keyframes heroReveal { to { opacity: 1; transform: none; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .better-row { grid-template-columns: repeat(2, 1fr); }
  .nostalgia-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .nostalgia-aside { border-left: 3px solid rgba(255,211,110,.3); padding-left: 1.2rem; }
}

@media (max-width: 600px) {
  .header-nav { gap: .9rem; }
  .header-nav .nav-link { display: none; }       /* keep header tidy on phones; Play stays */
  .hero { min-height: clamp(560px, 92svh, 820px); padding-top: 1.5rem; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; }
  .feature-grid { grid-template-columns: 1fr; }
  .better-row { grid-template-columns: 1fr; gap: 1.1rem; }
  .cta-actions { flex-direction: column; align-items: stretch; }
  .cta-actions .btn { justify-content: center; }
  .footer-inner { flex-direction: column; gap: 1.4rem; }
  .avatars { width: min(360px, 86vw); height: 140px; }
  .av-2 { width: 96px; }
  .avatar { width: 82px; }
}

@media (max-width: 380px) {
  .hero-title { font-size: 3rem; }
  .pixel-stamp { font-size: .56rem; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .cloud, .star, .win, .bulb, .jet, .flag, .avatar, .trust-dot { animation: none !important; }
}
