:root {
  --bg: #0e0e0e;
  --panel: #181818;
  --ink: #f2f2f2;
  --mid: #9a9a9a;
  --dim: #555;
  --line: #2c2c2c;
  --red: #e03131;
  --red-dim: #7a1f1f;
  --blue: #3d7bff;
  --blue-dim: #24479c;
  --green: #2fbf71;
  --green-dim: #1a6b40;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-optical-sizing: auto;
  overflow: hidden;
}

/* ---------- deck ---------- */
#deck { height: 100vh; position: relative; }

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 5rem 6rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(40px);
  transition: opacity .45s ease, transform .45s ease, visibility 0s .45s;
  overflow-y: auto;
}
.slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: opacity .45s ease, transform .45s ease, visibility 0s 0s;
}
.slide.exit-left { transform: translateX(-40px); }

.slide-inner { max-width: 960px; width: 100%; }

/* ---------- type ---------- */
.kicker {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.2rem;
}

h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.03em;
  margin-bottom: 1.6rem;
}
h1 em { font-style: normal; color: var(--red); }

h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.02em;
  margin-bottom: 1.2rem;
}
h2 em { font-style: italic; color: var(--red); }

h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; color: var(--ink); }

.lede { font-size: 1.15rem; color: var(--mid); line-height: 1.6; max-width: 40em; margin-bottom: 2rem; }
.prose { font-size: 1.05rem; color: var(--mid); line-height: 1.7; max-width: 44em; margin: 1rem 0 1.5rem; }
.prose strong, .lede strong { color: var(--ink); }
.hint { font-size: .85rem; color: var(--dim); margin-bottom: 2.5rem; }
kbd {
  font-family: 'Inter', sans-serif;
  border: 1px solid var(--dim);
  padding: .1em .45em;
  font-size: .8em;
  color: var(--mid);
}
.red { color: var(--red); }

blockquote {
  border-left: 3px solid var(--red);
  padding: .4rem 0 .4rem 1.4rem;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink);
  max-width: 44em;
  margin: 2rem 0 1.5rem;
}
blockquote span { display: block; margin-top: .8rem; font-size: .82rem; color: var(--dim); }
blockquote.final { font-size: 1.35rem; font-weight: 500; }
.strike { text-decoration: line-through; color: var(--mid); }

.source {
  display: inline-block;
  margin-top: 1rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--mid);
  text-decoration: none;
  border-bottom: 1px solid var(--dim);
  padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}
.source:hover { color: var(--red); border-color: var(--red); }

/* ---------- layout helpers ---------- */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin: 1.5rem 0; }
.col p { color: var(--mid); line-height: 1.65; font-size: 1rem; }
.col p strong { color: var(--ink); }
.big-num {
  font-size: 3.2rem;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
  margin-bottom: .6rem;
}

.cases { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 2rem; margin: 1.5rem 0; }
.case { border-top: 1px solid var(--line); padding-top: .9rem; }
.case-num { font-size: .75rem; font-weight: 700; color: var(--red); letter-spacing: .1em; }
.case p { margin-top: .4rem; color: var(--mid); font-size: .95rem; line-height: 1.6; }
.case p strong { color: var(--ink); }

/* ---------- viz ---------- */
.viz-slide .viz-caption { font-size: 1rem; color: var(--mid); line-height: 1.6; max-width: 48em; margin-bottom: 1.2rem; }
.viz-caption strong { color: var(--ink); }
.viz-caption strong.red { color: var(--red); }

.viz-wrap { border: 1px solid var(--line); background: var(--panel); }
.viz-wrap canvas { display: block; width: 100%; height: 340px; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2.2rem;
  align-items: center;
  padding: .9rem 1.2rem;
  border-top: 1px solid var(--line);
}
.controls label {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.readout { color: var(--red); font-variant-numeric: tabular-nums; min-width: 3.2em; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 2px;
  background: var(--dim);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  background: var(--red);
  border: none;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--red);
  border: none;
  cursor: pointer;
}
.toggle input { accent-color: var(--red); width: 14px; height: 14px; }

.btn {
  font-family: 'Inter', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: none;
  color: var(--ink);
  border: 1px solid var(--dim);
  padding: .5rem 1rem;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn:hover { border-color: var(--red); color: var(--red); }

/* ---------- nav ---------- */
#nav {
  position: fixed;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  z-index: 10;
}
#nav button {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  background: none;
  border: 1px solid var(--line);
  color: var(--mid);
  width: 2.4rem;
  height: 2.4rem;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
#nav button:hover { color: var(--red); border-color: var(--red); }
#dots { display: flex; gap: .5rem; }
.dot {
  width: 7px; height: 7px;
  background: var(--dim);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.dot.active { background: var(--red); transform: scale(1.3); }

#progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--line); z-index: 10; }
#progress-bar { height: 100%; width: 0; background: var(--red); transition: width .45s ease; }

/* ---------- Q&A section: blue accent ---------- */
.blue { color: var(--blue); }
.slide.qa .kicker { color: var(--blue); }
.slide.qa h1 em, .slide.qa h2 em { color: var(--blue); }
.slide.qa blockquote { border-left-color: var(--blue); }
.slide.qa .big-num { color: var(--blue); }
.slide.qa .case-num { color: var(--blue); }
.slide.qa .readout { color: var(--blue); }
.slide.qa .source { margin-right: 1.6rem; }
.slide.qa .source:hover { color: var(--blue); border-color: var(--blue); }
.slide.qa .viz-caption strong.blue { color: var(--blue); }
.slide.qa input[type="range"]::-webkit-slider-thumb { background: var(--blue); }
.slide.qa input[type="range"]::-moz-range-thumb { background: var(--blue); }
.slide.qa .toggle input { accent-color: var(--blue); }
.slide.qa .btn:hover { border-color: var(--blue); color: var(--blue); }
.slide.qa.slide .viz-wrap canvas { height: 255px; }
.slide.qa h2 { font-size: clamp(1.5rem, 3.2vw, 2.2rem); }
.slide.qa .viz-caption { font-size: .95rem; }
body.qa-active .dot.active { background: var(--blue); }
body.qa-active #progress-bar { background: var(--blue); }
body.qa-active #nav button:hover { color: var(--blue); border-color: var(--blue); }

/* ---------- Critiques section: green accent ---------- */
.green { color: var(--green); }
.slide.cc .kicker { color: var(--green); }
.slide.cc h1 em, .slide.cc h2 em { color: var(--green); }
.slide.cc blockquote { border-left-color: var(--green); }
.slide.cc .big-num { color: var(--green); }
.slide.cc .case-num { color: var(--green); }
.slide.cc .readout { color: var(--green); }
.slide.cc .source { margin-right: 1.6rem; }
.slide.cc .source:hover { color: var(--green); border-color: var(--green); }
.slide.cc .viz-caption strong.green { color: var(--green); }
.slide.cc input[type="range"]::-webkit-slider-thumb { background: var(--green); }
.slide.cc input[type="range"]::-moz-range-thumb { background: var(--green); }
.slide.cc .toggle input { accent-color: var(--green); }
.slide.cc .btn:hover { border-color: var(--green); color: var(--green); }
.slide.cc.slide .viz-wrap canvas { height: 255px; }
.slide.cc h2 { font-size: clamp(1.5rem, 3.2vw, 2.2rem); }
.slide.cc .viz-caption { font-size: .95rem; }
body.cc-active .dot.active { background: var(--green); }
body.cc-active #progress-bar { background: var(--green); }
body.cc-active #nav button:hover { color: var(--green); border-color: var(--green); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .slide { padding: 2.5rem 1.4rem 6rem; align-items: flex-start; }
  .cols, .cases { grid-template-columns: 1fr; gap: 1.4rem; }
  .viz-wrap canvas { height: 240px; }
  input[type="range"] { width: 120px; }
}
