/* deck.css — "Open Source for LLM Post-Training" deck
   Same engine as the strands-env deck (/assets/js/slides.js, fixed
   1920×1080 canvas), own look: sans display, cool neutrals, one accent.

   ── FONT-SIZE RULE ──────────────────────────────────────
   HARD floor: 18px for any text on any slide.
   Body / labels:   ≥ 22px (comfortable for projection)
   ──────────────────────────────────────────────────────── */

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

/* ── Tokens ─────────────────────────────────────────── */

:root {
  --bg: #ffffff;
  --ink: #232f3e;
  --muted: #5e6573;
  --faint: #9aa1ad;
  --rule: #e4e7ec;
  --surface: #f4f6f9;
  --bad: #d63f3f;
  --good: #1f9d61;
  --stage: #1b1d22;
  /* Amazon orange is only 2:1 on white, so it fills shapes; small text
     takes the darker orange amazon.com uses for links. */
  --accent: #ff9900;
  --accent-rgb: 255, 153, 0;
  --accent-ink: #c45500;
  --font-display: "Geist", system-ui, sans-serif;
  --font-body: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
}

html,
body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--stage);
  -webkit-font-smoothing: antialiased;
}

/* ── Slide viewport ─────────────────────────────────── */

.deck {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--stage);
}

.slide {
  position: absolute;
  width: 1920px;
  height: 1080px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide-inner {
  width: 100%;
  height: 100%;
  padding: 120px 160px;
  display: flex;
  flex-direction: column;
}

/* ── Type ───────────────────────────────────────────── */

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

h1 { font-size: 120px; }
h2 { font-size: 64px; margin-bottom: 40px; }

p,
li {
  font-size: 36px;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

.accent { color: var(--accent-ink); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.nw { white-space: nowrap; }

/* ── Fragments ──────────────────────────────────────── */

.frag {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.frag.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .slide, .frag { transition: none; }
}

/* ── Title: the title as the model reads it ─────────── */

.slide--title .slide-inner {
  justify-content: center;
}

.title-tokens {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: flex-start;
}

.tok {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
}

.tok-t {
  display: block;
  font-family: var(--font-display);
  font-size: 74px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  padding: 16px 12px 18px;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.14);
  white-space: pre;
}

.tok:nth-child(even) .tok-t {
  background: rgba(var(--accent-rgb), 0.28);
}

/* A leading space belongs to its token; show it, quietly */
.sp {
  display: inline-block;
  width: 0.28em;
  height: 0.08em;
  margin-right: 0.04em;
  vertical-align: -0.02em;
  border-radius: 2px;
  background: rgba(var(--accent-rgb), 0.45);
}

.tok-id {
  margin-top: 10px;
  padding-left: 12px;
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.tok-caption {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--muted);
}

.tok-caption::before {
  content: "↑ ";
  color: var(--accent-ink);
}

.title-q {
  margin-top: 72px;
}

.slide--title .author {
  margin-top: 96px;
}

.author-name {
  font-size: 32px;
  font-weight: 600;
}

.author-role {
  margin-top: 6px;
  font-size: 26px;
  color: var(--muted);
}

/* ── The question ───────────────────────────────────── */

.slide--question .slide-inner {
  justify-content: center;
}

.q-context {
  font-size: 32px;
  color: var(--muted);
  margin-bottom: 28px;
}

.q-ask {
  font-size: 76px;
  margin-bottom: 56px;
}

.q-spec {
  display: grid;
  grid-template-columns: 170px 1fr;
  row-gap: 14px;
  align-items: baseline;
  margin-bottom: 56px;
  font-size: 28px;
}

.q-spec dt {
  font-weight: 600;
  color: var(--muted);
}

.q-spec dd.mono {
  font-size: 27px;
}

.q-spec strong {
  font-weight: 600;
}

.q-cols {
  display: grid;
  grid-template-columns: 0.8fr 1.1fr 1.1fr;
  gap: 56px;
}

.q-col {
  padding-top: 20px;
  border-top: 3px solid var(--accent);
}

.q-head {
  font-size: 28px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.q-num {
  font-family: var(--font-display);
  font-size: 76px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  margin-bottom: 20px;
}

.q-unit {
  margin-left: 14px;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.q-rows {
  list-style: none;
}

.q-rows li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 25px;
  line-height: 1.3;
  margin: 0;
}

.q-n {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Synthesized by us, as opposed to taken from a public release */
.q-syn {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 19px;
  vertical-align: 2px;
}

.q-foot .q-syn {
  margin: 0 6px 0 0;
  vertical-align: 1px;
}

/* ── Result: pipeline strip + paired bars ───────────── */

.slide--result .slide-inner {
  padding-top: 100px;
  padding-bottom: 80px;
}

.slide--result h2 {
  font-size: 60px;
  margin-bottom: 56px;
}

.bars-legend {
  display: flex;
  gap: 40px;
  margin-bottom: 20px;
  font-size: 22px;
  color: var(--muted);
}

.lg {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sw {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

/* Context models in three grays; only Rufus-Air takes the accent */
.bar--glm { background: #b8bec8; }
.bar--intellect { background: #858e9c; }
.bar--nemotron { background: #4e5765; }
.bar--ours { background: #f29100; }

.lg-note {
  color: var(--faint);
}

/* Columns on a 0–100 pass@1 scale, one shared baseline */
.bars {
  --h: 460px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  column-gap: 28px;
}

.bg {
  display: flex;
  flex-direction: column;
}

.pair {
  height: var(--h);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 24px;
  border-bottom: 1px solid var(--rule);
}

.bar {
  position: relative;
  width: 24px;
  height: calc(var(--h) * var(--v) / 100);
  border-radius: 4px 4px 0 0;
}

.bar b {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding-bottom: 6px;
  font-size: 18px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bar--ours b {
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
}

.bg p {
  order: 2;
  margin-top: 14px;
  min-height: 2.6em;
  text-align: center;
  font-size: 21px;
  line-height: 1.25;
  color: var(--ink);
}

/* Footnotes sit at the same spot on every slide */
.footnote-l {
  position: absolute;
  left: 160px;
  right: 160px;
  bottom: 48px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--muted);
}

.footnote-l a.paper {
  color: var(--ink);
  border-bottom: 1px solid var(--faint);
}

.footnote-l a.paper:hover {
  color: var(--accent-ink);
  border-color: var(--accent-ink);
}

/* ── Rufus-Gym: open parts in gray, our layer in accent ─ */

.slide--gym .slide-inner {
  justify-content: center;
}

.slide--gym h2 {
  margin-bottom: 14px;
}

.gym-sub {
  font-size: 30px;
  color: var(--muted);
  margin-bottom: 44px;
}

.gym-layer {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
}

.gym-layer-l {
  flex: none;
  width: 170px;
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--muted);
}

.gym-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gym-chips li {
  margin: 0;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 24px;
}

.gym-chips .gym-chip-more {
  padding: 8px 4px;
  background: none;
  color: var(--muted);
}

.gym-box {
  padding: 24px 32px 28px;
  border: 3px solid var(--accent);
  border-radius: 16px;
  background: rgba(var(--accent-rgb), 0.06);
}

.gym-box-t {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 18px;
}

.gym-box-s {
  margin-left: 12px;
  font-size: 24px;
  font-weight: 400;
  color: var(--muted);
}

.gym-feats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.gym-feats > div {
  padding: 16px 20px;
  border-radius: 10px;
  background: var(--bg);
}

.gf-t {
  font-size: 25px;
  font-weight: 600;
  margin-bottom: 4px;
}

.gf-d {
  font-size: 21px;
  line-height: 1.4;
  color: var(--muted);
}

/* ── Stages: one row per stage, reward from hard to soft ─ */

.st-sub {
  font-size: 28px;
  color: var(--muted);
  margin: -20px 0 44px;
  max-width: 1500px;
}

.st-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 25px;
}

.st-table th {
  text-align: left;
  font-size: 21px;
  font-weight: 500;
  color: var(--muted);
  padding: 0 16px 12px;
  border-bottom: 2px solid var(--ink);
}

.slide--stages .slide-inner {
  padding-top: 100px;
  padding-bottom: 72px;
}

.st-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.st-table td:nth-child(2) {
  font-weight: 600;
}

.st-table td:nth-child(3) {
  color: var(--muted);
}

.st-note {
  margin-top: 24px;
  font-size: 26px;
  line-height: 1.45;
  max-width: 1500px;
}

.st-i {
  width: 40px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* Reward kind: one hue, strongest where the reward is hardest */
.rw {
  display: inline-block;
  min-width: 168px;
  margin-right: 14px;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 19px;
  text-align: center;
  color: var(--ink);
}

.rw--tok { background: var(--surface); color: var(--muted); }
.rw--rule { background: rgba(var(--accent-rgb), 0.85); }
.rw--hybrid { background: rgba(var(--accent-rgb), 0.5); }
.rw--rm { background: rgba(var(--accent-rgb), 0.14); }

/* ── Details: detail → consequence → what we do ─────── */

.slide--details .slide-inner {
  justify-content: center;
}

.dt-sub {
  font-size: 30px;
  color: var(--muted);
  margin: -24px 0 40px;
}

.dt-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}


.dt-table th {
  text-align: left;
  font-size: 21px;
  font-weight: 500;
  color: var(--muted);
  padding: 0 20px 12px 0;
  border-bottom: 2px solid var(--ink);
}

.dt-table th:nth-child(1) { width: 25%; }
.dt-table th:nth-child(2) { width: 43%; }

.dt-table td {
  padding: 18px 20px 18px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  font-size: 24px;
  line-height: 1.4;
}

.dt-table td:nth-child(1) {
  font-weight: 600;
}

.dt-table td:nth-child(2) {
  color: var(--muted);
}

.dt-more {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
}

.dt-more-l {
  font-size: 24px;
  color: var(--muted);
}

.dt-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dt-chips li {
  margin: 0;
  padding: 6px 16px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 22px;
  color: var(--muted);
}

.dt-table code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface);
}

/* ── tokin: text on the left, token ids on the right ── */

.slide--tokin .slide-inner {
  justify-content: center;
}

.slide--tokin h2 {
  margin-bottom: 14px;
}

.tk-sub {
  font-size: 30px;
  color: var(--muted);
  margin-bottom: 48px;
}

.tk-flow {
  display: grid;
  grid-template-columns: 280px 1fr 530px 1fr 280px;
  grid-template-rows: auto auto auto;
  align-items: center;
  margin-bottom: 40px;
}

.tk-flow > .tk-side,
.tk-flow > .tk-link,
.tk-flow > .tk-core,
.tk-flow > .tk-engine {
  grid-row: 1;
}

.tk-down {
  grid-row: 2;
  grid-column: 3;
  position: relative;
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.tk-down svg {
  flex: none;
  width: 12px;
  height: 44px;
}

.tk-down .tk-link-b {
  position: absolute;
  left: calc(50% + 24px);
  top: 50%;
  transform: translateY(-50%);
}

.tk-down line {
  stroke: var(--faint);
  stroke-width: 2;
}

.tk-down path {
  fill: var(--faint);
}

.tk-trainer {
  grid-row: 3;
  grid-column: 3;
}

.tk-side-l,
.tk-node-l {
  font-family: var(--font-mono);
  font-size: 19px;
  color: var(--muted);
  margin-bottom: 12px;
}

.tk-chips {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tk-chips li {
  margin: 0;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 24px;
}

.tk-chips .tk-chip-you {
  background: none;
  border: 1.5px dashed var(--faint);
  color: var(--muted);
}

.tk-link {
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tk-link svg {
  width: 100%;
  height: 24px;
  margin: 10px 0;
}

.tk-link line {
  stroke: var(--faint);
  stroke-width: 2;
}

.tk-link path {
  fill: var(--faint);
}

.tk-link-t,
.tk-link-b {
  font-family: var(--font-mono);
  font-size: 19px;
  color: var(--muted);
  white-space: nowrap;
}

/* The token side reuses the title slide's chips */
.tk-toks {
  display: flex;
  gap: 4px;
}

.tk-toks span {
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(var(--accent-rgb), 0.28);
  color: var(--ink);
}

.tk-toks span:nth-child(even) {
  background: rgba(var(--accent-rgb), 0.14);
}

.tk-core {
  padding: 24px 32px 26px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
}

.tk-name {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.tk-does {
  list-style: none;
}

.tk-does li {
  position: relative;
  margin: 0;
  padding: 5px 0 5px 22px;
  font-size: 22px;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.82);
}

.tk-does li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--accent);
}

.tk-node {
  padding: 18px 22px;
  border-radius: 12px;
  background: var(--surface);
}

.tk-node-l {
  margin-bottom: 4px;
}

.tk-node-t {
  font-size: 28px;
  font-weight: 600;
}

.tk-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.tk-qr {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.tk-qr img {
  width: 150px;
  height: 150px;
  padding: 10px;
  background: #fff;
}

.tk-qr span {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--muted);
}

.tk-cta {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tk-status {
  font-size: 22px;
  line-height: 1.45;
  color: var(--muted);
}

.tk-core-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.tk-core-h .tk-name {
  margin-bottom: 0;
}

.tk-gh {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 21px;
}

.tk-gh svg {
  width: 22px;
  height: 22px;
}

.tk-gh:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Chrome: progress, hint, overview (not scaled) ──── */

.progress {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  transition: width 0.35s ease;
  z-index: 100;
}

.hint {
  position: fixed;
  bottom: 16px;
  right: 20px;
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  transition: opacity 1s ease;
  z-index: 101;
}

.hint.hidden { opacity: 0; }

.toc-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(35, 47, 62, 0.9);
}

.toc-overlay.open { display: flex; }

.toc-panel {
  background: var(--bg);
  color: var(--ink);
  border-radius: 1.4vh;
  padding: 3vh 4vh;
  min-width: 30vw;
  max-width: 80vw;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
}

.toc-title {
  font-family: var(--font-display);
  font-size: 3vh;
  font-weight: 600;
  margin-bottom: 1.6vh;
}

.toc-list {
  list-style: none;
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 1.4vh;
  padding: 0.9vh 1.3vh;
  border-radius: 0.8vh;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 2vh;
}

.toc-item:hover { background: var(--surface); }
.toc-item.current { color: var(--accent-ink); font-weight: 600; }

.toc-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3vh;
  height: 3vh;
  border-radius: 50%;
  flex: none;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 1.5vh;
}

.toc-item.current .toc-num {
  background: var(--accent);
  color: #fff;
}

/* ── Print: one slide per page, every fragment shown ── */

@page {
  size: 1920px 1080px;
  margin: 0;
}

@media print {
  html,
  body,
  .deck {
    height: auto;
    overflow: visible;
    background: var(--bg);
    display: block;
  }

  .slide {
    position: relative;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    opacity: 1;
    break-after: page;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .frag {
    opacity: 1;
    transform: none;
  }

  .progress,
  .hint,
  .toc-overlay {
    display: none !important;
  }
}
