/* 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 — verified aliases to Such Graphics v2 */
  --bg: var(--sg-bg);
  --bg-2: rgb(17, 24, 39);
  --text: var(--sg-ink);
  --muted: var(--sg-muted);
  --accent: var(--sg-accent);
  --accent-2: var(--sg-accent-hi);
  --gold: var(--sg-gold);
  --danger: rgb(240, 115, 107);
  --radius-pill: 22px;
  --radius-card: var(--sg-corner-md);
  --radius-chip: 14px;
  --touch-min: 64px;
  --ease-grow: var(--sg-motion-grow-curve);
  --ease-out: var(--sg-motion-fade-curve);
  --dur-fast: 140ms;
  --dur-base: var(--sg-dur-fade);
  --dur-slow: var(--sg-dur-grow);
  /* 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: var(--sg-font-body);
  line-height: 1.6;
  background: var(--bg);
  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: var(--sg-font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0;
  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, .button-primary {
  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;
}
.button-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 11px 18px; cursor: pointer; font: inherit; font-weight: 800;
  background: linear-gradient(180deg, rgba(16,185,129,.72), rgba(5,125,88,.8));
  color: #f6fff9 !important; border-color: rgba(145,255,208,.58);
  box-shadow: 0 10px 28px rgba(16,185,129,.22);
}
.button-primary:hover { border-color: #d8ffea; filter: brightness(1.08); }

/* Hero */
.hero {
  max-width: 1160px; margin: 0 auto; padding: clamp(36px, 6vw, 72px) clamp(20px, 5vw, 56px);
  min-height: min(760px, calc(100svh - 104px));
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px); align-items: center;
  position: relative; isolation: isolate; overflow: hidden;
  background: url("assets/bloomword-hero-wide.jpg") center / cover no-repeat;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(7, 11, 18, 0.82);
}
.hero-copy, .hero-art { position: relative; z-index: 1; }
.hero-kicker { color: var(--gold); font-weight: 800; text-transform: uppercase; font-size: .82rem; }
.hero h1 {
  font-family: var(--sg-font-display);
  font-weight: 800; font-size: clamp(3.4rem, 7vw, 5.4rem); line-height: 1; margin: 4px 0 6px;
  text-shadow: 0 4px 24px rgba(0,0,0,.65);
}
.hero-offer {
  margin: 0 0 12px; color: var(--accent-2); font-weight: 800;
  font-size: clamp(1.45rem, 3vw, 2.15rem); line-height: 1.1;
}
.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; }
.hero-store-badges { margin-top: 22px; }
.hero-secondary-actions { margin-top: 2px; gap: 16px; }
.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); }
.trailer-button {
  min-height: 48px; padding: 10px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(250,191,76,.62); background: rgba(10,14,20,.74);
  color: var(--gold); font: inherit; font-weight: 800;
}
.trailer-button:hover { border-color: var(--gold); color: white; }
.trailer-button span { margin-right: 6px; }

.hero-art { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.art-frame {
  width: 100%; max-width: 330px; aspect-ratio: 9 / 16; border-radius: 6px;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,0.42);
}

/* 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; }

.score-systems {
  max-width: 1160px; margin: clamp(46px, 8vw, 100px) auto 0; padding: 0 clamp(20px, 5vw, 56px);
}
.section-kicker {
  color: var(--gold); font-weight: 800; text-transform: uppercase; letter-spacing: 0; font-size: .78rem;
}
.score-systems h2 {
  max-width: 760px; margin: 8px 0 10px;
  font-family: "SF Pro Rounded", "Nunito", ui-rounded, system-ui, sans-serif;
  font-weight: 800; font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.08;
}
.section-lede {
  max-width: 680px; margin: 0 0 24px; color: var(--muted); font-size: clamp(1.02rem, 1.5vw, 1.18rem);
}
.score-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.score-card {
  min-height: 218px; padding: 22px; border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03)),
    var(--surface);
  border: 1px solid var(--border); backdrop-filter: blur(6px);
}
.score-chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px;
  color: #09120f; background: linear-gradient(160deg, #ffd98a, var(--gold));
  font-size: .76rem; font-weight: 800;
}
.score-card h3 { margin: 16px 0 8px; font-size: 1.12rem; line-height: 1.2; }
.score-card p { margin: 0; color: #c7d2e2; font-size: .97rem; }
.score-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.score-actions a {
  padding: 11px 16px; border-radius: 12px; font-weight: 700;
  background: rgba(16,185,129,0.12); border: 1px solid rgba(52,211,153,0.36); color: var(--text);
}
.score-actions a:hover { border-color: var(--accent-2); color: var(--accent-2); }

.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; }
.download {
  width: calc(100% - 40px); max-width: 1080px; margin: 0 auto clamp(72px, 9vw, 112px);
  padding: clamp(32px, 5vw, 56px);
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(330px, .92fr); gap: clamp(32px, 6vw, 76px);
  align-items: center; position: relative; isolation: isolate; overflow: hidden;
  border: 1px solid rgba(52,211,153,.34); border-radius: 28px;
  background:
    linear-gradient(125deg, rgba(16,185,129,.16), rgba(250,191,76,.075) 58%, rgba(255,255,255,.025)),
    #111925;
  box-shadow: 0 28px 80px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.05);
}
.download::after {
  content: ""; position: absolute; z-index: -1; width: 320px; aspect-ratio: 1; right: -105px; bottom: -205px;
  border-radius: 999px; background: rgba(16,185,129,.2); filter: blur(54px); pointer-events: none;
}
.download-copy, .download-store-badges { position: relative; z-index: 1; }
.download h2 { margin: 7px 0 8px; font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.08; }
.download p { max-width: 52ch; margin: 0; color: #cdd6e4; }
.store-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.download-store-badges { justify-content: flex-end; }
.store-badge {
  min-height: 78px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  border-radius: 10px;
}
.store-badge img { width: auto; max-width: none; display: block; }
.store-badge--apple img { height: 52px; }
.store-badge--google img { height: 78px; }
.store-badge:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }
.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: 42px clamp(24px, 5vw, 56px) max(64px, calc(env(safe-area-inset-bottom) + 36px));
  display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  color: var(--muted); font-size: .92rem; border-top: 1px solid var(--border);
}
.footer-primary { width: 100%; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.store-legal { flex-basis: 100%; max-width: 850px; margin: 4px auto 0; color: #738197; text-align: center; font-size: .7rem; line-height: 1.55; }
.footer a:hover { color: var(--text); }
.dot { opacity: .5; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: left; min-height: 0; background-position: left center; }
  .hero-art { order: -1; }
  .art-frame { max-width: 240px; }
  .features { grid-template-columns: 1fr 1fr; }
  .score-grid { grid-template-columns: 1fr 1fr; }
  .download { grid-template-columns: 1fr; }
  .download-store-badges { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .nav { padding: 16px 20px; gap: 14px; }
  .brand { font-size: 1.2rem; }
  .nav-links { display: none; }
  .features { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: 1fr; }
  .download { width: calc(100% - 32px); padding: 28px 22px; border-radius: 22px; }
  .store-badges { gap: 8px; }
  .store-badge { min-height: 66px; }
  .store-badge--apple img { height: 44px; }
  .store-badge--google img { height: 66px; }
  .footer { padding-inline: 20px; }
}

/* ===========================================================================
   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 { display: none; }
.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, .button-primary, .ghost, .badge, .trailer-button { transition: all .2s ease; }

@media (prefers-reduced-motion: no-preference) {
  /* 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-copy .reveal:nth-child(4) { animation-delay: .44s; }
  .hero-copy .reveal:nth-child(5) { animation-delay: .57s; }
  .hero-copy .reveal:nth-child(6) { animation-delay: .70s; }
  .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, .button-primary: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; } }

/* Native gameplay modal: one familiar close icon and the actual vertical promo. */
.trailer {
  width: min(420px, calc(100vw - 28px)); max-height: 92vh; padding: 8px;
  border: 1px solid var(--border); border-radius: 8px; background: #080d14; color: var(--text);
  box-shadow: 0 30px 100px rgba(0,0,0,.75);
}
.trailer::backdrop { background: rgba(0,0,0,.82); }
.trailer video {
  width: 100%; max-height: calc(92vh - 16px); aspect-ratio: 9 / 16;
  object-fit: contain; display: block; background: #000;
}
.trailer-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 42px; height: 42px; padding: 0; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.38); background: rgba(7,11,18,.82);
  color: white; font: 700 26px/1 system-ui, sans-serif;
}

/* 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; }

/* ===== 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; }
}
