/* ── design tokens ──────────────────────────────────────────────── */
:root {
  --fg: #1a1a1a;
  --bg: #ffffff;
  --muted: #6b7280;
  --accent: #1d4ed8;
  --in-cache: #15803d;    /* green — cache-resident */
  --in-cache-bg: #dcfce7; /* light-green fill for cache-resident tables */
  --dram: #b91c1c;        /* red — DRAM spill */
}

/* ── viewport ───────────────────────────────────────────────────── */
.reveal-viewport { background: var(--bg); }

/* ── base type ──────────────────────────────────────────────────── */
.reveal {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 22px;
  color: var(--fg);
  line-height: 1.45;
}

/* ── slide layout ───────────────────────────────────────────────── */
/* center: false in deck.js; top-aligned with breathing room */
.reveal .slides section {
  text-align: left;
  padding: 38px 56px 48px;
  box-sizing: border-box;
}

/* ── typographic scale ──────────────────────────────────────────── */
.reveal h1,
.reveal h2,
.reveal h3 {
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.reveal h1 {
  font-size: 2em;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

.reveal h2 {
  font-size: 1.45em;
  font-weight: 650;
  line-height: 1.2;
  margin: 0 0 0.3em;
}

.reveal h3 {
  font-size: 1.1em;
  font-weight: 650;
  line-height: 1.25;
  margin: 0 0 0.3em;
}

.reveal p {
  margin: 0 0 0.4em;
  line-height: 1.5;
}

/* ── inline code labels ─────────────────────────────────────────── */
/* used on-slide for compact phase/option labels */
.reveal code {
  font-family: ui-monospace, "Cascadia Code", "Fira Code", "Consolas", monospace;
  font-size: 0.82em;
  background: #f1f5f9;
  color: var(--fg);
  border-radius: 4px;
  padding: 0.06em 0.38em;
  white-space: nowrap;
}

/* ── muted text ─────────────────────────────────────────────────── */
.reveal .muted { color: var(--muted); }

/* ── example input-table (measure slide) ───────────────────────── */
.reveal table.example {
  font-size: 0.8em;
  border-collapse: collapse;
  margin: 0.6em 0 0.4em;
}
.reveal table.example th,
.reveal table.example td {
  border: 1px solid #cbd5e1;
  padding: 0.22em 1.1em;
  text-align: right;
}
.reveal table.example th {
  color: var(--muted);
  font-weight: 600;
  background: #f8fafc;
}

/* ── card layout (slides: cases, open-work) ────────────────────── */
.reveal .card-row {
  display: flex;
  gap: 1em;
  margin: 0.75em 0 0.4em;
  align-items: stretch;
}

.reveal .card-row .card { flex: 1; }

.reveal .card {
  position: relative;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.7em 0.85em;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

.reveal .card-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--muted);
}

/* override reveal's default p margin inside cards */
.reveal .card .card-title,
.reveal .card .card-note {
  margin: 0;
  line-height: 1.3;
}

.reveal .card .card-title {
  font-size: 0.88em;
  font-weight: 650;
  color: var(--fg);
}

.reveal .card .card-note {
  font-size: 0.72em;
  color: var(--muted);
}

/* focus variant — accent border + tinted bg */
.reveal .card.card-focus {
  border-color: var(--accent);
  background: #eff6ff;
}
.reveal .card.card-focus .card-title { color: var(--accent); }
.reveal .card.card-focus .card-icon  { color: var(--accent); }

/* muted variant */
.reveal .card.card-muted { opacity: 0.62; }

/* "focus" badge — top-right corner */
.reveal .card-focus-tag {
  position: absolute;
  top: 0.45em;
  right: 0.6em;
  font-size: 0.58em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0.08em 0.4em;
  line-height: 1.5;
}

/* caption below a card-row */
.reveal .card-caption {
  font-size: 0.8em;
  color: var(--muted);
  margin: 0.15em 0 0;
}

/* cases slide — larger card-row cards for projection legibility */
.reveal .card-row .card {
  padding: 1.4em 1.6em;
  gap: 0.55em;
}
.reveal .card-row .card-icon {
  width: 52px;
  height: 52px;
}
.reveal .card-row .card .card-title {
  font-size: 1.1em;
}
.reveal .card-row .card .card-note {
  font-size: 0.88em;
}

/* measure slide — example table beside the condition cards, centered to fill */
.reveal .measure-body {
  display: flex;
  align-items: center;
  gap: 2.4em;
  min-height: 490px;
  margin-top: 0.4em;
}
.reveal .measure-body table.example {
  flex-shrink: 0;
  font-size: 1.5em;
  margin: 0;
}
.reveal .measure-body .card-row {
  flex: 1;
  margin: 0;
  gap: 1.3em;
}
.reveal .measure-body .card-row .card {
  min-height: 12.5em;
  justify-content: center;
  gap: 1.1em;
}
.reveal .measure-body .card-row .card-icon {
  width: 82px;
  height: 82px;
}
.reveal .measure-body .card-row .card .card-title {
  font-size: 1.15em;
  white-space: nowrap;
}

/* cases slide — tall icon+title+note cards, vertically centered to fill the canvas */
.reveal .cases-body {
  display: flex;
  align-items: center;
  min-height: 520px;
  margin-top: 1.2em;
}
.reveal .cases-body .card-row {
  flex: 1;
  margin: 0;
  gap: 1.3em;
}
.reveal .cases-body .card-row .card {
  min-height: 15.5em;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1.4em;
}
.reveal .cases-body .card-row .card-icon {
  width: 82px;
  height: 82px;
}
.reveal .cases-body .card-row .card .card-title {
  font-size: 1.4em;
}

/* supports slide — tall icon+title cards, vertically centered to fill the canvas */
.reveal .supports-body {
  display: flex;
  align-items: center;
  min-height: 520px;
  margin-top: 1.2em;
}
.reveal .supports-body .card-row {
  flex: 1;
  margin: 0;
  gap: 1.3em;
}
.reveal .supports-body .card-row .card {
  min-height: 15.5em;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1.4em;
}
.reveal .supports-body .card-row .card-icon {
  width: 82px;
  height: 82px;
}
.reveal .supports-body .card-row .card .card-title {
  font-size: 1.4em;
}

/* ── open-work slide: open questions + roadmap ─────────────────── */
.reveal .open-work {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.4em;
  margin-top: 0.6em;
  align-items: start;
}
.reveal .open-work h3 {
  font-size: 0.82em;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 0 0 0.75em;
}

/* open questions — 2×2 grid of icon+title cards (no notes) */
.reveal .ow-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 0.8em;
}

/* roadmap — ordered steps on a vertical rail */
.reveal .roadmap {
  list-style: none;
  position: relative;
  margin: 0;
  padding: 0;
}
.reveal .roadmap::before {
  content: "";
  position: absolute;
  left: 0.42em;
  top: 0.5em;
  bottom: 0.5em;
  width: 2px;
  background: #d1d5db;
}
.reveal .roadmap li {
  position: relative;
  padding: 0 0 0 1.8em;
  margin: 0 0 0.95em;
  line-height: 1.3;
}
.reveal .roadmap li:last-child { margin-bottom: 0; }

/* step marker — hollow gray dot by default (future steps) */
.reveal .roadmap li::before {
  content: "";
  position: absolute;
  left: 0.1em;
  top: 0.22em;
  width: 0.66em;
  height: 0.66em;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid #cbd5e1;
  box-sizing: border-box;
}
/* completed step — filled green node */
.reveal .roadmap li.done::before {
  background: var(--in-cache);
  border-color: var(--in-cache);
}
/* current step — accent node with halo */
.reveal .roadmap li.next::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #dbeafe;
}

.reveal .roadmap .rm-step { font-weight: 600; color: var(--fg); }
.reveal .roadmap li.done  .rm-step { color: var(--muted); font-weight: 500; }
.reveal .roadmap .rm-note { color: var(--muted); font-weight: 400; }

/* "next" chip — mirrors the card focus-tag idiom */
.reveal .roadmap .rm-tag {
  margin-left: 0.55em;
  font-size: 0.58em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0.08em 0.4em;
  vertical-align: 0.12em;
  white-space: nowrap;
}

/* ── title / closing card (shared bookend) ─────────────────────── */
/* The opening and closing slides use identical markup + this layout:
   text column on the left, a thesis emblem on the right. The emblem
   restates the deck's argument in its own schematic language — a single
   table spilling past the L2 line vs. partitions that stay cache-resident. */
/* reveal sets `display:block` inline on the active section — override it */
.reveal .slides section.title-slide {
  display: flex !important;
  align-items: center;
  height: 100%;
  padding: 2em 3.2em;
}

.title-card {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  align-items: center;
  gap: 2.5em;
  width: 100%;
}

.title-lede { min-width: 0; }

.title-eyebrow {
  font-size: 0.74em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 0 0 1em;
}

.reveal .title-card h1 {
  font-size: 2.6em;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.022em;
  margin: 0;
  max-width: 13ch;
}

.title-rule {
  width: 3em;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0.85em 0;
}

.title-sub {
  font-size: 1.02em;
  color: var(--muted);
  line-height: 1.45;
  max-width: 26ch;
  margin: 0 0 1.9em;
}

.title-authors {
  font-size: 0.9em;
  color: var(--fg);
  line-height: 1.5;
  margin: 0;
}

.title-emblem {
  width: 100%;
  max-width: 620px;
  height: auto;
  justify-self: center;
}

/* ── fixed footer ───────────────────────────────────────────────── */
/* rendered once inside .reveal, outside .slides */
.deck-footer {
  position: fixed;
  bottom: 8px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--muted);
  pointer-events: none;
  z-index: 30;
}
