/* ── Apex landing page · Voltage palette ─────────────────────────
   Canonical brand stylesheet. Tokens MUST match Coach UI and the
   card-page stylesheet. Terracotta (#9a3c14 light / #e8723c dark)
   is the single brand accent across every surface.
   ───────────────────────────────────────────────────────────────── */

@font-face{font-family:"Newsreader";font-style:normal;font-display:swap;font-weight:200 800;src:url("/fonts/newsreader-variable.woff2") format("woff2-variations");size-adjust:105.91%;ascent-override:86.6%;descent-override:20.7%;line-gap-override:0%}
@font-face{font-family:"Newsreader";font-style:italic;font-display:swap;font-weight:200 800;src:url("/fonts/newsreader-italic-variable.woff2") format("woff2-variations");size-adjust:105.91%;ascent-override:86.6%;descent-override:20.7%;line-gap-override:0%}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url("/fonts/ibm-plex-sans-variable.woff2") format("woff2");
  size-adjust: 100.5%;
  ascent-override: 90.1%;
  descent-override: 21.1%;
  line-gap-override: 3.3%;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/fonts/jetbrains-mono-variable.woff2") format("woff2");
  size-adjust: 97.66%;
  ascent-override: 94.9%;
  descent-override: 24.1%;
  line-gap-override: 0%;
}

:root {
  --bg:           #e8e3d6;
  --bg-2:         #ddd5c1;
  --ink:          #0a0a0c;
  --ink-dim:      rgba(10, 10, 12, 0.78);
  --ink-faint:    rgba(10, 10, 12, 0.85);   /* AAA-comfortable for phone reading */
  --rule:         rgba(10, 10, 12, 0.12);
  --rule-strong:  rgba(10, 10, 12, 0.30);
  --accent:       #9a3c14;
  --accent-soft:  rgba(154, 60, 20, 0.14);
  --accent-glow:  rgba(154, 60, 20, 0.32);
  --accent-on:    #e8e3d6;                  /* cream — AA contrast on darker terracotta #9a3c14 */
  --error:        #c8362a;
  --maxw:         1200px;
  --gutter:       clamp(20px, 5vw, 48px);

  /* ── Phase 2D-mobile: type scale ────────────────────────────────────
     Mobile-first. Bases sit at the small-phone size; min-width media
     queries below scale up. Numbers verified against the spec table —
     mobile is slightly LARGER than desktop for body prose because
     phones are read closer-to-face for shorter sustained reads, and
     EDH skews older. */
  --fs-h1:           36px;
  --fs-h2:           28px;
  --fs-h3:           22px;
  --fs-body-prose:   19px;
  --fs-body-ui:      17px;
  --fs-small:        15px;
  --fs-mono:         15px;
  --fs-mono-large:   28px;
  --fs-button:       17px;
  --lh-headline:     1.2;
  --lh-prose:        1.6;
  --lh-ui:           1.5;
  --lh-tight:        1.45;
  /* Touch targets — Apple HIG / Material baseline */
  --tap:             48px;
  --tap-secondary:   36px;
}

/* Desktop scales — slight bump to headlines, slight trim to body so
   line-length stays comfortable at wider columns. Tokens flow through
   to every surface that references them; no per-component overrides. */
@media (min-width: 760px) {
  :root {
    --fs-h1:         clamp(40px, 7vw, 64px);
    --fs-h2:         clamp(28px, 4vw, 40px);
    --fs-h3:         clamp(22px, 2.4vw, 28px);
    --fs-body-prose: 18px;
    --fs-body-ui:    16px;
    --fs-small:      14px;
    --fs-mono:       14px;
    --fs-mono-large: clamp(32px, 5vw, 48px);
    --fs-button:     16px;
  }
}

:root[data-theme="dark"] {
  --bg:           #0a0a0c;
  --bg-2:         #141416;
  --ink:          #e8e3d6;
  --ink-dim:      rgba(232, 227, 214, 0.78);
  --ink-faint:    rgba(232, 227, 214, 0.85);   /* AAA-comfortable for phone reading */
  --rule:         rgba(232, 227, 214, 0.10);
  --rule-strong:  rgba(232, 227, 214, 0.24);
  --accent:       #e8723c;
  --accent-soft:  rgba(232, 114, 60, 0.18);
  --accent-glow:  rgba(232, 114, 60, 0.40);
  --accent-on:    #0a0a0c;
  --error:        #e07060;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  transition: background 200ms ease;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font-size: var(--fs-body-ui);
  line-height: var(--lh-ui);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 200ms ease, color 200ms ease;
}

main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* Canonical container shell. Use directly OR rely on the existing surface
   wrappers (main, .site-header, .card-page, .combo-page, .site-footer) —
   they all reference --maxw which is now 1200px corpus-wide. */
.page-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.prose-column {
  max-width: 680px;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-feature-settings: "tnum";
}

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

/* ── Site chrome lives ONLY in scripts/site-chrome.js (inlined via
   render-page.js). Do NOT redefine .site-header / .site-footer here. ── */

/* ── Hero ────────────────────────────────────────────────────────── */

.hero {
  padding: clamp(56px, 12vw, 112px) 0 clamp(40px, 9vw, 80px);
  text-align: left;
}

.hero h1 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 700;
  font-size: clamp(48px, 10vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
  color: var(--ink);
}

.hero h1 span { display: block; }

/* Terracotta accent on the conclusion line — the diagnostic punch */
.hero h1 span:last-child { color: var(--accent); }

.lede {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 2.6vw, 26px);
  color: var(--ink-dim);
  margin: 0 0 36px;
  max-width: 32ch;
  line-height: 1.4;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: var(--accent);
  color: var(--accent-on);
  border: none;
  padding: 16px 24px;
  text-decoration: none;
  transition: filter 120ms ease, transform 120ms ease;
}
.cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cta:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.hero-fineprint {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin: 22px 0 0;
}

/* ── Corpus strip (card thumbnails between hero and transcript) ──── */

.corpus-strip {
  padding: clamp(8px, 2vw, 16px) 0 clamp(40px, 7vw, 64px);
}
.cs-kicker {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 0 0 20px;
  text-align: center;
}
.cs-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: nowrap;
}
.cs-card {
  display: block;
  text-decoration: none;
  transition: transform 120ms ease;
}
.cs-card:hover { transform: translateY(-2px); }
.cs-card img {
  width: 80px;
  height: 112px;
  display: block;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(10, 10, 12, 0.18);
}
@media (max-width: 600px) {
  .cs-row {
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0 var(--gutter);
    margin: 0 calc(var(--gutter) * -1);
    scrollbar-width: none;
  }
  .cs-row::-webkit-scrollbar { display: none; }
  .cs-card img { width: 70px; height: 98px; }
}

/* ── Browse the corpus (two big CTAs below Coach hero) ────────────── */

.browse-corpus {
  padding: clamp(40px, 7vw, 64px) 0 clamp(24px, 4vw, 40px);
  border-top: 1px solid var(--rule-strong);
}
.bc-kicker {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 0 0 24px;
}
.bc-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 640px) {
  .bc-cards { grid-template-columns: 1fr 1fr; gap: 24px; }
}
.bc-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 28px;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  transition: background 160ms ease, transform 160ms ease;
}
.bc-card:hover { background: var(--accent); color: var(--accent-on); transform: translateY(-2px); }
.bc-card:hover .bc-number, .bc-card:hover .bc-arrow { color: var(--accent-on); }
.bc-number {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-feature-settings: "tnum";
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 600;
  color: var(--accent);
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.bc-label {
  font-family: "Newsreader", Georgia, serif;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 500;
}
.bc-arrow {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  color: var(--accent);
}

/* ── Sample transcript ───────────────────────────────────────────── */

.sample {
  padding: clamp(24px, 6vw, 56px) 0 clamp(40px, 8vw, 80px);
}

.sample-frame {
  background: var(--bg-2);
  border: 1px solid var(--ink);
  padding: clamp(24px, 4vw, 36px);
  position: relative;
}

.sample-frame::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 32px; height: 32px;
  border-top: 3px solid var(--accent);
  border-left: 3px solid var(--accent);
}

.sample-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 24px;
}

.sample-label .dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.transcript {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.msg { display: flex; flex-direction: column; gap: 8px; }

.msg .who {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.msg.user .who { color: var(--ink); }

.msg.user .body {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  color: var(--ink);
}

.msg.coach .body {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
}

.msg.coach .body p { margin: 0 0 14px; }
.msg.coach .body p:last-child { margin-bottom: 0; }

/* Card-name signature: terracotta highlight block (canonical signature) */
.card-name {
  position: relative;
  display: inline-block;
  font-weight: 500;
  color: var(--accent-on);
  text-decoration: none;
  padding: 0.05em 0.4em;
  margin: 0 0.05em;
  white-space: nowrap;
  z-index: 0;
}
.card-name::before {
  content: "";
  position: absolute;
  inset: 0.1em -0.05em 0.05em -0.05em;
  background: var(--accent);
  z-index: -1;
  transform: skewX(-6deg);
}

.sample-caption {
  margin: 22px 0 0;
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-dim);
}

/* ── Features ────────────────────────────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  padding: clamp(36px, 7vw, 64px) 0;
  border-top: 1px solid var(--rule-strong);
}

.feature h3 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: clamp(22px, 2.5vw, 26px);
  letter-spacing: -0.012em;
  margin: 0 0 10px;
  color: var(--ink);
}

.feature p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 16px;
  line-height: 1.6;
  max-width: 42ch;
}

@media (min-width: 720px) {
  .features { grid-template-columns: repeat(3, 1fr); gap: 36px; }
  .feature p { max-width: none; }
}

/* ── Email capture ───────────────────────────────────────────────── */

.email-capture {
  padding: clamp(44px, 8vw, 72px) 0 clamp(52px, 9vw, 80px);
  border-top: 1px solid var(--rule-strong);
}

.email-capture h2 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: clamp(24px, 3.5vw, 32px);
  line-height: 1.18;
  letter-spacing: -0.018em;
  margin: 0 0 10px;
  max-width: 28ch;
  color: var(--ink);
}

.email-sub {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin: 0 0 26px;
}

#email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
}

#email-form input {
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  background: var(--bg-2);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 14px 16px;
  width: 100%;
  transition: outline 120ms ease;
}

#email-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-color: var(--accent);
}

#email-form button {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: var(--accent);
  color: var(--accent-on);
  border: none;
  padding: 14px 26px;
  cursor: pointer;
  align-self: flex-start;
  transition: filter 120ms ease;
}

#email-form button:hover { filter: brightness(1.08); }

#email-form button:disabled {
  background: var(--rule-strong);
  color: var(--ink-faint);
  cursor: not-allowed;
}

@media (min-width: 540px) {
  #email-form { flex-direction: row; }
  #email-form input { flex: 1; }
  #email-form button { align-self: stretch; }
}

#email-status {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin: 16px 0 0;
  min-height: 16px;
}

#email-status.success { color: var(--accent); }
#email-status.error { color: var(--error); }

@media (max-width: 540px) {
  .hero h1 { letter-spacing: -0.025em; }

  /* Mobile mono-label readability on page content (not site chrome). */
  .mono,
  .bc-kicker,
  .cs-kicker,
  .hero-fineprint,
  .nav-cta {
    font-size: 12px;
    letter-spacing: 0.10em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sample-label .dot { animation: none; }
  .cta:hover { transform: none; }
}

/* ── Legal pages (/privacy, /terms) ──────────────────────────────── */

.legal {
  max-width: 680px;
  padding: clamp(48px, 8vw, 80px) 0 clamp(40px, 7vw, 64px);
}

.legal .kicker {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 0 0 12px;
}

.legal h1 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: clamp(40px, 6vw, 56px);
  line-height: 1.0;
  letter-spacing: -0.028em;
  margin: 0 0 22px;
  color: var(--ink);
}

.legal .lede {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.45;
  color: var(--ink-dim);
  margin: 0 0 40px;
  max-width: 50ch;
}

.legal h2 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: clamp(20px, 2.4vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 32px 0 14px;
  color: var(--ink);
}

.legal p {
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 16px;
  max-width: 64ch;
}

.legal p strong {
  color: var(--ink);
  font-weight: 600;
}

.legal a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.legal a:hover { filter: brightness(0.92); }

.legal .updated {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin: 40px 0 24px;
}

.legal .back-link {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 2px;
}
.legal .back-link:hover { color: var(--ink); }

/* ────────────────────────────────────────────────────────────────────
 * Phase 2D-mobile pass — appended; cascade wins.
 * Mobile-first prose readability + hamburger overlay + touch targets.
 * Token-driven so the same vars in templates/cards.css drive parity
 * across 1,203 card pages + 1,177 combo pages on re-render.
 * ──────────────────────────────────────────────────────────────────── */

/* Prose body type — surfaces that lean reading-heavy (Quick Take pull
   quote, Verdict, body paragraphs in /pro / /privacy / /terms) get the
   larger Newsreader scale; UI surfaces stay on Plex Sans body-ui size. */
.quick-take .pull,
.combo-verdict,
.where-it-shines .bucket-body p,
.key-combos .combo-body p,
.legal-page .prose p,
.faq details p { font-size: var(--fs-body-prose); line-height: var(--lh-prose); }

/* Headline cascade — only apply to actual headline elements; avoid
   leaking into div role="heading"-like patterns. */
h1 { font-size: var(--fs-h1); line-height: var(--lh-headline); letter-spacing: -.025em; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-headline); letter-spacing: -.022em; }
h3 { font-size: var(--fs-h3); line-height: var(--lh-tight); letter-spacing: -.012em; }

/* Touch targets — primary CTAs, nav CTA, theme toggle, hamburger.
   :where() keeps specificity at 0 so existing per-surface overrides win. */
:where(.cta, .nav-cta, .plan-cta, button.primary, .modal-primary, .bb-mini-btn.primary) {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-button);
}
