:root {
  --surface: #171c2a;
  --midnight: #101523;
  --accent-surface: #1d2847;
  --ink: #f1f3fa;
  --muted: #b9c2d8;
  --blue: #a9b9ff;
  --line: #434e69;
  --wire: #8a9bbf;
  --body-font: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono-font: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--body-font);
  color: var(--ink);
  background: var(--midnight);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
button, a { touch-action: manipulation; }
a { color: inherit; text-underline-offset: 0.18em; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #ffd278; outline-offset: 5px; }
[hidden] { display: none !important; }

.slide {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: clamp(2.25rem, 5vh, 4rem) clamp(1.25rem, 7vw, 8rem);
  background: var(--surface);
  outline: none;
}
.presenting .slide { min-height: calc(100svh - 3.5rem); }
.content { width: min(100%, 72rem); margin-inline: auto; }
.title-slide { background: var(--midnight); }
.audience-question, .closing { background: var(--accent-surface); }
h2 {
  font-size: clamp(2.55rem, 5.9vw, 6.1rem);
  font-weight: 700;
  line-height: 1.01;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.title-slide h1 {
  text-align: center;
  font-size: clamp(4.75rem, 15vw, 13.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.025em;
  padding-inline-start: 0.025em;
}
.title-slide h1 span {
  color: var(--blue);
}
@supports (-webkit-text-stroke: 1px currentColor) {
  .title-slide h1 span {
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: max(2px, 0.016em) currentColor;
  }
}
@media (forced-colors: active) {
  .title-slide h1 span {
    -webkit-text-fill-color: currentColor;
    -webkit-text-stroke: 0;
  }
}

.expansions {
  margin-top: clamp(1.7rem, 4vh, 3rem);
  display: grid;
  gap: 0.26em;
  font-size: clamp(1.3rem, 4vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.13;
}
.domain-expansion { position: relative; display: inline-block; }
.domain-strike {
  position: absolute;
  inset: 52% -0.015em auto;
  height: 0.075em;
  border-radius: 0.08em;
  background: #ff817d;
  transform-origin: left;
  transform: scaleX(1);
  transition: transform 260ms ease;
}
.presenting .domain-strike.pending { transform: scaleX(0); }
.opening:is([data-stage="2"], [data-stage="3"]) .domain-expansion { color: var(--muted); }
.data-expansion { color: var(--blue); }
.opening[data-stage="3"] .data-expansion { animation: appear 260ms ease both; }

.presenting [data-reveal].pending { visibility: hidden; }
[data-stage="1"] [data-reveal="1"] { animation: appear 260ms ease both; }
@keyframes appear {
  from { opacity: 0; transform: translateY(0.25em); }
  to { opacity: 1; transform: translateY(0); }
}

.definition-copy {
  max-width: 35ch;
  margin-top: 0.8em;
  font-size: clamp(1.35rem, 3.1vw, 3rem);
  font-weight: 510;
  line-height: 1.22;
  letter-spacing: -0.035em;
}
.quotation {
  max-width: 47rem;
  margin-top: clamp(2rem, 6vh, 5rem);
  padding: 0.1em 0 0.1em 1.05em;
  border-left: 0.25rem solid var(--blue);
  font-size: clamp(1.1rem, 2.2vw, 2rem);
  line-height: 1.36;
}
.quotation blockquote { font-weight: 640; }
.quotation figcaption { margin-top: 0.8em; color: var(--muted); font-size: 0.62em; }

.system h2, .gap-reasons h2, .report h2 { font-size: clamp(2.35rem, 4.5vw, 4.55rem); }
.system-flow {
  display: grid;
  grid-template-areas: "contracts join output" "telemetry join output";
  grid-template-columns: minmax(0, 1.55fr) clamp(1.8rem, 5vw, 3.7rem) minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  row-gap: 0.85rem;
  margin-top: clamp(1.6rem, 5vh, 3.75rem);
}
.diagram-lane {
  display: grid;
  align-content: center;
  padding: clamp(0.72rem, 1.5vw, 1.25rem);
  border: 1px solid var(--line);
  border-radius: 0.72rem;
  background: #1e2639;
}
.contract-lane { grid-area: contracts; }
.telemetry-lane { grid-area: telemetry; background: #202b46; }
.diagram-lane h3 {
  margin-bottom: 0.7rem;
  color: var(--blue);
  font-size: clamp(0.85rem, 1.3vw, 1.15rem);
}
.contract-lane h3 { color: var(--muted); }
.diagram-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.telemetry-lane .diagram-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.diagram-node {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.25rem;
  font-size: clamp(0.82rem, 1.42vw, 1.3rem);
  line-height: 1.2;
}
.diagram-node span {
  color: var(--muted);
  font-size: clamp(0.76rem, 1.15vw, 1rem);
  line-height: 1.3;
}
.telemetry-lane .diagram-node:not(:last-child)::after,
.diagram-join span {
  position: absolute;
  width: 0.37rem;
  height: 0.37rem;
  border: solid var(--wire);
  border-width: 1px 1px 0 0;
  content: "";
  transform: rotate(45deg);
}
.telemetry-lane .diagram-node:not(:last-child)::after {
  top: 0.38em;
  left: calc(100% + 0.39rem);
}
.diagram-join {
  position: relative;
  grid-area: join;
  color: var(--wire);
}
.diagram-join::before,
.diagram-join::after {
  position: absolute;
  border: solid currentColor;
  content: "";
}
.diagram-join::before {
  inset: 25% 50% 25% 0;
  border-width: 1px 1px 1px 0;
  border-radius: 0 0.35rem 0.35rem 0;
}
.diagram-join::after {
  inset: 50% 0.14rem auto 50%;
  border-width: 1px 0 0;
}
.diagram-join span {
  top: calc(50% - 0.15rem);
  right: 0.15rem;
}
.diagram-output {
  display: grid;
  grid-area: output;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
}
.diagram-output .diagram-node {
  min-height: 5.8rem;
  align-content: center;
  padding: clamp(0.64rem, 1.2vw, 1.1rem);
  border: 1px solid #536084;
  border-radius: 0.72rem;
  background: #242e48;
}
.diagram-output .result {
  border-color: #7187e2;
  background: #2b3c70;
}
.result span { color: var(--ink); }
.output-arrow { color: var(--wire); }

.audience-question h2, .closing h2 { max-width: 17ch; text-wrap: initial; }
.audience-question p, .closing p { margin-top: 1.1em; font-size: clamp(1.2rem, 3vw, 2.8rem); line-height: 1.13; color: var(--muted); }
.reason-list {
  max-width: 63rem;
  margin: clamp(1.15rem, 3.5vh, 2.3rem) 0 0;
  border-top: 2px solid var(--line);
}
.reason-list div {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) 2.35fr;
  gap: 0.95rem;
  align-items: baseline;
  padding: clamp(0.46rem, 1.55vh, 0.95rem) 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(0.96rem, 2vw, 1.6rem);
  line-height: 1.22;
}
.reason-list dt { font-weight: 700; }
.reason-list dd { margin: 0; color: var(--muted); }

.report-excerpt {
  margin-top: clamp(1.15rem, 3.5vh, 2.3rem);
  border-top: 2px solid var(--line);
  max-width: 63rem;
}
.report-excerpt figcaption {
  margin-top: 0.65em;
  color: var(--muted);
  font-size: clamp(0.83rem, 1.52vw, 1.15rem);
  font-weight: 640;
}
.report-summary { display: flex; flex-wrap: wrap; gap: 0.15rem 1rem; align-items: baseline; margin-block: 0.36rem 0.62rem; }
.report-summary strong { color: var(--blue); font-size: clamp(2.1rem, 6vw, 5.15rem); line-height: 1.04; letter-spacing: -0.06em; }
.report-summary span { font-size: clamp(0.95rem, 2vw, 1.8rem); }
.report table { width: 100%; border-collapse: collapse; font-size: clamp(0.82rem, 1.7vw, 1.42rem); text-align: left; }
.report th, .report td { padding: 0.52em 0.4em 0.52em 0; border-bottom: 1px solid var(--line); }
.report thead { color: var(--muted); font-size: 0.78em; }
.report th[scope="row"] { font-weight: 650; }
.report td { padding-left: 0.55em; }
.report code { font-family: var(--mono-font); overflow-wrap: anywhere; }
.evidence-observed { color: #84ddb4; font-weight: 740; }
.evidence-gap { color: #ffbe88; font-weight: 740; }
.report-link { display: inline-block; margin-top: 1.3em; font-size: clamp(1rem, 1.8vw, 1.4rem); font-weight: 720; color: var(--blue); }
.controls {
  min-height: 3.5rem;
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.34rem clamp(0.65rem, 3vw, 2rem);
  background: var(--midnight);
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.86rem;
}
.nav-buttons { display: flex; align-items: center; gap: 0.26rem; }
.controls button {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.3rem 0.65rem;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.nav-buttons button { font-size: 1.3rem; }
.controls button:disabled { opacity: 0.4; cursor: default; }
.controls button:enabled:hover { background: #36405f; }
#counter { padding-left: 0.55rem; font: 0.76rem var(--mono-font); color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 820px) {
  .system-flow {
    grid-template-areas: "contracts" "telemetry" "join" "output";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    row-gap: 0.55rem;
  }
  .diagram-join { height: 0.8rem; }
  .diagram-join::before { display: none; }
  .diagram-join::after { inset: 0 auto 0 50%; border-width: 0 0 0 1px; }
  .diagram-join span { inset: auto auto 0 calc(50% - 0.16rem); transform: rotate(135deg); }
  .diagram-output .diagram-node { min-height: 0; }
}

@media (max-width: 650px) {
  .slide { padding-inline: 1.15rem; }
  .gap-reasons { padding-block: 1.75rem; }
  .reason-list div { grid-template-columns: 1fr; gap: 0.2rem; }
}

@media (max-width: 450px) {
  .system { padding-block: 1.25rem; }
  .system-flow { margin-top: 1rem; }
  .telemetry-lane .diagram-steps { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .telemetry-lane .diagram-node { grid-template-columns: minmax(6.6rem, 0.85fr) 1fr; align-items: baseline; }
  .telemetry-lane .diagram-node:not(:last-child)::after { display: none; }
}

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

@media print {
  .slide[hidden] { display: grid !important; }
  .presenting [data-reveal].pending { visibility: visible; }
  .presenting .domain-strike.pending { transform: scaleX(1); }
  .controls { display: none !important; }
  .slide { break-after: page; print-color-adjust: exact; }
  .slide:last-child { break-after: auto; }
}
