:root {
  color-scheme: dark;
  --canvas: #0b0d10;
  --surface: #12161b;
  --surface-raised: #181d23;
  --line: #343b44;
  --line-strong: #5e6874;
  --text: #f4f1e8;
  --muted: #b9c0c7;
  --gold: #e0b85b;
  --gold-soft: #2c2618;
  --safe: #7bc99b;
  --warning: #e4bd66;
  --danger: #e58e82;
  --info: #8eb6dd;
  --max-width: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid #fff1b8;
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: .7rem 1rem;
  background: var(--gold);
  color: #17130b;
  font-weight: 800;
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
}

.hero {
  border-bottom: 1px solid var(--line);
  background: #0e1115;
  padding: clamp(4rem, 9vw, 7.5rem) 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: end;
}

.eyebrow, .label, .card-step {
  margin: 0 0 .65rem;
  color: var(--gold);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, h3, h4, p { margin-top: 0; }

h1 {
  max-width: 880px;
  margin-bottom: 1.25rem;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: .98;
  letter-spacing: -.055em;
}

h2 {
  margin-bottom: .8rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

h3 { line-height: 1.2; }

.hero-copy, .section-heading > p:last-child {
  max-width: 780px;
  color: var(--muted);
  font-size: 1.08rem;
}

.truth-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 2rem;
}

.truth-strip span, .token-list li {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .35rem .7rem;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.hero-proof {
  border-top: 4px solid var(--gold);
  background: var(--surface);
  padding: 1.4rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
}

.hero-proof > code {
  display: block;
  margin-bottom: 1rem;
  color: var(--text);
  font-size: .8rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

dl { margin: 0; }

dl div {
  display: grid;
  grid-template-columns: minmax(7rem, .7fr) minmax(0, 1.3fr);
  gap: 1rem;
  padding: .55rem 0;
  border-top: 1px solid var(--line);
}

dt { color: var(--muted); font-size: .82rem; }
dd { min-width: 0; margin: 0; font-weight: 700; }

.section { padding: clamp(4rem, 8vw, 7rem) 0; }

.section-heading { margin-bottom: 2.5rem; }
.section-heading.compact { max-width: 860px; }

.pipeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 1px;
  list-style: none;
  background: var(--line);
}

.pipeline li {
  min-height: 165px;
  padding: 1rem;
  background: var(--surface);
}

.pipeline strong, .pipeline small { display: block; }
.pipeline strong { margin-top: 1.4rem; font-size: .95rem; line-height: 1.25; }
.pipeline small { margin-top: .45rem; color: var(--muted); line-height: 1.35; }
.stage-index { color: var(--muted); font: 700 .72rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.pipeline .authority-stage { position: relative; background: var(--gold-soft); box-shadow: inset 0 0 0 2px var(--gold); }
.pipeline .authority-stage strong { color: #f4d98f; }
.pipeline .no-effect-stage { border-bottom: 4px solid var(--danger); }

.evaluator { border-block: 1px solid var(--line); background: #0e1115; }

.scenario-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .5rem;
  margin-bottom: 1rem;
}

.scenario-tab {
  min-height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: 800 .78rem/1 inherit;
  letter-spacing: .06em;
}

.scenario-tab::before, .disposition-symbol::before {
  display: inline-grid;
  width: 1.35em;
  height: 1.35em;
  place-items: center;
  margin-right: .45rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 900;
}

[data-symbol="check"] .disposition-symbol::before, .scenario-tab[data-symbol="check"]::before { content: "✓"; }
[data-symbol="pause"] .disposition-symbol::before, .scenario-tab[data-symbol="pause"]::before { content: "Ⅱ"; }
[data-symbol="stop"] .disposition-symbol::before, .scenario-tab[data-symbol="stop"]::before { content: "×"; }
[data-symbol="repair"] .disposition-symbol::before, .scenario-tab[data-symbol="repair"]::before { content: "↻"; }
[data-symbol="withdraw"] .disposition-symbol::before, .scenario-tab[data-symbol="withdraw"]::before { content: "—"; }
[data-symbol="escalate"] .disposition-symbol::before, .scenario-tab[data-symbol="escalate"]::before { content: "↑"; }
[data-symbol="unknown"] .disposition-symbol::before, .scenario-tab[data-symbol="unknown"]::before { content: "?"; }

.scenario-tab:hover { border-color: var(--gold); }
.scenario-tab[aria-pressed="true"] { border-color: var(--gold); background: var(--gold); color: #17130b; }

.result-panel { border: 1px solid var(--line-strong); background: var(--surface); }

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.result-header h3 { margin-bottom: .35rem; font-size: clamp(1.65rem, 3vw, 2.35rem); }
.cause { margin: 0; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .83rem; }
.authority-state { min-width: 190px; border-left: 3px solid var(--gold); padding-left: 1rem; }
.authority-state span, .authority-state strong { display: block; }
.authority-state strong { font-size: 1.35rem; text-transform: uppercase; }

.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-card { min-width: 0; padding: 1.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-card:nth-child(2n) { border-right: 0; }
.result-card h4 { margin-bottom: 1rem; font-size: 1.2rem; }
.authority-card { background: var(--gold-soft); box-shadow: inset 4px 0 0 var(--gold); }

.token-list { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.token-list li { padding: .16rem .5rem; color: var(--text); font-size: .7rem; }
code, .digest { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.digest { display: block; color: #d9dee3; font-size: .78rem; overflow-wrap: anywhere; word-break: break-word; }

.no-effect-band {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  padding: 1rem 1.5rem;
  border-top: 3px solid var(--danger);
  background: #211716;
  color: #f2c1ba;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .83rem;
}

.noscript-note { border: 1px solid var(--warning); padding: 1rem; color: var(--muted); }

.evidence-explainer { border-bottom: 1px solid var(--line); }
.explanation-grid, .claims-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.explanation-grid article, .claim-card { border-top: 3px solid var(--line-strong); background: var(--surface); padding: 1.4rem; }
.explanation-grid p, .claim-card li { color: var(--muted); }

.claims { background: #0e1115; }
.claims-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.claim-card.proves { border-color: var(--safe); }
.claim-card.limits { border-color: var(--danger); }
.claim-card ul { margin-bottom: 0; padding-left: 1.25rem; }
.claim-card li + li { margin-top: .5rem; }

.integration-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; padding: 1px; background: var(--line); list-style: none; }
.integration-grid li { min-height: 170px; padding: 1.25rem; background: var(--surface); }
.integration-grid strong, .integration-grid span { display: block; }
.integration-grid span { margin-top: .7rem; color: var(--muted); font-size: .9rem; }

.cta { padding-block: 4rem; border-block: 1px solid #79642f; background: var(--gold-soft); }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.cta-inner h2 { margin-bottom: .35rem; }
.cta-inner p:last-child { margin-bottom: 0; color: var(--muted); }
.cta-contact { display: inline-flex; min-height: 50px; align-items: center; margin: 0; border: 1px solid var(--gold); padding: .65rem 1rem; color: #f4d98f; font-weight: 800; }

.footer { padding: 1.5rem 0; color: var(--muted); font-size: .78rem; }
.footer .shell { display: flex; justify-content: space-between; gap: 1rem; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-proof { max-width: 640px; }
  .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .scenario-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .shell { width: min(calc(100% - 1.25rem), var(--max-width)); }
  .hero { padding-top: 3.5rem; }
  h1 { font-size: clamp(2.45rem, 14vw, 4.2rem); }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline li { min-height: auto; }
  .scenario-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-header, .cta-inner { align-items: flex-start; flex-direction: column; }
  .result-grid, .claims-grid, .explanation-grid, .integration-grid { grid-template-columns: 1fr; }
  .result-card { border-right: 0; }
  dl div { grid-template-columns: 1fr; gap: .15rem; }
  .digest { white-space: normal; overflow-wrap: anywhere; }
  .footer .shell { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
