:root {
  --ink: #171714;
  --paper: #f2efe6;
  --paper-deep: #e5dfd1;
  --signal: #e3512f;
  --signal-dark: #a82e18;
  --acid: #c9ff4a;
  --mint: #8be0bc;
  --line: rgba(23, 23, 20, 0.2);
  --muted: #6d6a61;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(23, 23, 20, 0.035) 50%, transparent 50.2%),
    linear-gradient(rgba(23, 23, 20, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 32px;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.85'/%3E%3C/svg%3E");
}

a { color: inherit; }
button, input { font: inherit; }

.shell {
  width: min(1240px, calc(100% - 48px));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 76px;
  padding: 12px 3vw;
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--ink);
  background: rgba(242, 239, 230, 0.92);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  text-decoration: none;
  margin-right: auto;
  line-height: 1;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  aspect-ratio: 1;
  color: var(--paper);
  background: var(--ink);
  font-weight: 600;
  transform: rotate(-3deg);
}

.brand strong { display: block; font-size: 16px; }
.brand small { display: block; margin-top: 5px; font-size: 9px; letter-spacing: 0.19em; }

.topbar nav { display: flex; gap: 22px; }
.topbar nav a { text-decoration: none; font-size: 12px; text-transform: uppercase; }
.topbar nav a:hover { text-decoration: underline; text-underline-offset: 5px; }

.backend-pill {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  font-size: 10px;
  text-transform: uppercase;
}

.backend-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c99027;
  box-shadow: 0 0 0 3px rgba(201, 144, 39, 0.15);
}

.backend-pill.ready span { background: #158653; box-shadow: 0 0 0 3px rgba(21, 134, 83, 0.15); }
.backend-pill.failed span { background: var(--signal); box-shadow: 0 0 0 3px rgba(227, 81, 47, 0.14); }

.hero {
  min-height: 700px;
  padding-block: 92px 76px;
  display: grid;
  grid-template-columns: 1.03fr 0.97fr;
  gap: clamp(48px, 8vw, 120px);
  align-items: center;
}

.kicker, .section-index {
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 600;
}

.kicker::before, .section-index::before { content: "●"; color: var(--signal); margin-right: 10px; }

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

.hero h1 {
  margin: 25px 0 30px;
  font: 500 clamp(64px, 7.2vw, 112px)/0.82 var(--serif);
  letter-spacing: -0.055em;
}

.hero h1 em { color: var(--signal); font-weight: 400; }
.lede { max-width: 650px; font: 400 22px/1.45 var(--serif); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin: 36px 0 24px; }

.button {
  min-height: 46px;
  padding: 12px 17px;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.button:focus-visible, input:focus-visible { outline: 3px solid var(--acid); outline-offset: 3px; }
.button:disabled { cursor: wait; opacity: 0.5; }
.button.primary, .button.action { color: var(--paper); background: var(--ink); }
.button.danger { color: var(--paper); border-color: var(--signal); background: var(--signal); }
.button.fresh-button { background: var(--acid); }
.button.proof-button { background: var(--mint); }

.honesty { max-width: 620px; color: var(--muted); font-size: 10px; }
.honesty span { color: var(--signal); font-weight: 600; }

.hero-proof { border: 1px solid var(--ink); background: #eae5d9; box-shadow: 16px 16px 0 var(--ink); }
.case-label, .panel-label { display: flex; justify-content: space-between; padding: 10px 13px; border-bottom: 1px solid var(--ink); font-size: 9px; }
.decision { padding: 23px; }
.decision > div { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; }
.decision small { font-size: 10px; }
.decision strong { font: 600 36px/1 var(--serif); }
.decision strong i { font: 500 9px var(--mono); }
.decision p { margin: 18px 0; max-width: 350px; font-size: 12px; }
.decision.after { color: var(--paper); background: var(--signal); }
.stamp { display: inline-block; padding: 5px 8px; border: 1px solid currentColor; font-size: 9px; transform: rotate(-1deg); }
.memory-spine { display: grid; grid-template-columns: auto 1fr auto 1fr auto; gap: 10px; align-items: center; padding: 12px 16px; border-block: 1px solid var(--ink); font-size: 8px; }
.memory-spine b { height: 1px; background: var(--ink); }
.memory-spine code { font-size: 9px; }

.scoreband {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.scoreband > div { min-height: 120px; padding: 25px 3vw; border-right: 1px solid rgba(242, 239, 230, 0.3); }
.scoreband small, .scoreband strong, .scoreband span { display: block; }
.scoreband small { color: var(--acid); font-size: 8px; letter-spacing: 0.12em; }
.scoreband strong { margin: 12px 0 4px; font: 500 22px var(--serif); }
.scoreband span { color: #aaa79f; font-size: 10px; }

.thesis, .deletion, .boundary { padding-block: 110px; }
.thesis-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 12vw; margin: 42px 0 75px; }
.thesis h2, .section-head h2, .deletion h2, .boundary h2 { font: 500 clamp(44px, 5.5vw, 78px)/0.95 var(--serif); letter-spacing: -0.04em; }
.thesis-copy { padding-top: 10px; font: 400 19px/1.6 var(--serif); }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.principles article { padding: 25px 26px 10px 0; border-right: 1px solid var(--line); }
.principles article:not(:first-child) { padding-left: 26px; }
.principles span { color: var(--signal); font-size: 10px; }
.principles h3 { margin: 16px 0 8px; font: 500 25px var(--serif); }
.principles p { color: var(--muted); font-size: 11px; }

.demo-wrap { padding-block: 98px 120px; color: var(--paper); background: #1a1a17; }
.section-index.inverse { color: var(--acid); }
.section-head { display: flex; justify-content: space-between; gap: 40px; align-items: end; margin-bottom: 55px; }
.section-head h2 { margin: 25px 0 0; }
.session-card { min-width: 250px; padding: 15px; border: 1px solid rgba(242, 239, 230, 0.35); }
.session-card small, .session-card code, .session-card span { display: block; }
.session-card small { font-size: 8px; color: #aaa79f; }
.session-card code { margin: 9px 0; font-size: 10px; word-break: break-all; }
.session-card span { color: var(--acid); font-size: 11px; }

.demo-grid { display: grid; grid-template-columns: minmax(270px, 0.7fr) minmax(500px, 1.3fr); gap: 34px; align-items: start; }
.case-file { position: sticky; top: 105px; border: 1px solid rgba(242, 239, 230, 0.45); background: #22221e; }
.case-file .panel-label b { color: var(--acid); }
.case-file label, .proof-form label { display: block; padding: 15px; color: #aaa79f; font-size: 9px; text-transform: uppercase; }
.case-file input, .proof-form input {
  width: 100%;
  margin-top: 7px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid rgba(242, 239, 230, 0.35);
  border-radius: 0;
  color: var(--paper);
  background: transparent;
  text-transform: none;
}
.two-fields { display: grid; grid-template-columns: 1fr 1fr; border-block: 1px solid rgba(242, 239, 230, 0.2); }
.two-fields label:first-child { border-right: 1px solid rgba(242, 239, 230, 0.2); }
.intent-hash { margin: 15px; padding: 13px; color: var(--ink); background: var(--acid); }
.intent-hash small, .intent-hash code { display: block; }
.intent-hash small { font-size: 8px; }
.intent-hash code { margin-top: 8px; font-size: 10px; word-break: break-all; }
.case-note { padding: 2px 15px 15px; color: #aaa79f; font-size: 9px; }

.runbook { border-top: 1px solid rgba(242, 239, 230, 0.45); }
.run-step { display: grid; grid-template-columns: 62px 1fr; border-bottom: 1px solid rgba(242, 239, 230, 0.33); }
.run-step[data-current="true"] { background: rgba(201, 255, 74, 0.055); }
.step-num { padding: 24px 13px; color: var(--acid); font: 500 22px var(--serif); border-right: 1px solid rgba(242, 239, 230, 0.3); }
.step-body { padding: 23px; }
.step-body header { display: flex; justify-content: space-between; gap: 18px; }
.step-body small { color: #8f8d85; font-size: 8px; letter-spacing: 0.12em; }
.step-body h3 { margin: 5px 0 12px; font: 500 25px var(--serif); }
.step-body p { max-width: 650px; color: #aaa79f; font-size: 11px; }
.step-body blockquote { margin: 7px 0 12px; padding: 12px 15px; color: #ffb19e; border-left: 3px solid var(--signal); background: rgba(227, 81, 47, 0.1); font: 400 14px/1.5 var(--serif); }
.state { height: max-content; padding: 4px 7px; color: #8f8d85; border: 1px solid currentColor; font-size: 8px; }
.state.success { color: var(--mint); }
.state.failure { color: #ff8a6e; }
.state.working { color: var(--acid); }
.output { max-height: 300px; margin: 17px 0 0; padding: 15px; overflow: auto; border: 1px solid rgba(242, 239, 230, 0.2); color: #d8d4ca; background: #11110f; font-size: 9px; white-space: pre-wrap; word-break: break-word; }
.hidden { display: none; }

.deletion-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 9vw; align-items: center; margin-top: 45px; }
.deletion p { max-width: 520px; }
.terminal { border: 1px solid var(--ink); background: #121210; color: #d9d6cd; box-shadow: 13px 13px 0 var(--signal); }
.terminal-bar { padding: 9px 13px; border-bottom: 1px solid #44443f; }
.terminal-bar span { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--signal); }
.terminal-bar span:nth-child(2) { background: #d4aa35; }
.terminal-bar span:nth-child(3) { background: #54a973; }
.terminal-bar b { float: right; color: #77766f; font-size: 9px; }
.terminal pre { min-height: 235px; margin: 0; padding: 28px; font: 12px/1.8 var(--mono); white-space: pre-wrap; }
.terminal i { color: var(--acid); font-style: normal; }
.terminal b { color: #ff7d5d; }

.boundary { border-top: 1px solid var(--ink); }
.boundary-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 45px; border: 1px solid var(--ink); }
.boundary-grid article { padding: 28px; border-right: 1px solid var(--ink); }
.boundary-grid article:last-child { border-right: 0; }
.boundary-grid small { font-weight: 600; }
.boundary-grid ul { margin: 24px 0 0; padding: 0; list-style: none; }
.boundary-grid li { padding: 9px 0; border-top: 1px solid var(--line); font: 400 16px var(--serif); }
.boundary-grid li::before { content: "+"; margin-right: 10px; color: #158653; font-family: var(--mono); }
.boundary-grid .pending li::before { content: "○"; color: #b87815; }
.boundary-grid .not-claimed li::before { content: "×"; color: var(--signal); }

footer { padding: 28px 0; color: #aaa79f; background: var(--ink); font-size: 9px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 30; max-width: min(420px, calc(100% - 40px)); padding: 14px 18px; color: var(--paper); background: var(--ink); border-left: 5px solid var(--acid); box-shadow: 6px 6px 0 rgba(227, 81, 47, 0.75); transform: translateY(140%); transition: transform 220ms ease; font-size: 11px; }
.toast.visible { transform: translateY(0); }

.proof-page { min-height: 100vh; background: #1a1a17; color: var(--paper); }
.proof-page .topbar { color: var(--ink); }
.proof-shell { padding-block: 100px; }
.proof-shell h1 { margin: 30px 0 20px; font: 500 clamp(56px, 8vw, 108px)/0.9 var(--serif); letter-spacing: -0.05em; }
.proof-shell > p { max-width: 760px; color: #aaa79f; font: 400 19px/1.55 var(--serif); }
.proof-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; margin: 45px 0 30px; }
.proof-form label { padding: 0; }
.proof-form .button { min-height: 51px; color: var(--ink); background: var(--acid); }
.proof-inspector-output { min-height: 270px; padding: 24px; overflow: auto; color: #d8d4ca; background: #10100e; border: 1px solid #4e4d47; font-size: 11px; white-space: pre-wrap; }
.proof-rules { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 45px; border-top: 1px solid #4e4d47; }
.proof-rules article { padding: 25px 24px 0 0; }
.proof-rules article:not(:first-child) { padding-left: 24px; border-left: 1px solid #4e4d47; }
.proof-rules strong { color: var(--acid); font: 500 20px var(--serif); }
.proof-rules p { margin-top: 10px; color: #aaa79f; font-size: 10px; }

.evidence-status { margin: 40px 0 22px; padding: 14px 16px; color: var(--ink); background: var(--acid); font-size: 10px; }
.evidence-cards { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid #4e4d47; }
.evidence-cards article { min-height: 190px; padding: 25px; border-right: 1px solid #4e4d47; border-bottom: 1px solid #4e4d47; }
.evidence-cards article:nth-child(2n) { border-right: 0; }
.evidence-cards article:nth-last-child(-n + 2) { border-bottom: 0; }
.evidence-cards small { display: block; color: #8f8d85; font-size: 8px; letter-spacing: 0.12em; }
.evidence-cards strong { display: block; margin: 20px 0 13px; color: var(--acid); font: 500 27px var(--serif); }
.evidence-cards p { margin: 0; color: #aaa79f; font-size: 10px; }
.claim-matrix { display: grid; grid-template-columns: 1fr 1fr; margin-top: 45px; border: 1px solid #4e4d47; }
.claim-matrix > div { padding: 28px; }
.claim-matrix > div + div { border-left: 1px solid #4e4d47; }
.claim-matrix ul { margin: 25px 0 0; padding: 0; list-style: none; }
.claim-matrix li { padding: 10px 0; border-top: 1px solid #4e4d47; color: #d8d4ca; font: 400 16px/1.45 var(--serif); }
.claim-matrix li::before { content: "+"; margin-right: 10px; color: var(--acid); font-family: var(--mono); }
.claim-matrix .not-claimed-panel li::before { content: "×"; color: var(--signal); }
.evidence-raw { margin-top: 45px; border: 1px solid #4e4d47; }
.evidence-raw summary { padding: 17px; cursor: pointer; color: var(--acid); font-size: 10px; text-transform: uppercase; }
.evidence-raw pre { max-height: 560px; margin: 0; padding: 22px; overflow: auto; border-top: 1px solid #4e4d47; color: #d8d4ca; background: #10100e; font-size: 9px; white-space: pre-wrap; word-break: break-word; }

.reveal { animation: rise 600ms ease both; }
.delay-1 { animation-delay: 130ms; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

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

@media (max-width: 900px) {
  .topbar nav { display: none; }
  .hero, .thesis-grid, .deletion-grid, .demo-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 65px; }
  .hero-proof { max-width: 650px; }
  .scoreband { grid-template-columns: 1fr 1fr; }
  .principles, .boundary-grid, .proof-rules, .evidence-cards, .claim-matrix { grid-template-columns: 1fr; }
  .principles article, .principles article:not(:first-child), .boundary-grid article, .proof-rules article:not(:first-child) { padding: 24px 0; border-right: 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .case-file { position: static; }
  .evidence-cards article, .evidence-cards article:nth-child(2n), .evidence-cards article:nth-last-child(-n + 2) { border-right: 0; border-bottom: 1px solid #4e4d47; }
  .evidence-cards article:last-child { border-bottom: 0; }
  .claim-matrix > div + div { border-left: 0; border-top: 1px solid #4e4d47; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 28px, 1240px); }
  .topbar { min-height: 67px; padding-inline: 14px; }
  .backend-pill b { display: none; }
  .hero { min-height: auto; padding-block: 55px; }
  .hero h1 { font-size: clamp(55px, 18vw, 78px); }
  .memory-spine { grid-template-columns: 1fr; }
  .memory-spine b { display: none; }
  .scoreband { grid-template-columns: 1fr; }
  .thesis, .deletion, .boundary { padding-block: 75px; }
  .section-head { display: block; }
  .session-card { margin-top: 28px; }
  .run-step { grid-template-columns: 45px 1fr; }
  .step-body { padding: 18px 14px; }
  .step-body header { display: block; }
  .state { display: inline-block; margin-bottom: 10px; }
  .two-fields { grid-template-columns: 1fr; }
  .two-fields label:first-child { border-right: 0; border-bottom: 1px solid rgba(242, 239, 230, 0.2); }
  .proof-form { grid-template-columns: 1fr; }
  .footer-inner { display: block; }
  .footer-inner span { display: block; margin: 5px 0; }
}
