/* Wnder waitlist — "Wander Sky" scheme, per wnder-assets/brand/BRAND.md.
   Wander Sky is BRAND.md's DEFAULT palette and what the app itself boots with
   ("scheme": "skyglass"). The page previously used Powder Glass (#E6EDF3 /
   #F8FAFC / #DCE7F0), which BRAND.md marks explicitly as SECONDARY and not the
   default — see #51. Colour lives in the SURFACES (sky-blue page, near-white
   cards, frosted glass); every bit of text, linework and every control is
   black ink. */
:root {
  --page:      #CDE4F7;  /* sky-blue page background */
  --card:      #FDFEFF;  /* near-white elevated surface */
  --glass:     #BCD9F2;  /* frosted bar tint */
  --halo:      rgba(64,104,150,0.20);
  --ink:       #1A1715;  /* one ink — titles, buttons, linework */
  --ink-soft:  #46423C;  /* body text */
  /* Re-darkened for Wander Sky, user's ruling 2026-08-11 (#51/#52).
     History: #30 took this from BRAND.md's #7C766B to #6E695F to reach 4.62:1
     against the OLD Powder Glass page. Wander Sky is darker, which dropped
     #6E695F to 4.17:1 — under AA's 4.5 — across eight elements. #67625A is the
     same hue walked down 5% and restores 4.62:1, the exact ratio #30 achieved.
     On --card it reads 5.99:1. Measured live in the browser, not derived.
     NOTE FOR THE NEXT PALETTE CHANGE: this token is tuned to --page and has now
     been re-tuned twice. It does not survive a change of ground on its own. */
  --ink-mute:  #67625A;  /* captions / secondary */
  --hair:      rgba(26,23,21,0.10);
  --host:      #18120E;  /* the one warm dark note */

  --card-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 8px 24px rgba(26,23,21,0.10);

  --display: 'Baloo 2', system-ui, sans-serif;
  --sans: 'M PLUS Rounded 1c', system-ui, -apple-system, sans-serif;

  /* paper grain (fine fiber speckle) */
  --grain: 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.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.11 0 0 0 0 0.1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  /* cover grain (cloudy light flecks) for dark ink surfaces */
  --cover-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.96 0 0 0 0 0.88 0 0 0 0.22 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23c)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

/* overflow-x on both html and body: .phone-halo is a fixed-520px decorative
   glow that overflows narrow viewports. body alone doesn't reliably contain
   it — verified live, the page could actually be scrolled ~65px sideways on
   a fresh 390px load. */
html { scroll-behavior: smooth; overflow-x: hidden; }
html, body { margin: 0; }

body {
  background-color: var(--page);
  background-image:
    radial-gradient(110% 60% at 50% -12%, rgba(255,255,255,0.45), rgba(255,255,255,0) 58%),
    var(--grain);
  color: var(--ink-soft);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── drifting sky: soft cloud glows behind the page ── */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.cloud {
  position: absolute;
  background: radial-gradient(closest-side, rgba(253,254,255,0.98), rgba(253,254,255,0) 74%);
  border-radius: 50%;
}
.cloud-a { width: 720px; height: 340px; top: -70px;  left: -140px; }
.cloud-b { width: 860px; height: 400px; top: 100px;  right: -300px; opacity: 0.95; }
.cloud-c { width: 640px; height: 320px; top: 42%;    left: -240px; opacity: 0.9; }
.cloud-d { width: 780px; height: 360px; bottom: -90px; right: -220px; opacity: 0.9; }
.cloud-e { width: 560px; height: 280px; top: 68%;    right: -160px; opacity: 0.75; }

.page {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  /* spacing follows an 8pt scale: 8/16/24/32/48/64/96 — macro gaps between
     sections sit at the top of the scale, micro gaps inside components at
     the bottom, so the page keeps one consistent vertical rhythm. */
  margin: 0 auto;
  padding: 24px clamp(24px, 4vw, 48px) 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── nav ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(24px, 5vw, 64px);
}
/* the night's route across the bar — decorative, mirrors the map language */
.nav-route {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 640px;
  height: 44px;
  color: var(--ink);
  overflow: visible;
}
.wordmark {
  height: 54px;
  width: auto;
  color: var(--ink);
  overflow: visible;
  display: block;
  flex: 0 0 auto;
}

/* ── hero ── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding: clamp(32px, 5vh, 56px) 0 clamp(56px, 8vh, 96px);
}
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 16px;
}
.headline {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  font-size: clamp(36px, 4.6vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
}
.lead {
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 32em;
  margin: 0 0 16px;
}
.lead-keep { margin-bottom: 32px; }

/* ── form ── */
/* the payoff card's "Join the waitlist" is an anchor link to #waitlist-form;
   without this, smooth-scroll (html { scroll-behavior: smooth }) lands the
   field flush against the very top of the viewport with no breathing room —
   a jarring landing that cuts against the page's calm, unhurried tone. */
.form { margin: 0 0 16px; scroll-margin-top: 32px; }
.field {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 620px;
}
#email {
  flex: 1 1 170px;
  min-width: 0;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 4px 14px rgba(26,23,21,0.07);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#email::placeholder { color: var(--ink-mute); opacity: 0.7; }
#email:focus {
  /* Ring taken to full alpha for Wander Sky, user's ruling 2026-08-11 (#51/#52).
     border-color alone (1.85:1) and var(--halo)'s glow alone (1.28:1) each fall
     under WCAG 1.4.11's 3:1 floor against --page, the same gap found in the
     button focus rings (#32/#33), so this ring is the only compliant cue here.
     #34 set it at 0.9 alpha for 3.20:1 against the OLD Powder Glass page; the
     darker Wander Sky ground dropped that to 2.92:1, back under the floor.
     Full alpha restores it to 3.34:1 — measured live, not derived. Raising
     --halo instead was again rejected: it also drives the hero's decorative
     glow and the button rings, so it is the wrong lever for one control. */
  outline: none;
  border-color: rgba(58,124,190,0.55);
  box-shadow: 0 0 0 4px rgba(58,124,190,1);
}
.btn {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--page);
  background: var(--ink);
  border: none;
  border-radius: 16px;
  padding: 16px 24px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 8px 22px rgba(26,23,21,0.22);
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--cover-grain);
  opacity: 0.45;
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(26,23,21,0.28); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }
/* --halo (0.20 alpha) reads at ~1.3:1 against --page — far under the 3:1
   WCAG 1.4.11 floor for non-text focus indicators. Buttons have no other
   focus signal (no border, solid fill), so this ring is the only cue a
   keyboard user gets; strengthened here rather than raising --halo itself,
   which also drives the phone's decorative glow and the email field's ring
   (where the border-color change already carries the signal). */
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(64,104,150,0.8), 0 8px 22px rgba(26,23,21,0.22); }

/* beside the form: quiet social count */
.count-badge {
  align-self: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mute);
  white-space: nowrap;
  padding-left: 4px;
}

/* under the CTA: the founding-member offer */
.founding {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 14px 0 0;
}

/* reserve the widget's footprint (Cloudflare's documented "normal" size is
   300x65) and its margin up front, before it renders — without this,
   content below jumps ~43px down when the widget populates, a real measured
   layout shift, verified live by comparing the DOM position right after
   DOMContentLoaded against the settled position ~1.5s later. Margin is now
   unconditional (was :not(:empty)) so the reserved box doesn't sit flush
   against the text above it while waiting to populate. */
.turnstile { min-height: 65px; margin-top: 16px; }

/* confirmation panel (shown by app.js after signup) */
.confirm {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: var(--card-shadow);
  max-width: 480px;
}
.confirm-line {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 8px;
}
.confirm-nudge {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}
.copy-link {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.copy-link:hover { opacity: 0.75; }
.copy-done { font-size: 13px; color: #1E4D33; margin-left: 6px; }

.form.is-done .field,
.form.is-done .founding,
.form.is-done .turnstile { display: none; }

.status {
  min-height: 20px;
  margin: 12px 2px 0;
  font-size: 14px;
  color: var(--ink-mute);
}
.status:empty { min-height: 0; margin: 0; } /* don't reserve space when silent */
.status[data-kind="error"]   { color: #8E4128; }
.status[data-kind="success"] { color: #1E4D33; }
.status[data-kind="pending"] { color: var(--ink-mute); }

.privacy {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0;
  max-width: 34em;
}

/* social proof — the group chat card */
.proof {
  margin-top: 32px;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: var(--card-shadow);
}
.proof-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 10px;
}
.proof-body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

/* honeypot — visually and semantically removed, still in the DOM for bots */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ── the phone ── */
.hero-phone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 16px; /* keep the phone clear of the nav route */
}
.phone-halo {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: 520px;
  height: 520px;
  transform: translate(-50%, -54%);
  background: radial-gradient(closest-side, var(--halo), rgba(58,124,190,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}
.phone-caption {
  position: relative;
  z-index: 2;
  margin: 40px 0 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* doodles/README.md: landmarks are drawn for 120px; this is a scatter of
   sparks and dots with no fine detail to lose, so it holds up much smaller.
   Sized to sit quietly beside 15px italic text, not compete with the phone. */
.phone-caption-doodle {
  flex-shrink: 0;
  width: 52px;
  height: 26px;
  opacity: 0.7;
}
/* the real framed still (issue #42) — a plain <img>, not a hand-built mock.
   Sized and shadowed to match the footprint the old replica rendered at, so
   the hero's proportions don't jump: same width: min(320px, 80vw), same
   rotate(1.6deg) tilt. filter: drop-shadow (not box-shadow) follows the
   PNG's own alpha silhouette rather than drawing a rectangle behind it —
   box-shadow would ignore the transparency and defeat the point of it. */
.hero-still {
  position: relative;
  z-index: 2;
  display: block;
  width: min(320px, 80vw);
  height: auto;
  filter: drop-shadow(0 24px 60px rgba(26,23,21,0.30));
  transform: rotate(1.6deg);
}

/* ── journal stitch divider: the seam between two pages of the night ── */
.stitch-divider {
  display: flex;
  justify-content: center;
  margin: clamp(16px, 3vh, 40px) auto;
}
.stitch-divider svg {
  display: block;
  width: min(560px, 76vw);
  height: 14px;
  opacity: 0.55;
}

/* ── story ── */
.story {
  padding: clamp(48px, 8vh, 96px) 0 0;
}
.story-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto clamp(40px, 6vh, 64px);
}
.story-title {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
}

.timeline {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 640px;
}
/* center the CARDS (the visual mass), not the marker+card ensemble:
   shift left by half the marker column (44px) + gap (16px) */
@media (min-width: 881px) {
  .timeline { transform: translateX(-30px); }
}
.step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0 16px;
  padding-bottom: 24px;
}
.step-marker {
  position: relative;
  display: flex;
  justify-content: center;
}
/* the wandering spine — a wavy inked line stretching down each step */
.step-marker::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: -14px;
  width: 12px;
  left: 50%;
  transform: translateX(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='120' viewBox='0 0 12 120'%3E%3Cpath d='M 6 0 C 10 22, 2 44, 6 66 C 8.5 80, 4.5 100, 6 120' fill='none' stroke='%231A1715' stroke-width='1.4' stroke-linecap='round' stroke-dasharray='1 7' opacity='0.55'/%3E%3C/svg%3E");
  background-repeat: repeat-y;
  background-position: center top;
}
.step:last-child .step-marker::before { bottom: 8px; }
.step-dot {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 5px var(--page), 0 0 0 6px rgba(26,23,21,0.25);
}
.step-card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--card-shadow);
}
.step-time {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 8px;
}
.step-card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 8px;
}
.step-card p:last-child {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

/* bridge line after the timeline — the same net, any time of day */
.bridge {
  font-family: var(--display);
  font-style: italic;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-mute);
  text-align: center;
  max-width: 34em;
  margin: 8px auto 0;
}

/* ── the payoff: the one dark moment ── */
.payoff {
  position: relative;
  overflow: hidden;
  max-width: 640px;
  margin: clamp(48px, 8vh, 88px) auto 0;
  background: var(--host);
  color: var(--page);
  border-radius: 24px;
  padding: clamp(32px, 5vw, 48px) clamp(24px, 5vw, 48px);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.14),
    inset 0 -3px 6px rgba(0,0,0,0.34),
    0 16px 44px rgba(26,23,21,0.30);
  text-align: center;
}
.payoff::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--cover-grain);
  opacity: 0.5;
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.payoff > * { position: relative; z-index: 1; }
.payoff-line {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #FDFEFF;
  margin: 0 0 16px;
}
.payoff-body {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--page);
  opacity: 0.88;
  max-width: 30em;
  margin: 0 auto 24px;
}
.payoff-body em {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.06em;
}
.btn-sky {
  background: var(--page);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(0,0,0,0.35);
}
.btn-sky::after { opacity: 0.25; }
.btn-sky:hover { box-shadow: 0 10px 26px rgba(0,0,0,0.4); }
/* .btn:focus-visible's ring (rgba(64,104,150,0.8)) clears 3:1 against --page
   but only reaches ~2.5:1 against --host behind this dark-card variant —
   flagged on PR #32's review. Full-opacity ring here clears ~3.3:1 on this
   background specifically. */
.btn-sky:focus-visible { box-shadow: 0 0 0 4px rgba(64,104,150,1), 0 8px 22px rgba(0,0,0,0.35); }

/* ── footer ── */
.foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: clamp(64px, 10vh, 112px);
  padding-top: 32px;
  border-top: 1px solid var(--hair);
}
.foot-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.foot-mark {
  height: 24px;
  color: var(--ink);
  opacity: 0.9;
}
/* echoes the header's own nav-route in the same vocabulary, quieter — the
   footer's genuine open middle ground (~820px at desktop) is the one place
   on the page with real width to spare without displacing anything. */
.foot-route {
  flex-shrink: 0;
  width: 100px;
  height: 20px;
  color: var(--ink-mute);
  opacity: 0.7;
}
.foot-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}
.foot-note {
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
  opacity: 0.85;
}
.foot-tag {
  font-family: var(--display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-mute);
}
.foot-copy { font-size: 13px; color: var(--ink-mute); white-space: nowrap; }

/* ── responsive ── */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 56px;
    padding-top: clamp(32px, 6vh, 56px);
    text-align: left;
  }
  .hero-phone { padding-top: 6px; }
  .hero-still { transform: rotate(0deg); }
}

@media (max-width: 640px) {
  .nav-route { display: none; }
}

@media (max-width: 560px) {
  .btn { flex: 1 1 100%; }
  .step { grid-template-columns: 30px minmax(0, 1fr); gap: 0 14px; }
  .step-card { padding: 18px 20px 20px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}
