* { box-sizing: border-box; }

:root {
  --page: #fcfbfe;
  --ink: #131b2e;
  --muted: #565c6f;
  --faint: #7b8192;
  --line: #d9dced;
  --blue: #003ec7;
  --blue-soft: #eef2ff;
  --red: #c52a2f;
  --red-soft: #fff0ee;
  --green: #168451;
  --green-soft: #e7f6ed;
  --night: #0b1020;
  --night-2: #11182b;
  --night-line: #29334b;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Montserrat", ui-sans-serif, system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body { --mirror-faint: #686b7d; --faint: #686b7d; margin: 0; background: var(--page); color: var(--ink); font-family: var(--sans); }
button, a { font: inherit; }
button { color: inherit; }
main { width: min(1500px, 100%); margin-inline: auto; padding: 0 clamp(20px, 4.5vw, 72px) 100px; }

.hero {
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  gap: clamp(56px, 9vw, 150px);
  align-items: end;
  padding: clamp(74px, 8vw, 118px) 0 72px;
  border-bottom: 1px solid var(--line);
}
.hero h1 { max-width: 940px; margin: 0; font-size: clamp(48px, 5.8vw, 84px); font-weight: 540; line-height: 1; letter-spacing: -.04em; }
.hero-summary { max-width: 850px; margin: 34px 0 0; color: var(--muted); font-size: clamp(18px, 1.55vw, 23px); line-height: 1.58; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 38px; }
.hero-actions a { color: var(--blue); font-size: 14px; font-weight: 700; text-decoration: none; }
.hero-actions .primary-link { padding: 14px 20px; border: 1px solid var(--blue); border-radius: 999px; background: var(--blue); color: white; }
.hero-surface-map { border-top: 2px solid var(--blue); }
.hero-surface-map h2 { margin: 25px 0 20px; font-size: clamp(22px, 2.1vw, 31px); font-weight: 620; line-height: 1.2; letter-spacing: -.025em; }
.hero-surface-map > div { display: grid; gap: 7px; padding: 15px 0; border-top: 1px solid var(--line); }
.hero-surface-map > div strong { font-size: 13px; }
.hero-surface-map > div span { color: var(--muted); font-size: 12px; line-height: 1.55; }
.hero-surface-map > p { margin: 22px 0 0; padding-top: 20px; border-top: 1px solid var(--blue); color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.55; }

.scenario-overview { padding: 112px 0; }
.section-heading { margin-bottom: 52px; }
.section-heading h2 { max-width: 800px; margin: 0; font-size: clamp(38px, 4.6vw, 70px); font-weight: 520; line-height: 1.02; letter-spacing: -.045em; }
.section-heading p { max-width: 720px; margin: 22px 0 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.scenario-index { display: grid; gap: 54px; }
.scenario-group { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 30px; }
.scenario-group-heading { padding-top: 18px; border-top: 2px solid var(--ink); }
.scenario-group-heading strong { display: block; margin-bottom: 10px; font-size: 15px; }
.scenario-group-heading span { display: block; color: var(--muted); font-size: 12px; line-height: 1.55; }
.scenario-group-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.scenario-choice { min-height: 130px; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 18px; align-items: start; padding: 24px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; transition: background 160ms ease; }
.scenario-choice:hover, .scenario-choice[aria-pressed="true"] { background: var(--blue-soft); }
.scenario-choice[aria-pressed="true"] { box-shadow: inset 3px 0 0 var(--blue); }
.scenario-choice > span { color: var(--faint); font: 500 12px/1.4 var(--mono); }
.scenario-choice b { display: block; margin-bottom: 9px; font-size: 16px; font-weight: 650; }
.scenario-choice small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.scenario-choice em { color: var(--faint); font: normal 12px/1.4 var(--mono); text-transform: uppercase; white-space: nowrap; }
.scenario-choice[aria-pressed="true"] em { color: var(--blue); }

.scenario-lab { scroll-margin-top: 84px; border: 1px solid var(--night-line); background: var(--night); color: #f4f6ff; }
.selected-brief { display: grid; grid-template-columns: 86px minmax(0, 1fr) minmax(340px, .55fr); gap: 34px; padding: 50px; border-bottom: 1px solid var(--night-line); }
.selected-number { color: #7e9cff; font: 500 16px/1 var(--mono); }
.selected-brief h2 { max-width: 820px; margin: 0; font-size: clamp(34px, 4vw, 60px); font-weight: 520; line-height: 1.05; letter-spacing: -.04em; }
.selected-name { margin: 16px 0 0; color: #8da6ff; font: 600 12px/1.45 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.selected-setup { max-width: 800px; margin: 24px 0 0; color: #b7c0d9; font-size: 15px; line-height: 1.65; }
.selected-brief dl { margin: 0; }
.selected-brief dl > div { padding: 16px 0; border-bottom: 1px solid var(--night-line); }
.selected-brief dt { margin-bottom: 8px; color: #8995b0; font: 500 12px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.selected-brief dd { margin: 0; color: #dfe4f3; font-size: 12px; line-height: 1.5; }

.proof-question { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); gap: 60px; padding: 42px 50px; border-bottom: 1px solid var(--night-line); background: #10172a; }
.proof-question > div > span { display: block; margin-bottom: 18px; color: #8da6ff; font: 600 12px/1 var(--mono); letter-spacing: .05em; }
.proof-question h3 { max-width: 760px; margin: 0; font-size: clamp(25px, 2.6vw, 38px); font-weight: 570; line-height: 1.18; letter-spacing: -.025em; }
.proof-question p { max-width: 760px; margin: 18px 0 0; color: #aeb8d1; font-size: 13px; line-height: 1.65; }
.proof-question dl { margin: 0; }
.proof-question dl > div { padding: 14px 0; border-top: 1px solid var(--night-line); }
.proof-question dt { margin-bottom: 8px; color: #8995b0; font: 500 12px/1.4 var(--mono); text-transform: uppercase; }
.proof-question dd { margin: 0; color: #dce2f1; font-size: 12px; line-height: 1.55; }

.same-input { display: grid; grid-template-columns: 180px repeat(3, 1fr); border-bottom: 1px solid var(--night-line); }
.same-input > span, .same-input > div { min-height: 118px; padding: 25px; border-right: 1px solid var(--night-line); }
.same-input > *:last-child { border-right: 0; }
.same-input > span { color: #8da6ff; font: 600 12px/1.4 var(--mono); letter-spacing: .05em; }
.same-input b { display: block; margin-bottom: 12px; color: #8995b0; font: 500 12px/1 var(--mono); text-transform: uppercase; }
.same-input strong { font-size: 12px; font-weight: 560; line-height: 1.5; }

.mirror-stack { border-bottom: 1px solid var(--night-line); background: #0a0f1e; }
.mirror-stack > header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .65fr); gap: 48px; align-items: end; padding: 34px 30px 28px; }
.mirror-stack > header span { color: #8da6ff; font: 600 12px/1 var(--mono); letter-spacing: .05em; }
.mirror-stack > header h3 { margin: 12px 0 0; font-size: clamp(22px, 2.4vw, 34px); font-weight: 560; letter-spacing: -.025em; }
.mirror-stack > header p { margin: 0; color: #aeb8cf; font-size: 13px; line-height: 1.65; }
.mirror-stack ol { display: grid; grid-template-columns: repeat(var(--proof-steps, 5), minmax(150px, 1fr)); margin: 0; padding: 0; overflow-x: auto; list-style: none; border-top: 1px solid var(--night-line); border-bottom: 1px solid var(--night-line); }
.mirror-stack li { min-height: 126px; display: grid; grid-template-rows: auto 1fr auto; gap: 14px; padding: 18px 16px; border-right: 1px solid var(--night-line); background: #0d1323; transition: background 180ms ease, box-shadow 180ms ease; }
.mirror-stack li:last-child { border-right: 0; }
.mirror-stack li > span { color: #8995b0; font: 500 12px/1 var(--mono); }
.mirror-stack li b { display: block; margin-bottom: 7px; font-size: 13px; }
.mirror-stack li small { display: block; color: #a8b2c8; font-size: 13px; line-height: 1.45; }
.mirror-stack li em { color: #8e9ab6; font: normal 600 12px/1 var(--mono); letter-spacing: .04em; }
.mirror-stack li.running { background: #17213a; box-shadow: inset 0 3px 0 #7796ff; }
.mirror-stack li.running em { color: #9eb4ff; }
.mirror-stack li.proved { background: #10261f; box-shadow: inset 0 3px 0 #49d28d; }
.mirror-stack li.proved em { color: #55db96; }
.mirror-stack li.stopped { background: #2a151d; box-shadow: inset 0 3px 0 #ff6d78; }
.mirror-stack li.stopped em { color: #ff7780; }
.stack-focus { min-height: 94px; display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: 25px; align-items: center; padding: 20px 30px; }
.stack-focus > span { color: #8da6ff; font: 600 12px/1 var(--mono); letter-spacing: .05em; }
.stack-focus strong { display: block; font-size: 14px; }
.stack-focus p { margin: 7px 0 0; color: #aeb8cf; font-size: 13px; line-height: 1.5; }
.stack-focus code { color: #a8b2c8; font: 500 12px/1.5 var(--mono); text-align: right; }

.run-controls { display: grid; grid-template-columns: minmax(250px, 1fr) 70px minmax(250px, 1fr) auto; align-items: stretch; padding: 22px 30px; border-bottom: 1px solid var(--night-line); background: #0e1425; }
.run-controls > button:not(#reset-runs) { display: grid; grid-template-columns: 32px 1fr; grid-template-rows: auto auto; gap: 5px 12px; min-height: 68px; padding: 13px 18px; border: 1px solid #425074; background: transparent; color: #f4f6ff; text-align: left; cursor: pointer; }
.run-controls > button:not(#reset-runs):hover:not(:disabled) { border-color: #8da6ff; background: #17203a; }
.run-controls > button:disabled { opacity: .42; cursor: not-allowed; }
.run-controls button span { grid-row: 1 / span 2; align-self: center; color: #8da6ff; font: 500 13px/1 var(--mono); }
.run-controls button b { font-size: 13px; font-weight: 670; }
.run-controls button small { color: #a8b2c8; font-size: 12px; }
.run-controls > i { position: relative; }
.run-controls > i::before { content: ""; position: absolute; top: 50%; left: 18px; right: 18px; height: 1px; background: #425074; }
.run-controls > i::after { content: "›"; position: absolute; top: calc(50% - 11px); right: 14px; color: #8da6ff; }
#reset-runs { margin-left: 22px; border: 0; background: transparent; color: #a8b2c8; font-size: 12px; cursor: pointer; }
#reset-runs:hover { color: white; }

.proof-stage { min-height: 570px; }
.path-head { display: grid; grid-template-columns: 110px minmax(250px, .7fr) 1fr; gap: 28px; align-items: center; min-height: 112px; padding: 24px 30px; border-bottom: 1px solid var(--night-line); }
.path-head > span { color: #a8b2c8; font: 600 12px/1 var(--mono); letter-spacing: .05em; }
.path-head > strong { font-size: 17px; font-weight: 640; }
.path-head > p { margin: 0; color: #aeb8cf; font-size: 13px; line-height: 1.55; }
.path-flow { display: grid; grid-template-columns: repeat(6, 1fr); margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--night-line); }
.path-flow li { min-height: 150px; padding: 23px 20px; border-right: 1px solid var(--night-line); background: #0d1323; transition: background 180ms ease, box-shadow 180ms ease; }
.path-flow li:last-child { border-right: 0; }
.path-flow span { display: block; margin-bottom: 30px; color: #8995b0; font: 500 12px/1 var(--mono); }
.path-flow b { display: block; margin-bottom: 9px; font-size: 13px; }
.path-flow small { color: #a0abc2; font-size: 12px; line-height: 1.4; }
.path-flow li.running { background: #17213a; box-shadow: inset 0 3px 0 #7796ff; }
.path-flow li.warning, .path-flow li.incomplete { background: #241c15; box-shadow: inset 0 3px 0 #d59644; }
.path-flow li.breached { background: #2a151d; box-shadow: inset 0 3px 0 #ff6d78; }
.path-flow li.blocked, .path-flow li.proved { background: #10261f; box-shadow: inset 0 3px 0 #49d28d; }
.path-flow li.traced { background: #131d35; box-shadow: inset 0 3px 0 #7796ff; }
.event-detail { min-height: 130px; display: grid; grid-template-columns: 150px 1fr; gap: 30px; align-items: center; padding: 26px 30px; border-bottom: 1px solid var(--night-line); }
.event-detail > span { color: #8da6ff; font: 600 12px/1 var(--mono); letter-spacing: .05em; }
.event-detail strong { font-size: 17px; }
.event-detail p { margin: 9px 0 0; color: #aeb8cf; font-size: 13px; line-height: 1.55; }
.event-facts { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 18px 0 0; padding-top: 15px; border-top: 1px solid var(--night-line); }
.event-facts > div { display: grid; grid-template-columns: auto auto; gap: 8px; align-items: baseline; }
.event-facts dt { color: #9ba7c0; font: 500 12px/1.4 var(--mono); text-transform: uppercase; }
.event-facts dd { margin: 0; color: #e0e5f3; font: 500 12px/1.4 var(--mono); overflow-wrap: anywhere; }
.result-strip { display: grid; grid-template-columns: repeat(4, 1fr); }
.result-strip > div { min-height: 105px; padding: 24px; border-right: 1px solid var(--night-line); }
.result-strip > div:last-child { border-right: 0; }
.result-strip span { display: block; margin-bottom: 14px; color: #8995b0; font: 500 12px/1 var(--mono); letter-spacing: .04em; }
.result-strip b { font-size: 12px; font-weight: 630; }
.result-strip b.bad { color: #ff7780; }
.result-strip b.good { color: #55db96; }
.proof-conclusion { display: grid; grid-template-columns: 190px 1fr; gap: 30px; padding: 30px; border-top: 1px solid var(--night-line); background: #10172a; }
.proof-conclusion > span { color: #8da6ff; font: 600 12px/1.45 var(--mono); letter-spacing: .04em; }
.proof-conclusion strong { display: block; max-width: 900px; font-size: 15px; line-height: 1.5; }
.proof-conclusion p { max-width: 900px; margin: 12px 0 0; color: #aeb8cf; font-size: 13px; line-height: 1.6; }

.technical-record { border-top: 1px solid var(--night-line); background: #0e1425; }
.technical-record summary { padding: 23px 30px; color: #aab4cc; font-size: 13px; cursor: pointer; }
.technical-record > div { display: grid; grid-template-columns: 1.2fr .8fr; gap: 50px; padding: 0 30px 34px; }
.technical-record dl { margin: 0; }
.technical-record dl > div { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 13px 0; border-top: 1px solid var(--night-line); }
.technical-record dt { color: #8d98b3; font: 500 12px/1.5 var(--mono); text-transform: uppercase; }
.technical-record dd { margin: 0; overflow-wrap: anywhere; color: #d9dfef; font: 500 12px/1.5 var(--mono); }
.technical-record p { margin: 0; color: #a7b2ca; font-size: 13px; line-height: 1.65; }

.closing-rule { max-width: 1050px; padding: 130px 0 40px; }
.closing-rule > p { color: var(--blue); font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.closing-rule h2 { margin: 25px 0 38px; font-size: clamp(38px, 5.5vw, 78px); font-weight: 520; line-height: 1.02; letter-spacing: -.045em; }
.closing-rule a { color: var(--blue); font-weight: 700; text-decoration: none; }

footer { min-height: 118px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 30px clamp(20px, 4.5vw, 72px); border-top: 1px solid var(--line); }
footer .brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 700; text-decoration: none; }
footer .brand img { width: auto; height: 30px; }
footer p { color: var(--muted); font-size: 12px; }
footer > a:last-child { color: var(--blue); font-size: 13px; font-weight: 700; text-decoration: none; }

@media (max-width: 1040px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-surface-map { max-width: 720px; }
  .selected-brief { grid-template-columns: 60px 1fr; }
  .selected-brief dl { grid-column: 2; }
  .same-input { grid-template-columns: 1fr 1fr; }
  .same-input > span { grid-column: 1 / -1; min-height: auto; }
  .path-flow { grid-template-columns: repeat(3, 1fr); }
  .path-flow li:nth-child(3) { border-right: 0; }
  .path-flow li:nth-child(-n+3) { border-bottom: 1px solid var(--night-line); }
  .scenario-group { grid-template-columns: 1fr; }
  .scenario-group-choices { grid-template-columns: 1fr 1fr; }
  .proof-question { grid-template-columns: 1fr; }
  .mirror-stack > header { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  main { padding-inline: 16px; }
  .hero { gap: 42px; padding: 54px 0 48px; }
  .hero h1 { font-size: clamp(39px, 11vw, 52px); line-height: 1.02; }
  .hero-summary { margin-top: 24px; font-size: 17px; line-height: 1.52; }
  .hero-actions { gap: 16px; margin-top: 28px; }
  .section-heading { grid-template-columns: 1fr; }
  .scenario-group-choices { grid-template-columns: 1fr; }
  .scenario-choice { grid-template-columns: 34px 1fr; }
  .scenario-choice em { grid-column: 2; }
  .selected-brief { grid-template-columns: 1fr; padding: 30px 22px; }
  .selected-brief dl { grid-column: auto; }
  .same-input { grid-template-columns: 1fr; }
  .same-input > span, .same-input > div { min-height: auto; border-right: 0; border-bottom: 1px solid var(--night-line); }
  .run-controls { grid-template-columns: 1fr; gap: 10px; padding: 18px; }
  .run-controls > i { display: none; }
  #reset-runs { margin: 8px 0 0; min-height: 36px; }
  .path-head { grid-template-columns: 1fr; }
  .path-flow { grid-template-columns: repeat(2, 1fr); }
  .path-flow li { border-bottom: 1px solid var(--night-line); }
  .path-flow li:nth-child(2n) { border-right: 0; }
  .event-detail { grid-template-columns: 1fr; }
  .result-strip { grid-template-columns: 1fr 1fr; }
  .result-strip > div { border-bottom: 1px solid var(--night-line); }
  .technical-record > div { grid-template-columns: 1fr; }
  .technical-record dl > div { grid-template-columns: 1fr; gap: 7px; }
  footer { align-items: flex-start; flex-direction: column; }
  .proof-question { padding: 30px 22px; }
  .proof-conclusion { grid-template-columns: 1fr; }
  .mirror-stack > header { gap: 18px; padding: 28px 22px; }
  .mirror-stack ol { grid-template-columns: repeat(var(--proof-steps, 5), 154px); }
  .stack-focus { grid-template-columns: 1fr; gap: 9px; padding: 20px 22px; }
  .stack-focus code { text-align: left; }
}

.run-history { margin-top: 28px; padding: 24px; border: 1px solid var(--line); }
.run-history summary { cursor: pointer; font-size: 18px; font-weight: 650; }
.run-history > p { max-width: 70ch; line-height: 1.6; }
#run-history-list { max-height: 560px; overflow-y: auto; overscroll-behavior: contain; }
#run-history-list h4 { margin: 28px 0 14px; font-size: 20px; }
#run-history-list ol { margin: 0; padding: 0; list-style: none; }
#run-history-list li { padding: 20px 16px; border-top: 1px solid var(--line); border-left: 3px solid #8b94a8; }
#run-history-list li[data-status="blocked"], #run-history-list li[data-status="proved"] { border-left-color: #087f69; }
#run-history-list li[data-status="breached"] { border-left-color: #bd3434; }
#run-history-list strong { font-size: 16px; }
#run-history-list p { margin: 9px 0 0; font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
#run-history-list .trace-facts { font-size: 14px; color: #535f72; }

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