:root {
  color-scheme: light;
  --paper: #f7f5f0;
  --graphite: #1c1e21;
  --blueprint: #1e5b8a;
  --live: #c2410c;
  --rule: #c8c4ba;
  --warn: #92400e;
  --panel: #fffdf8;
  --panel-strong: #ffffff;
  --ink-muted: #5a5750;
  --edge: #ded9ce;
  --grid: #dedad0;
  --focus: #1e5b8a;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", "Cascadia Mono", "Liberation Mono", Menlo, Consolas, monospace;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --display: clamp(2rem, 4.3vw, 3.65rem);
  --headline: clamp(1.55rem, 3vw, 2.65rem);
  --body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --caption: 0.75rem;
  --space-1: 0.375rem;
  --space-2: 0.75rem;
  --space-3: 1.25rem;
  --space-4: 2rem;
  --space-5: clamp(3.75rem, 8vw, 7.5rem);
  --radius-sm: 2px;
  --radius-md: 4px;
  --shadow-sheet: 0 10px 30px rgb(28 30 33 / 0.08);
  --page-pad: clamp(1rem, 4vw, 3.5rem);
  --content: 1240px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #14161a;
    --graphite: #e8e6e1;
    --blueprint: #5ea3d8;
    --live: #f97316;
    --rule: #4b5159;
    --warn: #d9a441;
    --panel: #1a1d22;
    --panel-strong: #20242a;
    --ink-muted: #a9adb4;
    --edge: #343940;
    --grid: #292e35;
    --focus: #78b7e5;
    --shadow-sheet: 0 12px 36px rgb(0 0 0 / 0.28);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --paper: #f7f5f0;
  --graphite: #1c1e21;
  --blueprint: #1e5b8a;
  --live: #c2410c;
  --rule: #c8c4ba;
  --warn: #92400e;
  --panel: #fffdf8;
  --panel-strong: #ffffff;
  --ink-muted: #5a5750;
  --edge: #ded9ce;
  --grid: #dedad0;
  --focus: #1e5b8a;
  --shadow-sheet: 0 10px 30px rgb(28 30 33 / 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #14161a;
  --graphite: #e8e6e1;
  --blueprint: #5ea3d8;
  --live: #f97316;
  --rule: #4b5159;
  --warn: #d9a441;
  --panel: #1a1d22;
  --panel-strong: #20242a;
  --ink-muted: #a9adb4;
  --edge: #343940;
  --grid: #292e35;
  --focus: #78b7e5;
  --shadow-sheet: 0 12px 36px rgb(0 0 0 / 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--graphite);
  font-family: var(--serif);
  font-size: var(--body);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button {
  color: inherit;
}

a {
  color: var(--blueprint);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  inset: 0 auto auto 0;
  padding: 0.7rem 1rem;
  translate: 0 -120%;
  background: var(--graphite);
  color: var(--paper);
  font-family: var(--mono);
  font-size: var(--caption);
}

.skip-link:focus {
  translate: 0;
}

.site-header {
  width: min(100%, calc(var(--content) + (2 * var(--page-pad))));
  min-height: 4.25rem;
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.wordmark {
  color: var(--graphite);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: none;
}

.header-status {
  padding-left: 1rem;
  border-left: 1px solid var(--rule);
  color: var(--ink-muted);
}

.site-nav {
  justify-self: end;
  display: flex;
  gap: clamp(0.85rem, 2.5vw, 2rem);
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--blueprint);
}

.theme-toggle {
  min-height: 2.1rem;
  padding: 0.3rem 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  justify-self: end;
}

.theme-toggle:hover {
  border-color: var(--blueprint);
  color: var(--blueprint);
}

.section-shell {
  width: min(100%, calc(var(--content) + (2 * var(--page-pad))));
  margin: 0 auto;
  padding-inline: var(--page-pad);
}

.hero {
  padding-top: clamp(2.1rem, 4vw, 3.5rem);
  padding-bottom: var(--space-5);
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(18rem, 0.9fr);
  align-items: end;
  gap: clamp(1.5rem, 5vw, 5rem);
  margin-bottom: clamp(1.35rem, 2.5vw, 2rem);
}

.hero-copy .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: -0.6rem;
}

.eyebrow,
.status-label,
.bench-kicker {
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: var(--caption);
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  font-family: var(--mono);
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  max-width: 21ch;
  margin-bottom: 0;
  font-size: var(--display);
  font-weight: 620;
  letter-spacing: -0.06em;
  text-wrap: wrap;
}

.hero-lead {
  max-width: 34ch;
  margin-bottom: 0.15rem;
  color: var(--ink-muted);
  font-size: 1.08em;
}

.proof-bench {
  border: 1px solid var(--graphite);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-sheet);
}

.case-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--graphite);
}

.case-tab {
  min-height: 3.5rem;
  padding: 0.7rem 0.9rem;
  border: 0;
  border-right: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.73rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.case-tab:last-child {
  border-right: 0;
}

.case-tab:hover {
  color: var(--blueprint);
}

.case-tab[aria-pressed="true"] {
  background: var(--graphite);
  color: var(--paper);
}

.case-tab small {
  display: block;
  margin-top: 0.25rem;
  color: inherit;
  font-size: 0.61rem;
  letter-spacing: 0.08em;
  opacity: 0.76;
  text-transform: uppercase;
}

.bench-toolbar {
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--edge);
}

.bench-kicker {
  margin-bottom: 0.25rem;
}

.bench-title {
  margin-bottom: 0;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.scenario-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.scenario-button,
.blueprint-button,
.text-action {
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  cursor: pointer;
}

.scenario-button {
  min-height: 2.15rem;
  padding: 0.38rem 0.65rem;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.scenario-button:hover {
  border-color: var(--blueprint);
  color: var(--blueprint);
}

.scenario-button[aria-pressed="true"] {
  border-color: var(--graphite);
  background: var(--graphite);
  color: var(--paper);
}

.direct-instruction {
  margin: 0;
  padding: 0.55rem 1.1rem;
  border-bottom: 1px solid var(--edge);
  color: var(--blueprint);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 650;
}

.sheet-frame {
  background: var(--panel-strong);
}

.sheet-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--rule) transparent;
}

#schematic {
  display: block;
  width: 100%;
}

.inspector {
  min-height: 3.1rem;
  padding: 0.65rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 1rem;
  border-top: 1px solid var(--graphite);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.inspector-idle,
.inspector-key {
  color: var(--ink-muted);
}

.inspector-name {
  font-size: 0.82rem;
  font-weight: 700;
}

.inspector-key b {
  color: var(--graphite);
  font-weight: 500;
}

.state-badge {
  padding: 0.08rem 0.4rem;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  color: var(--blueprint);
}

.state-badge.is-position {
  border-style: dashed;
}

.state-badge.is-safety {
  color: var(--warn);
}

.inspector-action {
  margin-left: auto;
  color: var(--blueprint);
}

.bench-footer {
  padding: 0.8rem 1rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--edge);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.64rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.legend i {
  width: 1.3rem;
  display: inline-block;
  border-top: 2px solid;
}

.legend-live {
  border-color: var(--live);
}

.legend-dead {
  border-color: var(--graphite);
  opacity: 0.3;
}

.legend-action {
  border-color: var(--blueprint);
  border-top-style: dashed !important;
}

.model-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--edge);
  background: var(--edge);
}

.model-stat {
  min-width: 0;
  padding: 0.42rem 0.5rem;
  background: var(--panel);
  font-family: var(--mono);
}

.model-stat b,
.model-stat span {
  display: block;
}

.model-stat b {
  overflow: hidden;
  font-size: 0.82rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-stat span {
  margin-top: 0.2rem;
  color: var(--ink-muted);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.model-stat.is-rejected b {
  color: var(--warn);
}

.bench-message {
  margin: 0;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--warn);
  color: var(--warn);
  font-family: var(--mono);
  font-size: 0.72rem;
}

/* SVG drawing language */
.grid-line {
  stroke: var(--grid);
  stroke-width: 0.65;
}

.schematic-wire,
.schematic-bus,
.schematic-glyph {
  fill: none;
  stroke: var(--graphite);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.schematic-wire {
  stroke-width: 1.55;
}

.schematic-bus {
  stroke-width: 5;
}

.schematic-glyph {
  stroke-width: 1.8;
}

.schematic-fill {
  fill: var(--panel-strong);
}

.schematic-label {
  fill: var(--graphite);
  font-family: var(--mono);
  font-size: 9.5px;
}

.schematic-label.is-dim {
  fill: var(--ink-muted);
  font-size: 8.25px;
}

.schematic-switch-label {
  fill: var(--blueprint);
  font-family: var(--mono);
  font-size: 7.4px;
  font-weight: 650;
}

.schematic-component {
  cursor: default;
}

.schematic-component.is-switchable {
  cursor: pointer;
}

.schematic-hit {
  fill: transparent;
  stroke: transparent;
}

.schematic-component.is-switchable:hover .schematic-hit,
.schematic-component:focus-visible .schematic-hit {
  fill: none;
  stroke: var(--blueprint);
  stroke-width: 1.5;
  stroke-dasharray: 3 2;
}

.schematic-component.is-switchable:hover .schematic-glyph {
  stroke: var(--blueprint);
}

.is-deenergized {
  opacity: 0.3;
}

.is-traced .schematic-glyph,
.is-traced.schematic-wire,
.is-traced.schematic-bus {
  stroke: var(--live);
  stroke-width: 2.7;
}

.is-traced .schematic-label {
  fill: var(--live);
  font-weight: 700;
}

.junction-dot {
  fill: var(--graphite);
}

.section-heading {
  max-width: 760px;
}

.section-heading h2,
.open-section h2 {
  margin: 0.55rem 0 0.8rem;
  font-size: var(--headline);
  font-weight: 620;
  letter-spacing: -0.045em;
}

.section-heading > p:last-child,
.open-copy {
  color: var(--ink-muted);
}

.evidence-section,
.capability-section,
.formats-section,
.open-section {
  padding-block: var(--space-5);
  border-top: 1px solid var(--rule);
}

.field-quote {
  max-width: 920px;
  margin: clamp(2rem, 5vw, 4.5rem) 0;
  padding: 1.2rem 0 1.2rem clamp(1rem, 3vw, 2.5rem);
  border-left: 3px solid var(--graphite);
}

.field-quote p {
  margin-bottom: 0.8rem;
  font-family: var(--mono);
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.field-quote footer {
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: 0.9rem;
}

.topology-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 11rem minmax(0, 1fr);
  border-block: 1px solid var(--graphite);
}

.topology-side {
  padding: clamp(1.2rem, 3vw, 2rem) 0;
}

.topology-side:first-child {
  padding-right: clamp(1rem, 4vw, 3.5rem);
}

.topology-side:last-child {
  padding-left: clamp(1rem, 4vw, 3.5rem);
}

.topology-side h3 {
  margin: 0.55rem 0 0.8rem;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
}

.topology-side p:not(.status-label) {
  color: var(--ink-muted);
}

.comparison-axis {
  padding: 1.3rem 0.6rem;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  border-inline: 1px solid var(--rule);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.comparison-axis i {
  height: 100%;
  width: 1px;
  margin: 0 auto;
  background: var(--rule);
}

.status-implemented {
  color: var(--blueprint);
}

.status-rejected,
.capability-row-safety .status-label {
  color: var(--warn);
}

.status-planned {
  color: var(--ink-muted);
}

.text-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blueprint);
  font-size: 0.72rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.capability-ledger {
  margin-top: clamp(2rem, 5vw, 4rem);
  border-top: 1px solid var(--graphite);
}

.capability-row {
  min-height: 8.5rem;
  padding: 1.35rem 0;
  display: grid;
  grid-template-columns: minmax(10rem, 0.7fr) minmax(18rem, 1.7fr) minmax(12rem, auto);
  align-items: center;
  gap: clamp(1rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--rule);
}

.capability-row h3 {
  margin: 0.45rem 0 0;
  font-size: 1.25rem;
}

.capability-row > p {
  max-width: 58ch;
  margin-bottom: 0;
  color: var(--ink-muted);
}

.blueprint-button {
  min-height: 2.65rem;
  padding: 0.58rem 0.85rem;
  border: 1px solid var(--blueprint);
  background: transparent;
  color: var(--blueprint);
  font-size: 0.7rem;
  font-weight: 650;
}

.blueprint-button:hover,
.blueprint-button[aria-pressed="true"] {
  background: var(--blueprint);
  color: var(--paper);
}

.button-pair {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.query-output {
  min-height: 5.5rem;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.query-output p:last-child,
.query-output pre:last-child {
  margin-bottom: 0;
}

.query-output strong {
  color: var(--blueprint);
}

.query-output .safety-result {
  color: var(--warn);
}

.query-output pre {
  max-height: 19rem;
  overflow: auto;
  color: var(--ink-muted);
  font: inherit;
  line-height: 1.6;
  white-space: pre-wrap;
}

.format-columns {
  margin-top: clamp(2rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--graphite);
}

.format-group {
  padding: 1.5rem clamp(1rem, 3vw, 2rem);
  border-right: 1px solid var(--rule);
}

.format-group:first-child {
  padding-left: 0;
}

.format-group:last-child {
  padding-right: 0;
  border-right: 0;
}

.format-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.format-list li {
  padding: 0.75rem 0;
  border-top: 1px solid var(--edge);
}

.format-list span,
.format-list small {
  display: block;
}

.format-list span {
  font-family: var(--mono);
  font-size: 0.85rem;
}

.format-list small {
  margin-top: 0.25rem;
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: 0.8rem;
}

.open-section {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  gap: clamp(2rem, 8vw, 7rem);
  align-items: start;
}

.open-copy p {
  max-width: 50ch;
}

.open-links {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.site-footer {
  width: min(100%, calc(var(--content) + (2 * var(--page-pad))));
  margin: 0 auto;
  padding: 1.4rem var(--page-pad) 2.2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  border-top: 1px solid var(--graphite);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.site-footer span:first-child {
  color: var(--graphite);
  font-weight: 700;
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }

  .header-status {
    display: none;
  }

  .hero-copy {
    grid-template-columns: 1fr;
  }

  .hero-copy .eyebrow {
    grid-column: auto;
  }

  .hero-lead {
    max-width: 48ch;
  }

  .bench-footer {
    grid-template-columns: 1fr;
  }

  .capability-row {
    grid-template-columns: minmax(9rem, 0.7fr) minmax(0, 1.6fr);
  }

  .capability-row > button,
  .capability-row > .button-pair {
    grid-column: 2;
    justify-self: start;
  }

  .button-pair {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  :root {
    --page-pad: 1rem;
  }

  .site-header {
    min-height: 3.75rem;
  }

  .site-nav {
    display: none;
  }

  .hero {
    padding-top: 2.2rem;
  }

  h1 {
    max-width: 12ch;
    letter-spacing: -0.055em;
  }

  .case-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-tab:nth-child(2) {
    border-right: 0;
  }

  .case-tab:nth-child(-n + 2) {
    border-bottom: 1px solid var(--rule);
  }

  .bench-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .scenario-picker {
    width: 100%;
    justify-content: flex-start;
  }

  .sheet-scroll #schematic {
    width: auto;
    max-width: none;
  }

  .model-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topology-comparison {
    grid-template-columns: 1fr;
  }

  .topology-side:first-child,
  .topology-side:last-child {
    padding-inline: 0;
  }

  .comparison-axis {
    padding: 0.8rem 0;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    border-block: 1px solid var(--rule);
    border-inline: 0;
  }

  .comparison-axis i {
    width: 100%;
    height: 1px;
  }

  .capability-row {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .capability-row > button,
  .capability-row > .button-pair {
    grid-column: auto;
  }

  .format-columns {
    grid-template-columns: 1fr;
  }

  .format-group,
  .format-group:first-child,
  .format-group:last-child {
    padding: 1.3rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .format-group:last-child {
    border-bottom: 0;
  }

  .open-section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
  }

  .site-footer span:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
