/*
 * www/ landing — shared base styles.
 * Consumes tokens.css (verbatim copy of web/src/tokens.css — run check-sync.sh).
 * Aurora stage + .fable-orb CSS mirror web/src/app.css (§ "Fable aurora stage") — keep in sync.
 */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
code, .mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

/* ---- aurora stage (mirrors app.css) ---- */
.aurora-stage { position: fixed; inset: 0; z-index: var(--z-field, 0); pointer-events: none; background: var(--stage-bg, #FFFFF0); overflow: hidden; }
.aurora-blobs { position: absolute; inset: -20%; filter: blur(60px); opacity: var(--stage-aurora-opacity, .95); }
.aurora-stage--m .aurora-blobs { opacity: calc(var(--stage-aurora-opacity, .95) * .55); }
.aurora-blobs span { position: absolute; border-radius: 50%; mix-blend-mode: var(--stage-blob-blend, multiply); }
.aurora-blobs .b1 { width: 46vw; height: 46vw; left: 6vw; top: 6vh; background: radial-gradient(circle, var(--stage-blob-a), transparent 70%); animation: aur1 15s ease-in-out infinite; }
.aurora-blobs .b2 { width: 42vw; height: 42vw; right: 4vw; top: 18vh; background: radial-gradient(circle, var(--stage-blob-b), transparent 70%); animation: aur2 18s ease-in-out infinite; }
.aurora-blobs .b3 { width: 38vw; height: 38vw; left: 24vw; bottom: -6vh; background: radial-gradient(circle, var(--stage-blob-c), transparent 72%); animation: aur3 21s ease-in-out infinite; }
@keyframes aur1 { 50% { transform: translate(4vw, 3vh) scale(1.12); } }
@keyframes aur2 { 50% { transform: translate(-3vw, 2.6vh) scale(1.08); } }
@keyframes aur3 { 50% { transform: translate(3vw, -2.8vh) scale(1.14); } }
.aurora-grid { position: absolute; inset: 0; opacity: var(--stage-grid-opacity, .55); mix-blend-mode: var(--stage-blob-blend, multiply); background-image: radial-gradient(var(--stage-grid) 0.15px, transparent var(--stage-grid-fade, 0.5px)); background-size: 5px 5px; }

/* ---- the orb (V1e slow swell — shape drawn by orb.js; mirrors app.css) ---- */
.fable-orb { filter: blur(1.5px) drop-shadow(0 0 20px rgba(0, 179, 126, .2)); overflow: visible; animation: orbbreathe 7s ease-in-out infinite; }
@keyframes orbbreathe { 0%, 100% { transform: scale(.98); } 50% { transform: scale(1.03); } }

/* ---- page scaffold ---- */
.page { position: relative; z-index: var(--z-page, 1); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

.topnav { position: sticky; top: 0; z-index: var(--z-nav, 10); display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; }
.wordmark { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; font-size: 17px; color: var(--text); text-decoration: none; min-height: 44px; }
.wordmark .fable-orb { animation: none; filter: none; }

/* buttons — cobalt is the affordance color, and ONLY the affordance color */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 500; font-size: 15px;
  padding: 10px 18px; border-radius: var(--radius-pill);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .18s var(--ease-instrument), box-shadow .18s var(--ease-instrument), background .18s var(--ease-instrument);
}
.btn-primary { background: var(--interactive, #2E6BFF); color: var(--on-interactive, #fff); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(46, 107, 255, .28); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--hairline-strong); }
.btn-ghost:hover { background: var(--surface); }

/* theme toggle */
.theme-toggle { background: transparent; border: 1px solid var(--hairline-strong); border-radius: var(--radius-pill); width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); }
.theme-toggle:hover { color: var(--text); }

/* Focus system — one visible ring on every interactive element (keyboard only). */
a:focus-visible, button:focus-visible, input:focus-visible, .theme-toggle:focus-visible {
  outline: 2px solid var(--interactive);
  outline-offset: var(--focus-ring-offset, 2px);
  border-radius: var(--radius-small);
}
.theme-toggle svg { width: 17px; height: 17px; }
[data-theme="dark"] .icon-moon { display: none; }
:root:not([data-theme="dark"]) .icon-sun { display: none; }

/* frosted glass panel (A3 dark rule: rgba .07 + blur 10px; light gets a warm card) */
.frost {
  background: rgba(255, 255, 255, .62);
  border: 1px solid var(--stage-card-border, #EAE7DA);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
[data-theme="dark"] .frost { background: rgba(255, 255, 255, .07); border-color: var(--hairline); }

/* video slot — 16:9 frame; poster until VIDEO_EMBED_URL is set */
.video-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-lg); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-poster { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; cursor: default; }
.video-poster .play {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--hairline-strong);
  color: var(--text);
}
.video-poster .play svg { width: 22px; height: 22px; margin-left: 3px; }
.video-poster .caption { font-size: 14px; color: var(--muted); }

/* waitlist form */
.waitlist { display: flex; gap: 10px; max-width: 440px; width: 100%; }
.waitlist input[type="email"] {
  flex: 1; min-width: 0; font: inherit; font-size: 15px;
  padding: 10px 16px; border-radius: var(--radius-pill);
  border: 1px solid var(--hairline-strong); background: var(--surface); color: var(--text);
}
.waitlist input[type="email"]:focus { outline: 2px solid var(--interactive); outline-offset: 1px; border-color: transparent; }
.waitlist .hp { position: absolute; left: -9999px; opacity: 0; }
.form-note { font-size: 14px; color: var(--muted); min-height: 1.5em; margin-top: 10px; }
.form-note.ok { color: var(--accent-ink); }
.form-note.err { color: var(--danger-ink); }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-instrument), transform .7s var(--ease-instrument); }
.reveal.in { opacity: 1; transform: none; }

footer.site { padding: 48px 0 40px; color: var(--muted); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .fable-orb, .aurora-blobs span { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
  .btn-primary:hover { transform: none; }
  html { scroll-behavior: auto; }
}
