/* Bloomword marketing site — on-brand with the app's modern-glass system (slate + emerald + amber).
   Self-contained, no dependencies. Palette mirrors godot/game/scripts/ui_style.gd. */
:root {
  /* GENERATED:tokens:start — do not edit; `just tokens` from design-tokens.json */
  --bg: rgb(14, 20, 30);
  --bg-2: rgb(17, 24, 39);
  --text: rgb(241, 245, 250);
  --muted: rgb(148, 163, 184);
  --accent: rgb(16, 185, 129);
  --accent-2: rgb(60, 209, 153);
  --gold: rgb(250, 191, 76);
  --danger: rgb(240, 115, 107);
  --radius-pill: 22px;
  --radius-card: 18px;
  --radius-chip: 14px;
  --touch-min: 64px;
  --ease-grow: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 140ms;
  --dur-base: 260ms;
  --dur-slow: 650ms;
  /* GENERATED:tokens:end */
  /* web-specific surface treatment (glass) — shares the brand core above, specializes the surface here */
  --surface: rgba(255,255,255,0.04);
  --border:  rgba(255,255,255,0.09);
  --radius:  var(--radius-card);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  background:
    radial-gradient(1100px 600px at 78% -8%, rgba(16,185,129,0.16), transparent 60%),
    radial-gradient(900px 600px at 8% 6%, rgba(99,102,241,0.12), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* Brand wordmark — rounded face echoing the in-app Fredoka logo. */
.brand {
  font-family: "SF Pro Rounded", "Nunito", "Quicksand", ui-rounded, system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: .2px;
  background: linear-gradient(92deg, var(--gold), #ffd98a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Nav */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 56px);
  max-width: 1160px; margin: 0 auto;
}
.nav-links { display: flex; align-items: center; gap: clamp(14px, 3vw, 30px); font-weight: 600; }
.nav-links a { color: var(--muted); transition: color .15s ease; }
.nav-links a:hover { color: var(--text); }
.pill {
  padding: 9px 18px; border-radius: 999px;
  background: rgba(16,185,129,0.14); border: 1px solid rgba(52,211,153,0.4);
  color: var(--accent-2) !important;
}

/* Hero */
.hero {
  max-width: 1160px; margin: 0 auto; padding: clamp(40px, 8vw, 96px) clamp(20px, 5vw, 56px);
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px); align-items: center;
}
.hero h1 {
  font-family: "SF Pro Rounded", "Nunito", ui-rounded, system-ui, sans-serif;
  font-weight: 800; font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1.04; margin: 0 0 18px;
}
.accent {
  background: linear-gradient(92deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 36ch; }
.cta-row { display: flex; align-items: center; gap: 18px; margin-top: 28px; flex-wrap: wrap; }
.badge {
  padding: 12px 22px; border-radius: 999px; font-weight: 700;
  background: linear-gradient(180deg, rgba(16,185,129,0.5), rgba(16,185,129,0.32));
  border: 1px solid rgba(52,211,153,0.55); box-shadow: 0 8px 30px rgba(16,185,129,0.25);
}
.ghost { color: var(--text); font-weight: 600; border-bottom: 1px solid transparent; }
.ghost:hover { border-color: var(--accent-2); }

.hero-art { display: flex; justify-content: center; }
.art-frame {
  width: 100%; max-width: 320px; aspect-ratio: 9 / 16; border-radius: 28px;
  background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(8px);
  display: grid; place-items: center; color: var(--muted); font-style: italic;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}

/* Sections */
section { scroll-margin-top: 80px; }
.features {
  max-width: 1160px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(20px, 5vw, 56px);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; backdrop-filter: blur(6px);
}
.card h3 { margin: 0 0 8px; font-size: 1.12rem; }
.card p { margin: 0; color: var(--muted); font-size: .98rem; }

.transparency {
  max-width: 880px; margin: clamp(40px, 8vw, 90px) auto; padding: 0 clamp(20px, 5vw, 56px); text-align: center;
}
.transparency h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 12px; }
.transparency p { color: var(--muted); max-width: 56ch; margin: 0 auto 22px; }
.links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.links a {
  padding: 11px 18px; border-radius: 12px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.links a:hover { border-color: var(--accent-2); }

.footer {
  max-width: 1160px; margin: 0 auto; padding: 40px clamp(20px, 5vw, 56px);
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  color: var(--muted); font-size: .92rem; border-top: 1px solid var(--border);
}
.footer a:hover { color: var(--text); }
.dot { opacity: .5; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero-art { order: -1; }
  .art-frame { max-width: 240px; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .features { grid-template-columns: 1fr; }
  .nav-links a:not(.pill) { display: none; }
}

/* ===========================================================================
   Motion — clean, alive, on-brand. EVERY animation is gated behind
   prefers-reduced-motion: no-preference, and the base (static) state below is
   the fully-resolved look, so reduced-motion visitors get a complete page.
   =========================================================================== */
.aurora, #motes { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.aurora {
  background:
    radial-gradient(38% 48% at 80% 12%, rgba(16,185,129,0.14), transparent 70%),
    radial-gradient(40% 50% at 12% 18%, rgba(99,102,241,0.11), transparent 70%),
    radial-gradient(55% 40% at 50% 102%, rgba(249,191,77,0.07), transparent 70%);
}
.nav, main, .footer { position: relative; z-index: 1; }

.living { width: 100%; height: 100%; display: block; }
.stem { stroke-dasharray: 170; stroke-dashoffset: 0; }              /* base = fully drawn */
.leaf, .bloom { transform-box: fill-box; transform-origin: 50% 100%; }
.card { transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.links a, .pill, .ghost, .badge { transition: all .2s ease; }

@media (prefers-reduced-motion: no-preference) {
  .aurora { animation: drift 26s ease-in-out infinite alternate; will-change: transform; }
  @keyframes drift {
    0%   { transform: translate3d(-2%, -1%, 0) scale(1.05); }
    100% { transform: translate3d(2%,  2%, 0) scale(1.12); }
  }

  /* Staggered entrance */
  .reveal { opacity: 0; transform: translateY(18px); animation: fadeUp .9s cubic-bezier(.2,.7,.2,1) forwards; }
  .hero-copy .reveal:nth-child(1) { animation-delay: .05s; }
  .hero-copy .reveal:nth-child(2) { animation-delay: .18s; }
  .hero-copy .reveal:nth-child(3) { animation-delay: .31s; }
  .hero-art.reveal { animation-delay: .22s; }
  @keyframes fadeUp { to { opacity: 1; transform: none; } }

  /* The garden grows in, then gently breathes */
  .stem  { stroke-dashoffset: 170; animation: draw 1.7s ease forwards .5s; }
  .leaf  { transform: scale(0); }
  .leaf-l { animation: bloom .8s cubic-bezier(.2,.8,.2,1) forwards 1.1s; }
  .leaf-r { animation: bloom .8s cubic-bezier(.2,.8,.2,1) forwards 1.35s; }
  .bloom { transform: scale(0); animation: pop .7s cubic-bezier(.2,.9,.2,1) forwards 1.7s; }
  .garden { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 6.5s ease-in-out 2.4s infinite alternate; }
  .sun   { transform-box: fill-box; transform-origin: center; animation: pulse 6s ease-in-out infinite; }
  .sp    { animation: rise 7s linear infinite; }
  .sp2   { animation-duration: 9s;  animation-delay: -3s; }
  .sp3   { animation-duration: 11s; animation-delay: -6s; }

  @keyframes draw  { to { stroke-dashoffset: 0; } }
  @keyframes bloom { to { transform: scale(1); } }
  @keyframes pop   { 0% { transform: scale(0); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }
  @keyframes sway  { 0% { transform: rotate(-1.6deg); } 100% { transform: rotate(1.6deg); } }
  @keyframes pulse { 0%,100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
  @keyframes rise  { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: .8; } 100% { transform: translateY(-120px); opacity: 0; } }

  .card:hover { transform: translateY(-4px); border-color: rgba(52,211,153,0.4); box-shadow: 0 18px 40px rgba(0,0,0,0.35); }
  .pill:hover, .badge:hover { transform: translateY(-1px); }
}

/* Hero video (the animated logo) fills the rounded frame; its poster shows for reduced-motion. */
.art-frame { overflow: hidden; }
.hero-vid { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Biome hero dots — click a world to stick on it (else they auto-cycle as each blooms in). */
.biome-dots { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.dot {
  width: 11px; height: 11px; border-radius: 999px; padding: 0; cursor: pointer;
  background: rgba(255,255,255,0.22); border: 1px solid rgba(255,255,255,0.35); transition: all .2s ease;
}
.dot:hover { background: rgba(255,255,255,0.45); transform: scale(1.15); }
.dot[aria-selected="true"] {
  background: var(--accent-2); border-color: var(--accent-2); box-shadow: 0 0 10px rgba(52,211,153,0.6);
}
@media (prefers-reduced-motion: no-preference) { .dot { transition: all .2s ease; } }

/* Doc pages (public/*.html) — readable column on the brand backdrop. */
.doc { max-width: 720px; margin: 0 auto; padding: clamp(28px,6vw,72px) clamp(20px,5vw,40px); position: relative; z-index: 1; }
.doc h1 { font-size: clamp(2rem,5vw,2.8rem); margin: 0 0 .4em; }
.doc h2 { margin: 1.6em 0 .4em; }
.doc p, .doc li { color: #cdd6e4; }
.doc blockquote { border-left: 3px solid var(--accent); margin: 1.2em 0; padding: .2em 0 .2em 1.1em; color: var(--muted); }
.doc a { color: var(--accent-2); }
.doc code { background: rgba(255,255,255,0.06); padding: .1em .35em; border-radius: 5px; font-size: .92em; }
.doc hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

/* "Coming soon" placeholders for unwritten doc pages (no dead links). */
.links .soon { padding: 11px 18px; border-radius: 12px; border: 1px dashed var(--border); color: var(--muted); opacity: .65; }
.footer .soon { color: var(--muted); opacity: .65; }

/* ===== How-it-works page — visual step storyboard (mirrors the in-app How-to-play) ===== */
.how { max-width: 760px; margin: 0 auto; padding: clamp(28px,6vw,80px) clamp(20px,5vw,40px); position: relative; z-index: 1; }
.how-head { text-align: center; margin-bottom: clamp(28px,5vw,52px); }
.how-head h1 { font-family: "SF Pro Rounded","Nunito",ui-rounded,system-ui,sans-serif; font-weight: 800; font-size: clamp(2.4rem,6vw,3.6rem); margin: 0 0 14px; }
.how-head .lede { color: var(--muted); font-size: clamp(1.05rem,1.6vw,1.2rem); max-width: 54ch; margin: 0 auto; }
.steps { list-style: none; margin: 0 auto; padding: 0; max-width: 640px; position: relative; }
.steps::before { content: ""; position: absolute; left: 27px; top: 24px; bottom: 24px; width: 2px; background: linear-gradient(var(--accent), var(--gold)); opacity: .3; }
.step { display: flex; gap: 20px; align-items: flex-start; padding: 16px 0; position: relative; }
.step-badge { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 999px; display: grid; place-items: center; font-family: "SF Pro Rounded","Nunito",ui-rounded,system-ui,sans-serif; font-weight: 800; font-size: 1.5rem; color: #0b0f17; box-shadow: 0 8px 24px rgba(0,0,0,0.35); position: relative; z-index: 1; }
.step-badge.e { background: linear-gradient(160deg, var(--accent-2), var(--accent)); }
.step-badge.g { background: linear-gradient(160deg, #ffd98a, var(--gold)); }
.step-badge.c { background: linear-gradient(160deg, #9ec1ff, #6ea8fe); }
.step h3 { margin: 9px 0 6px; font-size: 1.28rem; }
.step p { margin: 0; color: #cdd6e4; line-height: 1.7; }
.how-cta { display: flex; gap: 18px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: clamp(32px,5vw,56px); }
@media (prefers-reduced-motion: no-preference) {
  .how-head.reveal { animation-delay: .04s; }
  .steps .step:nth-child(1) { animation-delay: .14s; }
  .steps .step:nth-child(2) { animation-delay: .26s; }
  .steps .step:nth-child(3) { animation-delay: .38s; }
  .steps .step:nth-child(4) { animation-delay: .50s; }
  .steps .step:nth-child(5) { animation-delay: .62s; }
  .how-cta.reveal { animation-delay: .76s; }
}
