/* box/car · shared stylesheet for the spine and all generated pages.
   Tokens are inherited from the original design system (styles.css).
   Two-worlds rule: dark slate = the world where reasoning gets lost;
   paper insets = the governed artifacts that survive. Layer A claims
   live on dark; Layer B/C proof lives on paper. */

:root {
  --slate:        #1A1F26;
  --slate-2:      #131820;
  --slate-3:      #20262F;
  --slate-line:   rgba(229,224,210,0.10);
  --slate-line-2: rgba(229,224,210,0.18);

  --bone:         #E5E0D2;
  --bone-2:       #F2EDDD;
  --bone-soft:    #A8A292;
  --bone-muted:   #807968;

  --paper:        #FBF7EF;
  --paper-2:      #F4EDDF;
  --card:         #FFFFFF;

  --ink:          #1A2336;
  --ink-2:        #2E3A52;
  --ink-soft:     #4F5A72;
  --muted:        #6B7488;
  --line:         rgba(26, 35, 54, 0.10);

  --brass:        #E8B768;
  --brass-deep:   #C9A055;
  --teal:         #146A5E;
  --teal-glow:    #34B5A0;
  --coral:        #D9745A;
  --plum:         #6E5B97;
  --plum-glow:    #C8BBE0;
  --amber:        #D69845;
  --red:          #C84B4B;

  --night:        #0F1422;
  --night-2:      #161D2F;
  --night-line:   rgba(255,255,255,0.08);

  --radius-lg:    22px;
  --radius-md:    14px;
  --radius-sm:    10px;
  --shadow-paper: 0 40px 100px -20px rgba(0,0,0,0.5), 0 0 0 1px rgba(232,183,104,0.15), inset 0 1px 0 rgba(255,255,255,0.4);
  --shadow-md:    0 1px 0 rgba(0,0,0,0.08), 0 18px 40px -18px rgba(0,0,0,0.50);

  --display: "Fraunces", ui-serif, Georgia, serif;
  --sans: "Manrope", ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Door accent, overridden per page via body[data-accent] */
  --accent: var(--brass);
  --accent-glow: var(--brass);
}
body[data-accent="teal"]  { --accent: var(--teal);  --accent-glow: var(--teal-glow); }
body[data-accent="plum"]  { --accent: var(--plum);  --accent-glow: var(--plum-glow); }
body[data-accent="coral"] { --accent: var(--coral); --accent-glow: #F0A48D; }
body[data-accent="amber"] { --accent: var(--amber); --accent-glow: #F2C078; }
body[data-accent="brass"] { --accent: var(--brass); --accent-glow: #F5D9A6; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--slate);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 80% 50% at 70% 0%, rgba(232,183,104,0.06), transparent 60%),
    radial-gradient(ellipse 60% 40% at 0% 30%, rgba(20,106,94,0.04), transparent 60%);
}
a { color: inherit; text-decoration: none; }
p { margin: 0; }
img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent-glow); outline-offset: 2px; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  padding: 14px clamp(18px, 4vw, 44px);
  background: rgba(19, 24, 32, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-line);
}
.brand {
  font-family: var(--mono); font-weight: 600; font-size: 17px;
  letter-spacing: 0.02em; color: var(--bone-2);
}
.brand span { color: var(--accent-glow); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; font-size: 14.5px; }
.nav > a, .nav summary {
  padding: 7px 12px; border-radius: 8px; color: var(--bone-soft);
  cursor: pointer; list-style: none; white-space: nowrap;
}
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: " ▾"; font-size: 11px; color: var(--bone-muted); }
.nav > a:hover, .nav summary:hover { color: var(--bone-2); background: var(--slate-3); }
.nav > a[aria-current="page"] { color: var(--accent-glow); }
.nav-doors { position: relative; }
.nav-doors-panel {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 200px;
  background: var(--paper); color: var(--ink); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 8px; z-index: 50;
}
.nav-doors-panel a {
  display: block; padding: 9px 12px; border-radius: 8px; font-weight: 600;
}
.nav-doors-panel a:hover { background: var(--paper-2); }
.nav-doors-panel a small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.topbar .btn { margin-left: 8px; }
.topbar-toggle { display: none; }

@media (max-width: 900px) {
  .nav { display: none; }
  .topbar-toggle {
    display: inline-flex; margin-left: auto; background: none; border: 1px solid var(--slate-line-2);
    color: var(--bone); border-radius: 8px; padding: 8px 10px; cursor: pointer;
  }
  .topbar .btn { display: none; }
  .drawer[hidden] { display: none; }
  .drawer {
    position: fixed; inset: 0; z-index: 60; background: rgba(19,24,32,0.97);
    padding: 70px 28px 28px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
  }
  .drawer a { padding: 12px 8px; font-size: 18px; border-bottom: 1px solid var(--slate-line); }
  .drawer .drawer-group { margin-top: 14px; font-family: var(--mono); font-size: 11px;
    letter-spacing: 0.18em; text-transform: uppercase; color: var(--bone-muted); }
  .drawer-close { position: absolute; top: 16px; right: 16px; background: none; border: 1px solid var(--slate-line-2);
    color: var(--bone); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 15px; }
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--paper); box-shadow: 0 8px 24px -10px var(--accent); }
body[data-accent="brass"] .btn-primary, body[data-accent="amber"] .btn-primary { color: var(--ink); }
.btn-secondary { background: transparent; color: var(--bone-2); border-color: var(--slate-line-2); }
.btn-secondary:hover { border-color: var(--bone-soft); }
.on-paper .btn-secondary { color: var(--ink-2); border-color: var(--line); }

/* ── Hero ───────────────────────────────────────────────── */
.hero { padding: clamp(56px, 9vw, 120px) clamp(18px, 5vw, 60px) clamp(44px, 6vw, 80px); max-width: 1100px; margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-glow); margin-bottom: 22px;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-glow); box-shadow: 0 0 0 0 var(--accent-glow); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(0,0,0,0); } }
h1 {
  font-family: var(--display); font-weight: 560; font-size: clamp(34px, 5.4vw, 62px);
  line-height: 1.06; letter-spacing: -0.015em; color: var(--bone-2); margin: 0 0 26px; max-width: 18ch;
}
h1 em, h2 em, h3 em { font-style: italic; color: var(--accent-glow); }
.lead { max-width: 62ch; display: grid; gap: 16px; color: var(--bone-soft); font-size: clamp(16px, 1.6vw, 18.5px); }
.lead p:first-child { color: var(--bone); }
.proof-line {
  margin: 30px 0 0; padding: 16px 20px; max-width: 640px;
  background: linear-gradient(135deg, var(--paper), var(--paper-2));
  color: var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-paper);
  font-size: 15.5px; font-weight: 600; line-height: 1.5;
}
.proof-line::before {
  content: "Proof"; display: block; font-family: var(--mono); font-weight: 500;
  font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* ── Sections ───────────────────────────────────────────── */
.section { max-width: 1100px; margin: 0 auto; padding: clamp(36px, 6vw, 72px) clamp(18px, 5vw, 60px); }
.kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-glow); margin-bottom: 14px;
}
h2 {
  font-family: var(--display); font-weight: 560; font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.12; letter-spacing: -0.01em; color: var(--bone-2); margin: 0 0 18px; max-width: 24ch;
}
.section .paras { max-width: 62ch; display: grid; gap: 14px; color: var(--bone-soft); }

/* Paper artifact: Layer B/C proof surfaces */
.artifact {
  background: linear-gradient(160deg, var(--paper), var(--paper-2));
  color: var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-paper);
  padding: clamp(24px, 4vw, 44px);
}
.artifact .kicker { color: var(--accent); }
.artifact h2, .artifact h3 { color: var(--ink); }
.artifact h2 em, .artifact h3 em { color: var(--accent); }
.artifact .paras { color: var(--ink-soft); }

/* Objection card */
.objection { margin-top: 8px; }
.objection .obj-q {
  font-family: var(--display); font-style: italic; font-size: clamp(19px, 2.4vw, 24px);
  color: var(--ink); margin-bottom: 12px;
}
.objection .obj-q::before { content: "“"; color: var(--accent); }
.objection .obj-q::after { content: "”"; color: var(--accent); }
.objection .obj-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.objection .obj-a { color: var(--ink-soft); max-width: 62ch; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 22px; }
.stat { background: var(--card); border-radius: var(--radius-md); padding: 20px 22px; box-shadow: var(--shadow-md); border-top: 3px solid var(--accent); }
.stat .val { font-family: var(--display); font-size: 28px; font-weight: 600; color: var(--ink); }
.stat .lbl { font-size: 14px; color: var(--ink-soft); margin-top: 6px; line-height: 1.5; }

/* Steps */
.steps { display: grid; gap: 14px; margin-top: 24px; counter-reset: none; }
.step { display: grid; grid-template-columns: 14px 1fr; gap: 16px; align-items: start; }
.step::before { content: ""; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.step h3 { font-family: var(--sans); font-weight: 800; font-size: 16.5px; color: var(--ink); margin: 0 0 4px; }
.step p { color: var(--ink-soft); max-width: 62ch; }

/* CTA band */
.cta-band { text-align: left; }
.cta-band .hero-actions { margin-top: 22px; }

/* Video slot */
.video-slot {
  border: 1.5px dashed var(--slate-line-2); border-radius: var(--radius-lg);
  padding: clamp(36px, 6vw, 64px); text-align: center; color: var(--bone-muted);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em;
}
.video-slot .play {
  width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--slate-line-2);
  display: inline-grid; place-items: center; margin-bottom: 14px; color: var(--bone-soft); font-size: 18px;
}

/* Quote slot: renders only when filled */
.quote-slot blockquote {
  margin: 0; font-family: var(--display); font-style: italic;
  font-size: clamp(20px, 2.6vw, 26px); color: var(--ink); line-height: 1.35;
}
.quote-slot cite { display: block; margin-top: 14px; font-family: var(--mono); font-style: normal; font-size: 13px; color: var(--muted); }

/* ── Spine-specific ─────────────────────────────────────── */
.decision-stream { display: grid; gap: 10px; margin-top: 34px; max-width: 640px; }
.decision-stream .ds-label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--bone-muted); }
.ds-card {
  display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center;
  background: var(--night-2); border: 1px solid var(--night-line); border-radius: var(--radius-md);
  padding: 13px 16px; font-family: var(--mono); font-size: 13px;
}
.ds-card .verdict { font-weight: 600; letter-spacing: 0.06em; }
.ds-card.exec .verdict { color: var(--teal-glow); }
.ds-card.held .verdict { color: var(--amber); }
.ds-card.block .verdict { color: #FF8585; }
.ds-card .what { color: var(--bone-soft); }
.ds-card .why { display: block; color: var(--bone-muted); font-size: 12px; margin-top: 3px; }

.trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
.trio .cell { background: var(--slate-3); border: 1px solid var(--slate-line); border-radius: var(--radius-md); padding: 22px; }
.trio .cell strong { display: block; font-family: var(--display); font-size: 19px; color: var(--bone-2); margin-bottom: 8px; }
.trio .cell p { color: var(--bone-soft); font-size: 15px; }

.contrast { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 22px; }
.contrast .col { border-radius: var(--radius-md); padding: 22px; }
.contrast .col h3 { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 14px; }
.contrast .default { background: var(--night-2); border: 1px solid var(--night-line); }
.contrast .default h3 { color: #FF8585; }
.contrast .boxcar { background: linear-gradient(160deg, var(--paper), var(--paper-2)); color: var(--ink); box-shadow: var(--shadow-paper); }
.contrast .boxcar h3 { color: var(--teal); }
.contrast ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14.5px; }
.contrast .default li { color: var(--bone-soft); }
.contrast .boxcar li { color: var(--ink-soft); }
.contrast li strong { color: inherit; }

.layers { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 22px; }
.layer { background: var(--card); border-radius: var(--radius-md); padding: 22px; box-shadow: var(--shadow-md); }
.layer .kicker { margin-bottom: 8px; }
.layer h3 { font-family: var(--display); font-size: 20px; color: var(--ink); margin: 0 0 8px; }
.layer p { color: var(--ink-soft); font-size: 14.5px; }

details.disclosure {
  margin-top: 20px; background: var(--card); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
}
details.disclosure summary {
  cursor: pointer; padding: 16px 20px; font-weight: 700; color: var(--ink); list-style: none;
}
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure summary::after { content: "＋"; float: right; color: var(--accent); }
details.disclosure[open] summary::after { content: "－"; }
details.disclosure .disclosure-body { padding: 0 20px 20px; color: var(--ink-soft); font-size: 14.5px; }

.doors-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-top: 22px; }
.door-card {
  display: block; background: var(--slate-3); border: 1px solid var(--slate-line);
  border-radius: var(--radius-md); padding: 20px 22px; transition: border-color .15s ease, transform .15s ease;
}
.door-card:hover { border-color: var(--brass); transform: translateY(-2px); }
.door-card .kicker { margin-bottom: 6px; font-size: 11px; }
.door-card strong { display: block; font-family: var(--display); font-size: 17.5px; line-height: 1.3; color: var(--bone-2); }
.door-card span { display: block; margin-top: 8px; font-size: 13.5px; color: var(--bone-muted); }

/* Form */
.form-grid { display: grid; gap: 14px; margin-top: 24px; max-width: 560px; }
.form-grid label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.form-grid input, .form-grid textarea {
  font: inherit; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--card); color: var(--ink); width: 100%;
}
.form-grid textarea { min-height: 130px; resize: vertical; }
.hp { position: absolute; left: -9999px; height: 1px; width: 1px; overflow: hidden; }
.form-note { font-size: 13px; color: var(--muted); }
.form-status { font-size: 14.5px; font-weight: 700; margin-top: 6px; }
.form-status.ok { color: var(--teal); }
.form-status.err { color: var(--red); }

/* ── Readiness ──────────────────────────────────────────── */
.rq { margin-top: 18px; }
.rq .rq-q { font-weight: 800; color: var(--ink); margin-bottom: 12px; font-size: 16.5px; }
.rq .rq-opts { display: grid; gap: 8px; }
.rq button {
  text-align: left; font: inherit; font-size: 14.5px; padding: 12px 14px; cursor: pointer;
  background: var(--card); color: var(--ink-soft); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
}
.rq button:hover { border-color: var(--accent); }
.rq button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); color: var(--ink); font-weight: 700; }

/* Embedded on the spine: questions left, live result card right */
.readiness-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 30px; align-items: start; margin-top: 8px; }
.readiness-qs .rq:first-child { margin-top: 4px; }
.result-card {
  position: sticky; top: 84px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-md);
  padding: 20px 22px;
}
.result-card .r-level { font-family: var(--display); font-size: 24px; color: var(--ink); margin-top: 2px; }
.result-bar { display: flex; gap: 6px; margin: 12px 0; }
.result-bar .seg { flex: 1; height: 6px; border-radius: 999px; background: var(--line); transition: background .25s ease; }
.result-bar .seg.lit { background: var(--accent); }
.result-card .r-blurb { color: var(--ink-soft); font-size: 14.5px; margin: 0; }
.dim-list { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line); }
.dim-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; color: var(--ink-2); padding: 5px 0; }
.dim-list li span:last-child { font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; white-space: nowrap; }
.dim-list li.gap span:last-child { color: var(--red); font-weight: 600; }
.dim-list li.ok span:last-child { color: var(--teal); }
.result-card .r-door { margin-top: 12px; font-size: 14px; }
.result-card .r-door a { color: var(--accent); font-weight: 700; text-decoration: underline; }
.result-card .r-door:empty { display: none; }
.result-actions { margin-top: 16px; }
@media (max-width: 900px) {
  .readiness-grid { grid-template-columns: 1fr; }
  .result-card { position: static; }
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  margin-top: clamp(40px, 7vw, 90px); border-top: 1px solid var(--slate-line);
  padding: 36px clamp(18px, 5vw, 60px) 46px; max-width: 1100px; margin-left: auto; margin-right: auto;
}
.footer .brand { font-size: 15px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 14px; font-size: 13.5px; }
.footer-nav a { color: var(--bone-muted); }
.footer-nav a:hover { color: var(--bone-2); }
.footer .credit { font-size: 12.5px; color: var(--bone-muted); }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
