:root {
  --ink: #f2f3ee;
  --muted: #919993;
  --night: #0b100f;
  --panel: #111817;
  --line: #29312f;
  --acid: #d8ff4f;
  --mint: #64e4be;
  --orange: #ff8a58;
  --mono: "DM Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--ink); font-family: Manrope, sans-serif; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }

.topbar { position: sticky; top: 0; z-index: 20; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 4vw; border-bottom: 1px solid var(--line); background: rgba(11,16,15,.94); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -.04em; }
.brand > span:last-child > span { color: var(--acid); }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; color: var(--night); background: var(--acid); clip-path: polygon(0 0,100% 0,100% 74%,74% 100%,0 100%); font-family: var(--mono); }
.event-pill { padding: 7px 12px; color: #bdc4bf; border: 1px solid var(--line); font: 10px var(--mono); letter-spacing: .12em; }
.event-pill span, .system-state i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 10px var(--acid); }
.topbar nav { display: flex; gap: 28px; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }

.hero { min-height: 650px; display: flex; flex-direction: column; justify-content: center; padding: 8vw; position: relative; overflow: hidden; background: radial-gradient(circle at 78% 40%, rgba(100,228,190,.11), transparent 28%), linear-gradient(115deg, transparent 55%, rgba(216,255,79,.035) 55%); }
.hero::after { content: ""; position: absolute; inset: 0; opacity: .16; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 60px 60px; mask-image: linear-gradient(90deg, transparent, #000 80%); }
.eyebrow, .kicker { color: var(--acid); font: 11px var(--mono); letter-spacing: .16em; }
.hero h1 { max-width: 850px; margin: 24px 0; font-size: clamp(58px, 8vw, 112px); line-height: .89; letter-spacing: -.07em; }
.hero h1 em { color: var(--acid); font-style: normal; }
.hero > p { max-width: 650px; margin: 5px 0 34px; color: #abb2ad; font-size: 18px; line-height: 1.7; }
.hero-actions { display: flex; align-items: center; gap: 30px; }
.primary { display: flex; align-items: center; justify-content: space-between; gap: 44px; padding: 16px 18px; color: var(--night); background: var(--acid); font-size: 13px; font-weight: 700; }
.text-link { padding-bottom: 5px; border-bottom: 1px solid #68716c; font-size: 13px; }
.hero-stats { display: flex; gap: 1px; margin-top: 70px; }
.hero-stats div { min-width: 180px; padding: 14px 24px; border-left: 1px solid var(--line); }
.hero-stats strong { display: block; font: 22px var(--mono); }
.hero-stats span { color: var(--muted); font-size: 11px; }

.console { padding: 70px 4vw 90px; background: #0d1312; border-top: 1px solid var(--line); }
.console-head, .panel-title { display: flex; align-items: center; justify-content: space-between; }
.console-head h2 { margin: 10px 0 26px; font-size: 34px; letter-spacing: -.04em; }
.system-state { color: var(--acid); font: 10px var(--mono); letter-spacing: .12em; }
.toolbar { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr 1fr; border: 1px solid var(--line); }
.toolbar label { display: flex; flex-direction: column; justify-content: center; gap: 11px; min-height: 86px; padding: 14px 18px; color: var(--muted); border-right: 1px solid var(--line); font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.toolbar select { width: 100%; color: var(--ink); background: transparent; border: 0; outline: none; font: 14px Manrope; }
.slider-label span { display: flex; justify-content: space-between; }
.slider-label b { color: var(--ink); }
input[type=range] { width: 100%; height: 2px; accent-color: var(--acid); }
#optimize-button { border: 0; color: var(--night); background: var(--acid); cursor: pointer; transition: filter .2s; }
#optimize-button:hover { filter: brightness(1.08); }
#optimize-button span, #optimize-button small { display: block; }
#optimize-button span { font: 700 12px var(--mono); letter-spacing: .08em; }
#optimize-button small { margin-top: 6px; font-size: 10px; opacity: .7; }
#optimize-button.running { animation: pulse .6s infinite alternate; }
@keyframes pulse { to { filter: brightness(.7); } }
.scenario-brief { display: flex; align-items: center; gap: 15px; padding: 13px 18px; border: 1px solid var(--line); border-top: 0; }
.scenario-brief span { color: var(--orange); font: 9px var(--mono); letter-spacing: .1em; white-space: nowrap; }
.scenario-brief p { margin: 0; color: var(--muted); font-size: 12px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin: 20px 0; border: 1px solid var(--line); }
.kpi-grid article { padding: 20px 22px; border-right: 1px solid var(--line); }
.kpi-grid article:last-child { border: 0; }
.kpi-grid span, .panel-title span { display: block; color: var(--muted); font: 9px var(--mono); letter-spacing: .13em; }
.kpi-grid strong { display: block; margin: 10px 0 3px; font: 32px var(--mono); letter-spacing: -.05em; }
.kpi-grid small { color: #69736e; font-size: 10px; }

.workspace { display: grid; grid-template-columns: minmax(0, 2.05fr) minmax(290px, .95fr); gap: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); }
.panel-title { min-height: 70px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-title h3 { margin: 6px 0 0; font-size: 17px; }
.legend { color: var(--muted); font: 8px var(--mono); }
.legend i { display: inline-block; margin: 0 5px 0 11px; vertical-align: middle; }
.legend .hub { width: 8px; height: 8px; background: var(--acid); }
.legend .zone { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.legend .route { width: 14px; height: 1px; background: var(--mint); }
.map { height: 440px; background: #0d1413; }
.map svg { width: 100%; height: 100%; }
.routes line { stroke: var(--mint); }
.depot circle:first-child { fill: var(--acid); }
.depot .halo { fill: none; stroke: var(--acid); stroke-width: .35; opacity: .4; }
.need-zone circle { fill: var(--orange); stroke: #ffd1bd; stroke-width: .25; }
.map text { fill: #d4d9d5; font: 2.5px var(--mono); text-anchor: middle; }
.map .coverage-label { fill: #828d87; font-size: 2.1px; }
.map-note { padding: 9px 20px; color: #65706a; border-top: 1px solid var(--line); font: 8px var(--mono); letter-spacing: .06em; }
.simulation-count { color: var(--acid); font: 9px var(--mono); }
.probability { display: grid; place-items: center; padding: 34px 10px 20px; }
.probability-ring { --probability: 180deg; width: 174px; height: 174px; display: grid; place-content: center; text-align: center; border-radius: 50%; background: radial-gradient(circle, var(--panel) 62%, transparent 63%), conic-gradient(var(--acid) var(--probability), #27302d 0); }
.probability-ring strong { font: 35px var(--mono); }
.probability-ring span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.range { margin: 14px 24px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.range-labels, .range-values { display: flex; justify-content: space-between; }
.range-labels { color: var(--muted); font: 8px var(--mono); }
.range-values { margin-top: 6px; font: 13px var(--mono); }
.resilience-copy { margin: 18px 24px 25px; color: var(--muted); font-size: 11px; line-height: 1.65; }

.allocation-panel { margin-top: 20px; }
.ghost { padding: 9px 12px; color: var(--acid); border: 1px solid #465047; background: transparent; font: 9px var(--mono); cursor: pointer; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 18px; color: #6f7974; border-bottom: 1px solid var(--line); text-align: left; font: 8px var(--mono); letter-spacing: .08em; }
td { padding: 15px 18px; border-bottom: 1px solid #202826; font: 12px var(--mono); }
td:first-child strong, td:first-child small { display: block; }
td:first-child strong { font-family: Manrope; font-size: 12px; }
td small { color: #69726e; font-size: 9px; }
.vuln { display: inline-block; width: 56px; height: 3px; margin-right: 7px; background: #2b3431; vertical-align: middle; }
.vuln i { display: block; height: 100%; background: var(--orange); }
.coverage-chip { padding: 5px 8px; border: 1px solid; }
.coverage-chip.good { color: var(--acid); border-color: #506120; }
.coverage-chip.mid { color: #ffd16c; border-color: #5f4e25; }
.coverage-chip.warn { color: var(--orange); border-color: #653c2b; }
.decision-strip { display: grid; grid-template-columns: 150px 1fr; padding: 18px 22px; background: rgba(216,255,79,.06); border: 1px solid #3f472a; border-top: 0; }
.decision-strip span { color: var(--acid); font: 9px var(--mono); letter-spacing: .1em; }
.decision-strip p { margin: 0; color: #adb5b0; font-size: 11px; line-height: 1.6; }

.method { display: grid; grid-template-columns: 1fr 1fr; gap: 8vw; padding: 110px 8vw; background: var(--ink); color: var(--night); }
.method .eyebrow { color: #657b00; }
.method h2, .proof h2 { margin: 20px 0; font-size: clamp(42px, 5vw, 68px); line-height: 1; letter-spacing: -.06em; }
.method-lead p { color: #58605c; line-height: 1.75; }
.method ol { list-style: none; margin: 0; padding: 0; }
.method li { display: grid; grid-template-columns: 50px 1fr; gap: 20px; padding: 25px 0; border-top: 1px solid #c5c9c2; }
.method li > span { color: #748800; font: 11px var(--mono); }
.method h3 { margin: 0 0 8px; font-size: 20px; }
.method li p { margin: 0; color: #626965; font-size: 13px; line-height: 1.6; }
.proof { padding: 100px 8vw; background: #151d1b; }
.proof > div:first-child { max-width: 750px; }
.proof-grid { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 50px; border-top: 1px solid var(--line); }
.proof article { padding: 30px 35px 20px 0; border-right: 1px solid var(--line); }
.proof article:not(:first-child) { padding-left: 35px; }
.proof article span { color: var(--acid); font: 10px var(--mono); }
.proof article h3 { margin: 30px 0 12px; }
.proof article p { color: var(--muted); font-size: 13px; line-height: 1.7; }
footer { display: flex; justify-content: space-between; align-items: center; padding: 38px 4vw; color: #69726d; font: 8px var(--mono); letter-spacing: .06em; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .event-pill, .topbar nav { display: none; }
  .hero { padding: 80px 6vw; }
  .hero-stats { flex-wrap: wrap; }
  .toolbar, .kpi-grid { grid-template-columns: 1fr 1fr; }
  .toolbar label:nth-child(2), .kpi-grid article:nth-child(2) { border-right: 0; }
  .workspace, .method { grid-template-columns: 1fr; }
  .proof-grid { grid-template-columns: 1fr; }
  .proof article { border-right: 0; border-bottom: 1px solid var(--line); padding-left: 0 !important; }
  footer { flex-direction: column; gap: 20px; text-align: center; }
}

@media (max-width: 560px) {
  .hero h1 { font-size: 56px; }
  .toolbar, .kpi-grid { grid-template-columns: 1fr; }
  .toolbar label, .kpi-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-stats div { min-width: 150px; }
  .console-head { align-items: flex-end; }
  .legend { display: none; }
  .decision-strip { grid-template-columns: 1fr; gap: 10px; }
}
