/* ═══════════════════════════════════════════════════════════════════════
   Emberwild — marketing site
   "an ember glowing in the wild dark": warm hearth-light against near-black.
   Tokens from DESIGN.md (brand layer) + docs/designs/emberwild-marketing-site.md
   (D11). Boldness is spent ONCE — the ember glow. Everything else stays quiet.
   No cards. No gradient buttons. No third-party anything.
   ═══════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/fraunces.woff2?v=1") format("woff2");
  font-weight: 100 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/static/fonts/instrument-sans.woff2?v=1") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  /* The ONE monospace element (the live strip): the world you step into.
     Same face the classic client wears — brand rhyme, 7KB. */
  font-family: "VT323";
  src: url("/static/fonts/vt323.woff2?v=1") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* color tokens (D11) */
  --coal: #141110;
  --surface: #1d1917;
  --ember: #ff6a2c;
  --ember-hi: #ff8a3c;
  --ember-lo: #ff4d2e;
  --hot-core: #ffd08a;
  --ink: #f3eadf;      /* warm off-white display text */
  --ash: #a89b8d;      /* secondary text */
  /* NOTE: in-game money-amber #F2B845 is BANNED on this site (DESIGN.md). */

  /* live tint — PR2's /api/v1/world drives this; neutral until then */
  --world-tint: transparent;

  /* rhythm: 8px scale */
  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px;
  --s6: 48px; --s8: 64px; --s12: 96px; --s16: 128px;
  --col: 72ch;
  --wide: 1200px;
  --radius: 10px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Instrument Sans", "Helvetica Neue", sans-serif;
  --font-strip: "VT323", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--coal);
  color: var(--ink);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2 { font-family: var(--font-display); font-weight: 560; margin: 0; }
p { margin: 0; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--hot-core); outline-offset: 2px; border-radius: 4px; }

/* ── buttons: solid ember, quiet outline. NO gradients on controls. ────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 12px 22px;
  border-radius: var(--radius); border: 0;
  font: 600 16px/1.2 var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .3s ease;
}
.btn-ember {
  background: var(--ember); color: var(--coal);
  /* the one glow on the page besides the hero fire */
  box-shadow: 0 0 24px rgba(255, 106, 44, .35), 0 0 64px rgba(255, 77, 46, .15);
}
.btn-ember:hover { transform: translateY(-1px); box-shadow: 0 0 32px rgba(255, 106, 44, .5), 0 0 80px rgba(255, 77, 46, .2); }
.btn-quiet {
  background: transparent; color: var(--ink);
  border: 1px solid rgba(243, 234, 223, .25);
}
.btn-quiet:hover { border-color: rgba(243, 234, 223, .5); }
.btn[disabled] { opacity: .6; cursor: default; transform: none; }

/* ── hero ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 92svh;
  display: flex; align-items: flex-end;
  isolation: isolate; overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
.hero-video { opacity: 0; transition: opacity 1.2s ease; }
.hero-video.playing { opacity: 1; }
/* Bottom-and-left-weighted coal scrim (D8): text legible over ANY frame. */
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, rgba(20,17,16,.92) 0%, rgba(20,17,16,.55) 32%, rgba(20,17,16,0) 62%),
    linear-gradient(105deg, rgba(20,17,16,.78) 0%, rgba(20,17,16,.25) 45%, rgba(20,17,16,0) 70%);
}
.hero-inner {
  width: 100%; max-width: var(--wide);
  margin: 0 auto; padding: var(--s12) var(--s3) var(--s8);
}
.wordmark {
  font-size: clamp(44px, 8vw, 96px);
  letter-spacing: .01em; line-height: 1.02;
  text-shadow: 0 2px 24px rgba(20,17,16,.6);
}
.tagline {
  font-family: var(--font-display); font-weight: 400; font-style: italic;
  font-size: clamp(19px, 2.6vw, 26px);
  color: var(--ash); letter-spacing: .12em;
  margin: var(--s1) 0 var(--s4) 4px;
}
.cta-row { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* hero inline form: hidden on fine pointers, IS the hero action on touch */
.hero-form { display: none; }

/* ── the honeypot: invisible to humans, irresistible to bots ───────────── */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ── live world strip (fixed height — zero layout shift, D5) ───────────── */
.strip {
  height: 52px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--surface) 92%, var(--world-tint));
  border-top: 1px solid rgba(243,234,223,.08);
  border-bottom: 1px solid rgba(243,234,223,.08);
  transition: background 60s linear;
  overflow: hidden; white-space: nowrap;
}
.strip-inner {
  font: 400 20px/1 var(--font-strip);
  color: var(--ash); letter-spacing: .06em;
  padding: 0 var(--s2); text-overflow: ellipsis; overflow: hidden;
}
.strip-inner .lit { color: var(--hot-core); }

/* ── numbered proof rows — full-width rows, never cards (D9) ───────────── */
main { display: block; }
.row {
  display: grid; align-items: center;
  grid-template-columns: 64px minmax(0, 34ch) minmax(0, 1fr);
  gap: var(--s4);
  max-width: var(--wide); margin: 0 auto;
  padding: var(--s12) var(--s3);
  background: color-mix(in srgb, var(--coal) 96%, var(--world-tint));
}
.row + .row { border-top: 1px solid rgba(243,234,223,.06); }
.row-flip { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 34ch); }
.row-flip .row-text { order: 3; }
.row-flip .frame { order: 2; }
.num {
  font-family: var(--font-display); font-size: clamp(28px, 3vw, 40px);
  color: var(--ember); align-self: start; line-height: 1;
}
.row-text h2 { font-size: clamp(32px, 5vw, 56px); line-height: 1.06; }
.row-text p { color: var(--ash); margin-top: var(--s2); max-width: 36ch; }
.frame {
  margin: 0; position: relative;
  aspect-ratio: 21 / 9; overflow: hidden;
  border: 1px solid rgba(243,234,223,.08);
  border-radius: var(--radius);
  background: var(--surface);
}
.frame .clip { width: 100%; height: 100%; object-fit: cover; display: block; }
/* All three feature clips are clean 21:9 scene bands cut to the frame's EXACT
   aspect — on every breakpoint — so object-fit: cover never slices or
   letterboxes them. Any frame ratio that differs from the clips crops them:
   a 21:9 frame over near-square clips ate ~50% of top/bottom, and a 16:10
   mobile frame sliced a speech bubble mid-sentence. Keep them equal. */
.frame-device { aspect-ratio: 21 / 9; }

/* ── the ask ───────────────────────────────────────────────────────────── */
.ask {
  max-width: 640px; margin: 0 auto;
  padding: var(--s16) var(--s3);
  text-align: left;
}
.ask-head { font-size: clamp(32px, 5vw, 52px); }
.ask-sub { color: var(--ash); margin: var(--s2) 0 var(--s4); }
.field-label {
  display: block; font-size: 13px; letter-spacing: .08em;
  text-transform: lowercase; color: var(--ash); margin-bottom: 6px;
}
.field-row { display: flex; gap: var(--s1); flex-wrap: wrap; }
.field-row input[type="email"] {
  flex: 1 1 220px; min-height: 44px;
  background: var(--surface); color: var(--ink);
  border: 1px solid rgba(243,234,223,.15); border-radius: var(--radius);
  padding: 10px 14px; font: 400 16px/1.4 var(--font-body);
}
.field-row input[type="email"]::placeholder { color: rgba(168,155,141,.55); }
.form-msg { min-height: 1.4em; margin-top: var(--s1); color: var(--ash); font-size: 15px; }
.form-msg.err { color: var(--ember-lo); }

/* founder moment — the one loud place on the site */
.moment { text-align: center; padding: var(--s4) 0; }
.moment-lead { font-family: var(--font-display); color: var(--ash); font-size: 20px; }
.moment-no {
  font-family: var(--font-display);
  font-size: clamp(64px, 14vw, 128px); line-height: 1;
  color: var(--ember);
  text-shadow: 0 0 48px rgba(255,106,44,.35);
  margin: var(--s1) 0;
}
.moment-sub { color: var(--ash); margin-bottom: var(--s3); }
.moment-ctas { justify-content: center; margin-bottom: var(--s2); }
.ask-mac { color: var(--ash); margin-top: var(--s6); font-size: 15px; }
.ask-mac a { color: var(--ink); }

/* ── footer: minimal and truthful (D13) ────────────────────────────────── */
.foot {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  max-width: var(--wide); margin: 0 auto;
  padding: var(--s6) var(--s3) var(--s8);
  border-top: 1px solid rgba(243,234,223,.06);
  color: var(--ash); font-size: 14px;
}
.foot-mark { font-family: var(--font-display); font-size: 20px; color: var(--ink); }
.foot-nav { display: flex; gap: var(--s3); flex: 1; flex-wrap: wrap; }
.foot-nav a { color: var(--ash); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.foot-nav a:hover { color: var(--ink); }

/* ── embers: ≤12 mobile / ≤24 desktop, 2-3px, slow rise, ≤.5 opacity ───── */
.embers { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ember {
  position: absolute; bottom: -4px;
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--hot-core);
  opacity: 0;
  animation: rise linear infinite;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  8%   { opacity: .45; }
  60%  { opacity: .3; }
  100% { transform: translateY(-92vh) translateX(var(--drift, 24px)); opacity: 0; }
}
.embers.paused .ember { animation-play-state: paused; }

/* ── viewport intent (D12) ─────────────────────────────────────────────── */
/* touch devices: waitlist is the sole hero action, Mac demotes to a line */
@media (pointer: coarse), (max-width: 640px) {
  #cta-desktop { display: none; }
  .hero-form { display: block; max-width: 460px; }
  .also-mac { color: var(--ash); font-size: 14px; margin-top: var(--s2); }
}
@media (max-width: 640px) {
  /* Footer: stack cleanly — never wrap a link mid-phrase into a word column */
  .foot { flex-direction: column; align-items: flex-start; gap: var(--s2); }
  .foot-nav { flex-direction: column; gap: 0; width: 100%; }
  .foot-nav a { white-space: nowrap; }
}
@media (max-width: 900px) {
  .row, .row-flip { grid-template-columns: 1fr; gap: var(--s3); padding: var(--s8) var(--s3); }
  /* clip frame ABOVE headline on mobile: image hooks, text explains */
  /* 21:9 on mobile too — the clips ARE 21:9, so cover neither slices nor
     letterboxes them on ANY device. A 16/10 frame here cropped ~32% off the
     sides and sliced Boldin's speech bubble mid-sentence (QA, 2026-07-15). */
  .frame { order: -1; }
  .row-flip .frame { order: -1; }
  .row-flip .row-text { order: 0; }
  .num { position: relative; top: 0; }
  .row-text h2 { font-size: clamp(30px, 7.5vw, 40px); }
  .hero { min-height: 88svh; }
  .strip { height: 64px; }
  .strip-inner { white-space: normal; line-height: 1.2; text-align: center; font-size: 17px; }
}
@media (min-width: 1400px) {
  .hero-inner { padding-bottom: var(--s12); }
}

/* ── restraint switches ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-video { display: none; }        /* poster IS the hero */
  .embers { display: none; }
  .btn, .hero-video { transition: none; }
}
