:root {
  color-scheme: dark;
  --paper: #f4f1e8;
  --ink: #0c0d0d;
  --muted: #b5b4ad;
  --line: #343632;
  --acid: #e5ff63;
  --warm: #d9a784;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }
button, [tabindex] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.app-shell {
  width: 100%;
  height: 100dvh;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  gap: clamp(8px, 1.5vh, 16px);
  background:
    radial-gradient(circle at 88% 12%, rgba(229, 255, 99, .065), transparent 28%),
    var(--ink);
}

.presenter-bar,
.controls {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #d5d3cc;
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.identity b { color: var(--muted); font-weight: 400; }
.identity-mark {
  width: 12px;
  height: 12px;
  border: 3px solid var(--acid);
  flex: 0 0 auto;
}

.jump-nav { display: flex; gap: 8px; min-width: 0; }
.nav-chip,
.control-button,
.run-demo,
.download-demo {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
  touch-action: manipulation;
}
.nav-chip {
  padding: 0 16px;
  font-size: 13px;
  font-weight: 650;
}
.nav-chip:hover, .nav-chip:active,
.control-button:hover, .control-button:active { border-color: #777a72; background: #171817; }
.nav-chip-accent { border-color: var(--acid); color: var(--acid); }
.nav-chip-accent:hover, .nav-chip-accent:active { background: var(--acid); color: var(--ink); }
.restart { color: var(--paper); border-color: #565851; }

.deck {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.slide-frame {
  position: relative;
  width: min(100%, calc((100dvh - 150px) * 16 / 9));
  max-height: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #3d403b;
  background: #111211;
  container-type: size;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .38);
  touch-action: pan-y;
}

.slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: clamp(22px, 4cqw, 64px);
  background: #111211;
  animation: slide-in 220ms ease-out both;
}
.slide::after {
  content: "";
  position: absolute;
  right: clamp(18px, 3cqw, 48px);
  bottom: clamp(16px, 2.5cqw, 40px);
  width: clamp(18px, 2.2cqw, 36px);
  height: 2px;
  background: var(--acid);
}

.kicker,
.slide-index,
.eyebrow,
.slide-note,
.proof-label {
  font-size: clamp(11px, 1.25cqw, 18px);
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.kicker { display: flex; justify-content: space-between; color: var(--muted); }
.eyebrow { color: var(--acid); margin: 0 0 2.2cqh; }
.slide-index { color: var(--muted); }
.slide-note {
  position: absolute;
  left: clamp(22px, 4cqw, 64px);
  right: 10cqw;
  bottom: clamp(16px, 2.5cqw, 40px);
  margin: 0;
  color: var(--muted);
  text-transform: none;
  letter-spacing: .035em;
}

h1, h2, p { text-wrap: pretty; }
h1, h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .94;
}
h1 em, h2 em { color: var(--acid); font-weight: 400; }

.cover { background: linear-gradient(115deg, #121311 0 70%, #191b16 70%); }
.cover::before {
  content: "";
  position: absolute;
  width: 27cqw;
  aspect-ratio: 1;
  right: 4cqw;
  top: 12cqh;
  border: 1px solid #3f4434;
  transform: rotate(12deg);
}
.cover-copy { position: absolute; left: 9cqw; top: 29cqh; }
.cover h1 { font-size: clamp(38px, 7.25cqw, 116px); }
.cover .slide-note { left: 9cqw; }

.field h2 { position: absolute; left: 7cqw; top: 18cqh; font-size: clamp(34px, 6.4cqw, 102px); }
.field-list {
  position: absolute;
  top: 17cqh;
  right: 6cqw;
  width: 32cqw;
  border-top: 1px solid var(--line);
}
.field-list p {
  margin: 0;
  padding: 1.45cqh 0;
  border-bottom: 1px solid var(--line);
  color: #d7d5ce;
  font-size: clamp(11px, 1.42cqw, 22px);
}

.hypothesis { background: #121311; }
.hypothesis-copy { position: absolute; top: 17cqh; left: 7cqw; max-width: 72cqw; }
.hypothesis h2 { font-size: clamp(33px, 6cqw, 96px); }
.process-line {
  position: absolute;
  left: 7cqw;
  right: 7cqw;
  top: 65cqh;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 0;
  margin: 0;
  list-style-position: inside;
  border-top: 1px solid var(--line);
}
.process-line li {
  min-width: 0;
  padding: 2cqh 1cqw 0 0;
  color: #d5d3cc;
  font-size: clamp(10px, 1.25cqw, 19px);
}
.process-line li::marker { color: var(--acid); font-variant-numeric: tabular-nums; }

.proof { background: var(--paper); color: var(--ink); }
.proof::after { background: var(--ink); }
.proof-label { display: flex; align-items: center; gap: 10px; color: #52534f; }
.status-dot { width: 9px; height: 9px; display: inline-block; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.proof h2 { margin: 10cqh 0 0 5cqw; font-size: clamp(36px, 6.9cqw, 110px); }
.proof h2 span { color: #4a5300; }
.proof-line {
  position: absolute;
  left: 9cqw;
  right: 5cqw;
  bottom: 18cqh;
  display: grid;
  grid-template-columns: .85fr .55fr 1.4fr;
  border-top: 1px solid #b8b6ae;
}
.proof-line p {
  margin: 0;
  padding: 2.2cqh 2.5cqw 0 0;
  font-size: clamp(11px, 1.38cqw, 22px);
  line-height: 1.4;
}
.proof-line strong { display: block; font-size: 1.6em; font-weight: 500; }
.proof .slide-note { color: #686964; }

.method h2 { margin: 13cqh 0 0 5cqw; font-size: clamp(36px, 6.8cqw, 108px); }
.method-grid {
  position: absolute;
  left: 9cqw;
  right: 8cqw;
  top: 59cqh;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.method-grid > div { padding: 2cqh 2cqw 0 0; }
.method-grid span { color: var(--acid); font-size: clamp(9px, .95cqw, 15px); letter-spacing: .12em; text-transform: uppercase; }
.method-grid p { margin: .8cqh 0 0; font-size: clamp(11px, 1.35cqw, 21px); line-height: 1.35; }

.demo { padding-top: clamp(18px, 3cqw, 48px); }
.demo-heading { display: flex; align-items: end; justify-content: space-between; gap: 3cqw; }
.demo .eyebrow { margin-bottom: 1cqh; }
.demo h2 { font-size: clamp(32px, 5.4cqw, 86px); }
.fixture-summary { display: flex; gap: 1.8cqw; padding-bottom: .5cqh; color: var(--muted); font-size: clamp(10px, 1.12cqw, 17px); }
.fixture-summary span::before { content: "•"; margin-right: .7cqw; color: var(--acid); }
.demo-panel {
  position: absolute;
  top: 28cqh;
  left: 4cqw;
  right: 4cqw;
  bottom: 10cqh;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.demo-idle {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4cqw;
}
.demo-idle p { margin: 0; color: #cfcdc6; font-size: clamp(12px, 1.55cqw, 24px); }
.run-demo {
  flex: 0 0 min(29cqw, 300px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.8cqw;
  border-color: var(--acid);
  background: var(--acid);
  color: var(--ink);
  font-size: clamp(12px, 1.35cqw, 20px);
  font-weight: 700;
}
.run-demo:active { transform: translateY(1px); }
.run-demo[disabled] { cursor: wait; opacity: .72; }
.demo-output { height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.demo-result-line { min-height: 7.5cqh; display: flex; align-items: center; justify-content: space-between; gap: 2cqw; }
.demo-result-line > div { display: flex; align-items: center; gap: 10px; font-size: clamp(11px, 1.25cqw, 19px); }
.download-demo { min-height: 44px; padding: 0 1.6cqw; border-color: #676a62; font-size: clamp(11px, 1.15cqw, 17px); }
.download-demo:not(:disabled):hover { border-color: var(--acid); color: var(--acid); }
.download-demo:disabled { opacity: .45; cursor: not-allowed; }
.demo-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.demo-stats div { padding: 1.2cqh 1cqw 1cqh 0; }
.demo-stats strong { display: block; color: var(--acid); font-family: var(--serif); font-size: clamp(18px, 2.7cqw, 42px); font-weight: 400; line-height: 1; }
.demo-stats span { color: var(--muted); font-size: clamp(9px, .95cqw, 14px); }
.preview-wrap { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-color: #62655e transparent; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: clamp(9px, 1.03cqw, 15px); }
th, td { padding: 1cqh 1cqw 1cqh 0; border-bottom: 1px solid #272926; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th { position: sticky; top: 0; z-index: 1; background: #111211; color: var(--muted); font-weight: 500; }
td:last-child { color: #e8e6df; }

.boundary h2 { margin: 9cqh 0 0 5cqw; font-size: clamp(34px, 6.4cqw, 102px); }
.boundary-lead { position: absolute; left: 9cqw; top: 55cqh; margin: 0; color: var(--warm); font-size: clamp(11px, 1.38cqw, 21px); }
.boundary-list {
  position: absolute;
  left: 48cqw;
  right: 7cqw;
  top: 52cqh;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.boundary-list li { padding: 1.2cqh 0; border-bottom: 1px solid var(--line); font-size: clamp(10px, 1.18cqw, 18px); }
.boundary-list li::before { content: "—"; color: var(--acid); margin-right: 1cqw; }

.close .eyebrow { margin: 1cqh 0 8cqh 4cqw; }
.close h2 { margin-left: 4cqw; font-size: clamp(36px, 7cqw, 112px); }
.pilot-list {
  position: absolute;
  top: 25cqh;
  right: 6cqw;
  width: 34cqw;
  border-top: 1px solid var(--line);
}
.pilot-list span { display: block; padding: 1.3cqh 0; border-bottom: 1px solid var(--line); font-size: clamp(10px, 1.15cqw, 18px); }
.pilot-list span::before { content: "□"; color: var(--acid); margin-right: 1cqw; }
.closing-line { position: absolute; left: 8cqw; bottom: 18cqh; margin: 0; color: #d4d2ca; font-size: clamp(13px, 1.65cqw, 26px); }

.controls { min-height: 48px; }
.control-button { min-width: 112px; padding: 0 14px; font-size: 13px; }
.control-button:disabled { opacity: .3; cursor: default; }
.progress-readout { display: grid; grid-template-columns: 2ch minmax(80px, 18vw) 2ch; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.progress-readout > span:first-child { color: var(--paper); }
.progress-rule { height: 1px; background: var(--line); }
.progress-rule i { display: block; width: 12.5%; height: 1px; background: var(--acid); transition: width 180ms ease; }

noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 2rem; background: var(--ink); color: var(--paper); }

@keyframes slide-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 700px) {
  .identity span:last-child { display: none; }
  .nav-chip { padding-inline: 12px; }
  .restart { width: 48px; overflow: hidden; color: transparent; position: relative; }
  .restart::after { content: "↺"; color: var(--paper); position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; }
  .control-button { min-width: 52px; }
  .control-button span { display: none; }
  .slide-frame { width: 100%; }
}

@media (orientation: portrait) {
  .app-shell { gap: 12px; }
  .deck { align-items: center; }
  .slide-frame { width: 100%; }
}

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