/* Small Echoes — landing page. One world, web temperature (docs/DESIGN_SYSTEM.md):
   warm dusk storybook — deep indigo lit by firefly amber, Fraunces for storybook
   moments, Hanken Grotesk for everything functional. Tokens mirror design/tokens.json
   (the JSON stays canonical). Fonts self-hosted: no Google CDN — privacy is the brand. */

/* ---------- tokens ---------- */
:root {
  --dusk-900: #0E1230;
  --dusk-800: #15183A;
  --dusk-700: #1C2049;
  --plum-600: #2A1F44;
  --firefly-500: #F7C768;
  --firefly-300: #FFD98A;
  --firefly-100: #FFF4D6;
  --ember-600: #E8A23D;
  --star-200: #CBD6FF;
  --paper-50: #F4ECDB;
  --paper-mute: #B9B2C9;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --band-w: 44rem;
  color-scheme: dark;
}

@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/Fraunces_400Regular.ttf") format("truetype");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/Fraunces_600SemiBold.ttf") format("truetype");
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("assets/fonts/HankenGrotesk_400Regular.ttf") format("truetype");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("assets/fonts/HankenGrotesk_600SemiBold.ttf") format("truetype");
  font-weight: 600; font-display: swap;
}

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--dusk-900);
  color: var(--paper-50);
  font-family: "Hanken Grotesk", -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
h1, h2, h3, .price, .wordmark { font-family: "Fraunces", Georgia, serif; }
h1 { font-size: clamp(1.85rem, 6vw, 3.4rem); font-weight: 600; line-height: 1.12; }
/* The hero's two-line break only where both lines fit; phones wrap naturally. */
.br-wide { display: none; }
@media (min-width: 560px) { .br-wide { display: inline; } }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 600; line-height: 1.2; margin-bottom: .9rem; }
h3 { font-size: 1.2rem; font-weight: 600; }
p  { margin: .55rem 0; }
em { color: var(--firefly-300); font-style: italic; }
img { max-width: 100%; height: auto; }
.muted { color: var(--paper-mute); font-size: .95rem; }

/* ---------- ambient fireflies ---------- */
.fireflies { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.fireflies span {
  position: absolute;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--firefly-300);
  box-shadow: 0 0 10px 3px rgba(247, 199, 104, .45);
  opacity: .0;
  animation: drift var(--dur, 9s) ease-in-out var(--delay, 0s) infinite alternate,
             glow  calc(var(--dur, 9s) * .6) ease-in-out var(--delay, 0s) infinite alternate;
}
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(var(--dx, 30px), var(--dy, -46px)); } }
@keyframes glow  { from { opacity: .12; } 55% { opacity: .75; } to { opacity: .2; } }
@media (prefers-reduced-motion: reduce) {
  .fireflies span { animation: none; opacity: .35; }
  html { scroll-behavior: auto; }
}

/* ---------- header ---------- */
.top {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem clamp(1.2rem, 4vw, 2.5rem);
}
.wordmark { font-weight: 600; font-size: 1.15rem; letter-spacing: .4px; color: var(--firefly-100); }
.top-cta {
  color: var(--dusk-900); background: var(--firefly-500);
  text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: .5rem 1.1rem; border-radius: var(--radius-pill);
}

/* ---------- hero (full-bleed dusk; content stays in the reading column) ---------- */
.hero {
  position: relative; z-index: 1;
  padding: clamp(1rem, 4vh, 3rem) 1.4rem 4.5rem;
  text-align: center;
  background:
    radial-gradient(60% 42% at 50% 30%, rgba(247, 199, 104, .10), transparent 70%),
    linear-gradient(rgba(14, 18, 48, .25), rgba(14, 18, 48, .9)),
    url("assets/sky.jpg") top center / cover no-repeat;
  background-blend-mode: screen, normal, normal;
}
.hero > * { max-width: var(--band-w); margin-left: auto; margin-right: auto; }
.hero-art { position: relative; height: clamp(230px, 36vw, 320px); margin-bottom: 1rem; }
.echo-glow {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: clamp(260px, 42vw, 380px); aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 217, 138, .32), rgba(247, 199, 104, .08) 55%, transparent 72%);
  border-radius: 50%;
  animation: breathe 3.4s ease-in-out infinite alternate;
}
@keyframes breathe { from { transform: translate(-50%, -50%) scale(1); } to { transform: translate(-50%, -50%) scale(1.035); } }
@media (prefers-reduced-motion: reduce) { .echo-glow { animation: none; } }
.echo {
  position: relative;
  width: clamp(190px, 32vw, 270px); height: auto;
  filter: drop-shadow(0 12px 34px rgba(0, 0, 0, .45));
}
.hero-jar-wrap {
  position: absolute; right: clamp(0px, 12vw, 130px); bottom: -14px;
  width: clamp(84px, 13vw, 120px);
}
.hero-jar {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .5));
}
/* This week's fireflies, alive inside the glass (jar interior ≈ x 25–75%, y 40–85%). */
.jar-fly {
  position: absolute;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--firefly-100);
  box-shadow: 0 0 6px 2px var(--firefly-300), 0 0 16px 6px rgba(247, 199, 104, .35);
  animation: jar-drift var(--dur, 5s) ease-in-out var(--delay, 0s) infinite alternate,
             glow calc(var(--dur, 5s) * .7) ease-in-out var(--delay, 0s) infinite alternate;
}
.jar-fly:nth-of-type(1) { left: 32%; top: 52%; --dur: 5.2s; --delay: -1.2s; }
.jar-fly:nth-of-type(2) { left: 58%; top: 44%; --dur: 6.1s; --delay: -3.4s; width: 5px; height: 5px; }
.jar-fly:nth-of-type(3) { left: 44%; top: 66%; --dur: 4.6s; --delay: -2.1s; }
.jar-fly:nth-of-type(4) { left: 64%; top: 60%; --dur: 5.7s; --delay: -0.6s; width: 4px; height: 4px; }
.jar-fly:nth-of-type(5) { left: 36%; top: 75%; --dur: 6.4s; --delay: -4.8s; width: 5px; height: 5px; }
.jar-fly:nth-of-type(6) { left: 52%; top: 80%; --dur: 4.9s; --delay: -2.9s; width: 4px; height: 4px; }
@keyframes jar-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(var(--jdx, 7px), var(--jdy, -9px)); }
}
.jar-fly:nth-of-type(2n)  { --jdx: -8px; --jdy: -6px; }
.jar-fly:nth-of-type(3n)  { --jdx: 5px;  --jdy: -11px; }
@media (prefers-reduced-motion: reduce) { .jar-fly { animation: none; } }
.lede {
  max-width: 36rem; margin: 1.1rem auto 0;
  color: var(--paper-mute); font-size: 1.08rem;
}
.cta-row { margin-top: 2rem; display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.cta {
  display: inline-flex; align-items: center; gap: .7rem;
  background: var(--firefly-500); color: var(--dusk-900);
  text-decoration: none; border-radius: 14px;
  padding: .7rem 1.5rem;
  box-shadow: 0 6px 30px rgba(247, 199, 104, .28);
  transition: transform .5s ease, box-shadow .5s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 10px 36px rgba(247, 199, 104, .4); }
.cta span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; font-weight: 600; font-size: 1.15rem; }
.cta span small { font-size: .68rem; font-weight: 400; letter-spacing: .3px; }
.cta-soft { color: var(--paper-mute); font-size: .92rem; text-decoration: underline; text-underline-offset: 3px; }
.cta-soft:hover { color: var(--firefly-300); }
.hero-trust { margin-top: 1.6rem; color: var(--paper-mute); font-size: .9rem; }

/* ---------- bands ---------- */
.band {
  position: relative; z-index: 1;
  max-width: var(--band-w);
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 5rem) 1.4rem;
}
.band h2 { text-align: center; }

/* steps */
.steps { list-style: none; padding: 0; margin-top: 2.2rem; display: grid; gap: 1.2rem; counter-reset: step; }
.steps li {
  counter-increment: step;
  background: var(--dusk-700);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.6rem 1.4rem;
  position: relative;
}
.steps li::before {
  content: counter(step);
  position: absolute; top: 1.4rem; right: 1.5rem;
  font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.6rem;
  color: rgba(247, 199, 104, .35);
}
.step-when {
  display: block;
  padding-right: 2.2rem; /* clear of the big ghost step number */
  color: var(--ember-600); font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
}
.steps h3 { margin: .25rem 0 .3rem; }
.steps p { color: var(--paper-mute); }
@media (min-width: 760px) { .steps { grid-template-columns: 1fr 1fr 1fr; } }

/* pour art band */
.pour-band { margin: 0 auto; max-width: 56rem; padding: 0 1.4rem; text-align: center; }
.pour-band img { border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.pour-band figcaption { color: var(--paper-mute); font-size: .9rem; margin-top: .8rem; }
/* The pour moment: fireflies alive inside the held-up jar (glass interior
   ≈ x 44–56%, y 52–78% of pour.jpg — Echo's face is directly above the rim,
   so everything stays in the glass). */
.pour-art { position: relative; display: inline-block; overflow: hidden; border-radius: var(--radius-lg); }
.pour-art img { display: block; }
.pour-fly {
  position: absolute;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--firefly-100);
  box-shadow: 0 0 6px 2px var(--firefly-300), 0 0 18px 7px rgba(247, 199, 104, .35);
  animation: jar-drift var(--dur, 5s) ease-in-out var(--delay, 0s) infinite alternate,
             glow calc(var(--dur, 5s) * .7) ease-in-out var(--delay, 0s) infinite alternate;
}
.pour-fly:nth-of-type(1) { left: 47%; top: 62%; --dur: 5.4s; --delay: -1.6s; }
.pour-fly:nth-of-type(2) { left: 53%; top: 58%; --dur: 6.2s; --delay: -3.1s; width: 5px; height: 5px; }
.pour-fly:nth-of-type(3) { left: 49%; top: 70%; --dur: 4.8s; --delay: -2.4s; width: 6px; height: 6px; }
.pour-fly:nth-of-type(4) { left: 54%; top: 67%; --dur: 5.9s; --delay: -0.8s; width: 5px; height: 5px; }
.pour-fly:nth-of-type(5) { left: 51%; top: 55%; --dur: 6.6s; --delay: -4.2s; width: 5px; height: 5px; }
.pour-fly:nth-of-type(6) { left: 46%; top: 74%; --dur: 5.1s; --delay: -2.9s; width: 4px; height: 4px; }
@media (prefers-reduced-motion: reduce) { .pour-fly { animation: none; } }

/* grandma */
.grandma { text-align: center; }
.grandma-lede {
  font-family: "Fraunces", Georgia, serif; font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--firefly-100); margin: .4rem 0 1.6rem;
}
.email-mock {
  max-width: 26rem; margin: 0 auto; text-align: left;
  background: var(--dusk-700);
  border: 1px solid rgba(203, 214, 255, .14);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.3rem;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .4);
}
.email-line { color: var(--paper-mute); font-size: .82rem; }
.email-subject { font-weight: 600; margin: .35rem 0 .9rem; }
.email-player {
  display: flex; align-items: center; gap: .8rem;
  background: var(--dusk-800);
  border-radius: var(--radius-pill);
  padding: .55rem .9rem;
  color: var(--paper-mute); font-size: .92rem;
}
.play-dot {
  width: 2rem; height: 2rem; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--firefly-500); color: var(--dusk-900); font-size: .7rem;
}
.grandma .muted { max-width: 30rem; margin: 1.4rem auto 0; }

/* sky / keepsake */
.sky-band {
  position: relative; z-index: 1;
  background:
    linear-gradient(rgba(14, 18, 48, .55), rgba(14, 18, 48, .88)),
    url("assets/sky.jpg") center / cover no-repeat;
  padding: clamp(3.5rem, 10vh, 6rem) 1.4rem;
}
.sky-inner { max-width: var(--band-w); margin: 0 auto; text-align: center; }
.sky-inner p { max-width: 34rem; margin-left: auto; margin-right: auto; color: var(--paper-50); }
.sky-note { color: var(--star-200) !important; font-size: .95rem; margin-top: 1rem !important; }

/* privacy */
.privacy { list-style: none; padding: 0; margin-top: 1.8rem; display: grid; gap: 1rem; }
.privacy li {
  border-left: 2px solid var(--ember-600);
  padding: .1rem 0 .1rem 1.1rem;
  color: var(--paper-mute);
}
.privacy strong { color: var(--paper-50); display: block; }
@media (min-width: 760px) { .privacy { grid-template-columns: 1fr 1fr; gap: 1.4rem 2.4rem; } }

/* pricing */
.pricing-lede { text-align: center; color: var(--paper-mute); max-width: 30rem; margin: 0 auto 2rem; }
.plans { display: grid; gap: 1.2rem; }
@media (min-width: 680px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan {
  background: var(--dusk-700);
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  padding: 1.6rem 1.6rem 1.4rem;
  position: relative;
}
.plan.headline { border-color: var(--firefly-500); }
.plan-tag {
  position: absolute; top: -0.75rem; left: 1.4rem;
  background: var(--firefly-500); color: var(--dusk-900);
  font-size: .75rem; font-weight: 600;
  padding: .18rem .7rem; border-radius: var(--radius-pill);
}
.plan p { color: var(--paper-mute); font-size: .95rem; }
.price { font-size: 1.9rem; font-weight: 600; color: var(--firefly-100); margin-top: .8rem; }
.price span { font-size: .95rem; color: var(--paper-mute); font-family: "Hanken Grotesk", sans-serif; }
.band > .muted { text-align: center; margin-top: 1.6rem; }

/* faq */
.faq details {
  border-bottom: 1px solid rgba(203, 214, 255, .12);
  padding: .9rem .2rem;
}
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 1.02rem;
  list-style-position: outside;
}
.faq summary::marker { color: var(--ember-600); }
.faq details p { color: var(--paper-mute); padding-top: .5rem; max-width: 38rem; }

/* closing */
.closing {
  position: relative; z-index: 1;
  text-align: center;
  padding: clamp(3rem, 9vh, 5.5rem) 1.4rem 5rem;
}
.closing-echo { width: 130px; margin-bottom: .6rem; filter: drop-shadow(0 10px 26px rgba(0,0,0,.5)); }
.closing p { color: var(--paper-mute); margin-bottom: 1.6rem; }

/* footer */
footer {
  position: relative; z-index: 1;
  border-top: 1px solid rgba(203, 214, 255, .1);
  text-align: center;
  padding: 2.4rem 1.4rem 3rem;
  color: var(--paper-mute); font-size: .92rem;
}
footer .wordmark { margin-bottom: .4rem; }
footer nav { display: flex; gap: 1.4rem; justify-content: center; margin: 1rem 0; flex-wrap: wrap; }
footer a { color: var(--paper-mute); text-decoration: underline; text-underline-offset: 3px; }
footer a:hover { color: var(--firefly-300); }
.fine { font-size: .8rem; opacity: .75; }

/* ---------- beta signup dialog (pre-launch) ---------- */
.beta-dialog {
  /* the global `* { margin: 0 }` reset removes the UA's `dialog { margin: auto }`
     centering — restore it explicitly */
  margin: auto;
  background: var(--dusk-700);
  color: var(--paper-50);
  border: 1px solid rgba(203, 214, 255, .14);
  border-radius: var(--radius-lg);
  padding: 2rem 1.8rem 1.6rem;
  max-width: 26rem; width: calc(100vw - 2.4rem);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}
.beta-dialog::backdrop { background: rgba(14, 18, 48, .78); backdrop-filter: blur(3px); }
.beta-dialog h3 { font-size: 1.35rem; margin-bottom: .6rem; }
.beta-dialog p { color: var(--paper-mute); font-size: .95rem; margin-bottom: 1rem; }
.beta-close {
  position: absolute; top: .6rem; right: .8rem;
  background: none; border: none; color: var(--paper-mute);
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: .3rem;
}
.beta-close:hover { color: var(--firefly-300); }
.beta-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.beta-row input {
  flex: 1 1 12rem; min-width: 0; /* beat the UA's size-based min-width so the button fits inline */
  background: var(--dusk-900); color: var(--paper-50);
  border: 1px solid rgba(203, 214, 255, .22);
  border-radius: var(--radius-pill);
  padding: .7rem 1.1rem; font: inherit; font-size: .95rem;
}
.beta-row input:focus { outline: 2px solid var(--firefly-500); outline-offset: 1px; border-color: transparent; }
.beta-submit {
  flex: 1 0 auto; /* fills the row when wrapped on narrow phones */
  background: var(--firefly-500); color: var(--dusk-900);
  border: none; border-radius: var(--radius-pill);
  padding: .7rem 1.4rem;
  font: inherit; font-size: .95rem; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(247, 199, 104, .28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.beta-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(247, 199, 104, .4); }
.beta-submit[disabled] { opacity: .6; cursor: wait; transform: none; }
.beta-error { color: var(--ember-600); font-size: .9rem; }
.beta-fine { font-size: .8rem; }
.beta-done { text-align: center; padding: .4rem 0; }
.beta-done h3 { font-size: 1.35rem; margin-bottom: .6rem; }
.beta-done-close {
  background: none; color: var(--firefly-300);
  border: 1px solid rgba(247, 199, 104, .45);
  border-radius: var(--radius-pill);
  padding: .6rem 1.6rem;
  font: inherit; font-size: .95rem; font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.beta-done-close:hover { background: var(--firefly-500); color: var(--dusk-900); border-color: var(--firefly-500); }
