/* deck-foundation v1: type roles, slide layouts and shared components.
   Theme-agnostic: colours and faces come from the theme's tokens (see contract.md).
   Frozen once a published deck uses it; changes go into v2. */

/* Defaults a theme may override. :where() keeps specificity at zero so any theme :root wins. */
:where(:root) {
  --text-hero: 120px;
  --text-section: 84px;
  --text-title: 64px;
  --text-statement: 44px;
  --text-card-title: 32px;
  --text-lead: 32px;
  --text-body: 28px;
  --text-small: 24px;
  --text-kicker: 24px;
  --text-label: 20px;
  --text-hint: 20px;
  --text-code: 24px;
  --text-code-dense: 20px;

  --tracking-tight: -0.02em;
  --tracking-label: 0.18em;
  --tracking-kicker: 0.35em;

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;

  --margin-x: 120px;
  --measure: 60ch;
  --radius: 8px;
  --radius-pill: 100px;
  /* Motion: one curve, three speeds. Nothing bounces, scales or spins. */
  /* Motion profile taken from the Guardrails & Evals deck. */
  --ease: cubic-bezier(0.4, 0, 0.2, 1); /* highlights and controls: a soft glide */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1); /* slide entrance: fast, confident, long settle */
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1); /* fragments */
  --duration-fast: 150ms;
  --duration: 400ms;
  --duration-reveal: 480ms;
  --enter-duration: 700ms;
  --enter-delay: 100ms;
  --enter-stagger: 140ms;
  --enter-rise: 28px;
  --duration-slow: 600ms;
  --duration-crossfade: 0ms; /* slides switch instantly; the staged entrance does the moving */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* small overshoot, illustrations only */
  --rise: 18px;

  --ledger-term-width: 300px;

  /* Emphasis defaults are the accessible ones: upright, heavier, accent colour. */
  --emphasis-style: normal;
  --emphasis-weight: 700;
  --quote-style: normal;
  --quote-weight: 500;
}

/* ---------- Type roles ---------- */

.t-hero,
.t-section,
.t-title,
.t-statement,
.t-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  color: var(--ink);
}
em {
  font-style: var(--emphasis-style);
  font-weight: var(--emphasis-weight);
  color: var(--accent);
}
cite {
  font-style: italic;
}

/* Display emphasis: the one or two words that carry a title, quote or section break.
   A theme can make these italic and fill them with a gradient (--display-em-fill); content-slide
   titles keep the plain emphasis above so they read at a glance. Every gradient stop must pass
   the same contrast as --accent. The padding keeps italic overhang inside the gradient box. */
:is(.t-hero, .t-section, .layout-quote > .t-statement) em {
  font-style: var(--display-em-style, var(--emphasis-style));
  font-weight: var(--display-em-weight, var(--emphasis-weight));
  padding-right: 0.08em;
  margin-right: -0.08em;
  background: var(--display-em-fill, none);
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--display-em-color, var(--accent));
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.t-hero {
  font-size: var(--text-hero);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
}
.t-section {
  font-size: var(--text-section);
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
}
.t-title {
  font-size: var(--text-title);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.t-statement {
  font-size: var(--text-statement);
  line-height: 1.2;
}
/* v2: display lines break evenly, so no title ends on one stranded word. */
.t-hero,
.t-section,
.t-title,
.t-statement {
  text-wrap: balance;
}
.t-card-title {
  font-size: var(--text-card-title);
  line-height: 1.2;
}

.t-lead,
.t-body,
.t-small {
  margin: 0;
  max-width: var(--measure);
  font-family: var(--font-body);
  font-style: var(--body-style);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-muted);
}
.t-lead {
  font-size: var(--text-lead);
  font-style: var(--lead-style, var(--body-style));
}
.t-body {
  font-size: var(--text-body);
}
.t-small {
  font-size: var(--text-small);
}

.t-kicker,
.t-label,
.t-hint,
.t-code {
  margin: 0;
  font-family: var(--font-label);
}
.t-kicker {
  font-size: var(--text-kicker);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--accent);
}
.t-label {
  font-size: var(--text-label);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-muted);
}
.t-hint {
  font-size: var(--text-hint);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--ink-subtle);
}
.t-code {
  font-size: var(--text-code);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
}

/* ---------- Slide layouts (1920x1080 stage) ---------- */

.layout-title,
.layout-section,
.layout-content,
.layout-quote {
  position: relative;
  width: 1920px;
  height: 1080px;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 var(--margin-x);
  background-color: var(--surface);
  /* A theme may set --slide-glow (one soft gradient) for depth; it is the same on every slide. */
  background-image: var(--slide-glow, none);
  color: var(--ink);
}
/* Keep content above absolutely positioned theme decorations that come first in markup. */
:where(.layout-title, .layout-section, .layout-content, .layout-quote) > * {
  position: relative;
}

.layout-title {
  justify-content: center;
}
.layout-title > .t-hero {
  margin-top: var(--space-4);
}
/* v2: a clear gap between the title and its subtitle (96px). */
.layout-title > .t-lead {
  margin-top: var(--space-8);
}

.layout-section {
  justify-content: center;
}
.layout-section > .t-section {
  margin-top: var(--space-4);
}

/* Kicker at y=118, title at y=172, content area fills the rest above the footer zone. */
.layout-content {
  padding-top: 118px;
  padding-bottom: var(--space-8);
}
.layout-content > .t-title {
  margin-top: var(--space-4);
}
/* v2: a subtitle line under a title or section heading gets its own breathing room. */
:is(.layout-content > .t-title, .layout-section > .t-section) + .t-lead {
  margin-top: var(--space-4);
}
.layout-content > .region {
  flex: 1;
  min-height: 0;
  margin-top: var(--space-8);
}
/* v2: the region fills the space under the title and centres its content vertically, so a slide
   with little content is balanced, not top-heavy. .region--top keeps it at the top instead. */
.layout-content > .region {
  justify-content: center;
  align-content: center;
}
.layout-content > .region.region--top {
  justify-content: flex-start;
  align-content: start;
}

.layout-quote {
  justify-content: center;
  align-items: center;
  text-align: center;
}
.layout-quote > .t-statement {
  max-width: 1500px;
  font-size: var(--text-title);
  font-style: var(--quote-style);
  font-weight: var(--quote-weight);
  line-height: 1.3;
}
.layout-quote > .t-hint {
  margin-top: var(--space-6);
}

.slide-footer {
  position: absolute;
  left: var(--margin-x);
  right: var(--margin-x);
  bottom: var(--space-7);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.slide-footer > :last-child {
  text-align: right;
}
/* Event block, bottom right of a title slide: optional logo, then event name over the date. */
.footer-event {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.footer-event > div {
  display: flex;
  flex-direction: column;
  text-align: right;
}
.footer-event img {
  height: 44px;
  width: auto;
}

/* Items in a row stretch to the tallest one; rows stay at the top of the content area. */
.grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  align-items: stretch;
  align-content: start;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
/* v2: a stack whose items are all the height of the tallest one (cards side by side in a column). */
.stack--equal {
  display: grid;
  grid-auto-rows: 1fr;
}

/* v2 compare: two or more columns, each a label, a card (code window, card, log) and an optional
   caption. The columns share their rows, so every card in the row is the same height and the
   captions line up, whatever each card contains. */
.compare {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  grid-template-rows: auto 1fr auto;
  column-gap: var(--space-6);
  row-gap: var(--space-4);
}
.compare > * {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
}
.compare > * > .t-label:first-child {
  color: var(--accent);
}

/* ---------- Editorial header: kicker left, page number right, hairline below ----------
   <header class="slide-header"><span class="t-label">Section name</span><span class="t-label" data-page></span></header>
   deck.js fills [data-page] with "03 / 12". On content slides it replaces the kicker; the title keeps its place. */
.slide-header {
  position: absolute;
  top: 56px;
  left: var(--margin-x);
  right: var(--margin-x);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}
/* Small and quiet, like a page header in print: section name in the accent, page number subtle. */
.slide-header > * {
  font-size: var(--text-header, 20px);
  letter-spacing: var(--tracking-label);
}
.slide-header > :first-child {
  color: var(--accent);
}
.slide-header > [data-page] {
  font-weight: 400;
  color: var(--ink-subtle);
}
.layout-content:has(> .slide-header) {
  padding-top: 148px;
}

/* ---------- Hero visual: the one focal object on a title slide ----------
   <div class="hero-visual">
     <div class="hero-aura" data-anim="pulse"></div>
     <div class="hero-orbit" data-anim="spin"></div>
     <div class="hero-orbit hero-orbit--inner" data-anim="spin" style="--spin: -1"></div>
     <svg class="hero-emblem" …>the talk's emblem, built with data-anim draw / pop</svg>
   </div>
   The title text column narrows so long titles never run under it. */
.hero-visual {
  position: absolute !important;
  top: calc(50% - 220px);
  right: calc(var(--margin-x) + 10px);
  width: 440px;
  height: 440px;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.hero-visual > * {
  grid-area: 1 / 1;
}
.hero-aura {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--accent) 46%, transparent) 0%,
    color-mix(in srgb, var(--accent-strong) 16%, transparent) 40%,
    transparent 66%
  );
  filter: blur(32px);
}
.hero-orbit {
  width: 92%;
  height: 92%;
  border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, transparent);
}
.hero-orbit--inner {
  width: 72%;
  height: 72%;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}
.hero-emblem {
  width: 58%;
  height: auto;
  overflow: visible;
}
/* Animated SVG parts scale and rotate around their own centre (for anime.js or data-anim).
   Add class="anim-svg" to any illustration that anime.js drives. */
:is(.hero-emblem, .anim-svg) * {
  transform-box: fill-box;
  transform-origin: center;
}
.layout-title:has(> .hero-visual) {
  padding-right: calc(var(--margin-x) + 520px);
}
/* Beside a hero the title is a step smaller, so it breaks into two lines at most. */
.layout-title:has(> .hero-visual) > .t-hero {
  font-size: var(--text-hero-beside-visual, 112px);
}

/* ---------- Tags ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 6px var(--space-3);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  font: 600 var(--text-label)/1 var(--font-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent);
}
.tag--solid {
  background: var(--accent);
  color: var(--surface);
}

/* ---------- Cards ---------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background-color: var(--surface);
}
.card > .tag {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}

.card--compact {
  gap: var(--space-1);
  padding: var(--space-4);
}
.card--compact .t-card-title {
  font-size: 28px;
}
.card--compact .t-small {
  font-size: var(--text-label);
}

.card--rule {
  --tone: var(--accent);
  border-left: 5px solid var(--tone);
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--tone) 10%, transparent), transparent 70%);
}
.card--rule[data-tone="positive"] {
  --tone: var(--positive);
}
.card--rule[data-tone="info"] {
  --tone: var(--info);
}
.card--rule[data-tone="negative"] {
  --tone: var(--negative);
}
.card--rule > .t-label {
  color: var(--tone);
}

.card--feature {
  align-items: center;
  text-align: center;
  padding: var(--space-6);
}
.card--feature > .t-label {
  color: var(--accent);
  letter-spacing: 0.3em;
}
.card-icon {
  width: 160px;
  height: 160px;
  margin-block: var(--space-2);
  color: var(--accent);
}
.card-foot {
  align-self: stretch;
  margin-top: auto; /* pinned to the bottom so feet line up across a row */
  padding-top: var(--space-3);
  border-top: 1px solid var(--line-strong);
  color: var(--accent);
}

/* ---------- Ledger ---------- */

.ledger-head,
.ledger-row {
  display: grid;
  grid-template-columns: var(--ledger-term-width) 1fr 1fr;
  gap: var(--space-6);
}
.ledger-head {
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--accent);
}
.ledger-head > .t-label {
  color: var(--accent);
}
.ledger-row {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

/* ---------- Log entry ---------- */

.log-entry {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-5);
  border-left: 2px solid var(--line-strong);
}
.log-entry > .t-label {
  color: var(--accent);
}

/* ---------- Terminal ---------- */

.term-win {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background-color: var(--surface-raised);
}
.term-bar {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}
.term-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--line-strong);
}
.term-bar > .t-hint {
  margin-left: var(--space-2);
}
.term-body {
  margin: 0;
  padding: var(--space-5) var(--space-6);
  font: 400 var(--text-code-dense)/1.7 var(--font-label);
  color: var(--ink);
  white-space: pre;
}
.term-body .dim {
  color: var(--ink-subtle);
}
.term-body .good {
  color: var(--positive);
}
.term-body .bad {
  color: var(--negative);
}
.term-body .pending {
  color: var(--info);
}

/* Code inside a terminal or code window. Comments use the real italic face. */
.term-body .kw {
  color: var(--accent);
}
.term-body .str {
  color: var(--positive);
}
.term-body .fn {
  color: var(--info);
}
.term-body .num {
  color: var(--accent-strong);
}
.term-body .com {
  color: var(--ink-subtle);
  font-style: italic;
}

/* ---------- Agenda ---------- */

.agenda {
  display: flex;
  flex-direction: column;
}
.agenda-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: var(--space-5);
  align-items: baseline;
  padding: var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--line);
}
.agenda-row > :first-child {
  color: var(--ink-subtle);
}
.agenda-row.step-current > :first-child {
  color: var(--accent);
}

/* ---------- Stat ---------- */

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 2px solid var(--line-strong);
}
.stat.is-key {
  border-top-color: var(--accent);
}
.stat-value {
  font: var(--weight-display) var(--text-section)/1 var(--font-display);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat-value small {
  font-size: 0.5em;
  color: var(--ink-muted);
}

/* ---------- Process steps (numbered automatically) ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: var(--space-5);
  counter-reset: step;
}
.step-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-8);
}
.step-item::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  font: 600 var(--text-label)/1 var(--font-label);
  color: var(--ink-muted);
}
.step-item::after {
  content: "";
  position: absolute;
  top: 27px;
  left: 56px;
  right: calc(-1 * var(--space-5));
  height: 2px;
  background: var(--line-strong);
}
.step-item:last-child::after {
  display: none;
}
.step-item:is(.is-done, .step-current)::before {
  border-color: var(--accent);
  color: var(--accent);
}
.step-item.is-done::after {
  background: var(--accent);
}

/* ---------- Checklist (icon + word, never colour alone) ---------- */

.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.checklist li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--space-3);
  align-items: center;
  font: 400 var(--text-body)/1.4 var(--font-body);
  color: var(--ink);
}
.checklist li::before {
  content: "";
  width: 32px;
  height: 32px;
  background: var(--positive);
  -webkit-mask: var(--icon-check) center / contain no-repeat;
  mask: var(--icon-check) center / contain no-repeat;
}
.checklist li.is-no::before {
  background: var(--negative);
  -webkit-mask-image: var(--icon-cross);
  mask-image: var(--icon-cross);
}
.checklist li.is-todo::before {
  background: var(--ink-subtle);
  -webkit-mask-image: var(--icon-todo);
  mask-image: var(--icon-todo);
}
.checklist li.is-todo {
  color: var(--ink-muted);
}
:root {
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E");
  --icon-cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
  --icon-todo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3C/svg%3E");
}

/* ---------- Bar chart: one highlighted bar, the rest neutral; values at the tips ---------- */

.bars {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: var(--space-5);
  row-gap: var(--space-4);
  align-items: center;
}
.bar-label {
  font: 400 var(--text-small)/1.2 var(--font-body);
  color: var(--ink-muted);
}
.bar-track {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-left: 1px solid var(--line-strong);
}
.bar-fill {
  /* --value is 0-100, relative to the largest bar. 140px is kept for the value label. */
  width: calc((100% - 140px) * var(--value) / 100);
  height: 24px;
  border-radius: 0 4px 4px 0;
  background: color-mix(in srgb, var(--ink) 30%, transparent);
}
.bar-value {
  font: 600 var(--text-label)/1 var(--font-label);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.is-key > .bar-fill {
  background: var(--accent);
}
.bar-label.is-key {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Figure ---------- */

.figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.figure > :is(img, svg, .media) {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

/* ---------- Icons (icons.js turns <i data-icon> into <svg class="icon">) ---------- */

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.14em;
  stroke-width: 1.5;
}
.icon--accent {
  color: var(--accent);
}
.icon-badge {
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 40px;
  color: var(--accent);
}

/* Text for screen readers only. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Current-step highlight (shared by every component) ---------- */

:is(.card, .term-win, .ledger-row, .log-entry, .agenda-row).step-current {
  border-color: var(--accent);
  background-color: color-mix(in srgb, var(--accent) 7%, transparent);
}
:is(.card, .term-win).step-current {
  box-shadow:
    0 0 0 1px var(--accent),
    0 12px 30px color-mix(in srgb, var(--accent) 16%, transparent);
}

/* ---------- Motion ---------- */

/* One transition list for everything that reveals or highlights. It must be a single rule:
   an element that is both a fragment and a card needs the reveal and the highlight to animate,
   and two separate transition rules would override each other. */
.step,
:is(.card, .term-win, .ledger-row, .log-entry, .agenda-row) {
  transition:
    opacity var(--duration-reveal) var(--ease-out-cubic),
    transform var(--duration-reveal) var(--ease-out-cubic),
    border-color var(--duration) var(--ease),
    background-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

/* Fragments: [data-step] elements with .step fade and rise in; the runtime adds .step-shown. */
.step {
  opacity: 0;
  transform: translateY(var(--rise));
  pointer-events: none;
}
.step.step-shown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* Slide change: a short crossfade. The runtime adds .active to the current slide. */
.slide {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--duration-crossfade) ease,
    visibility 0s linear var(--duration-crossfade);
}
.slide.active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

/* Reduced motion: same end states, no movement, no fades. */
@media (prefers-reduced-motion: reduce) {
  :is(.card, .term-win, .ledger-row, .log-entry, .agenda-row, .step, .slide) {
    transition: none;
  }
  .step {
    transform: none;
  }
}

/* ---------- Illustration motion: story moments, not UI ----------
   Put data-anim on an element inside an illustration (usually SVG). It plays when its slide
   becomes active, or, inside a fragment, when that fragment is shown, and replays on every visit.
     draw    a stroke draws itself (add pathLength="1" to the path, line or circle)
     pop     scales in with a small spring overshoot
     rise    fades in and rises
     sweep   revealed left to right
     shake   a short impact shake
     ripple  a ring expands and fades (shockwave)
     spin    slow continuous rotation      (ambient: title slides only)
     pulse   slow breathing glow           (ambient: title slides only)
   Keyframes use the individual scale/rotate/translate properties, so they combine with an SVG
   element's own transform attribute instead of replacing it.
   Timing: --i (stagger index), --anim-delay, --anim-duration. One choreographed moment per slide,
   finished within about 1.5s. Reduced motion and print show the finished illustration. */

[data-anim] {
  transform-box: fill-box;
  transform-origin: center;
}
[data-anim="draw"] {
  stroke-dasharray: 1;
}
/* A ripple ends invisible, so that is its resting state too (reduced motion, print, before it plays). */
[data-anim="ripple"] {
  opacity: 0;
}

.slide.active [data-anim] {
  animation-duration: var(--anim-duration, 800ms);
  animation-delay: calc(var(--anim-delay, 0ms) + var(--i, 0) * var(--anim-stagger, 70ms));
  animation-timing-function: var(--ease);
  animation-fill-mode: both;
}
.slide.active [data-anim="draw"] {
  animation-name: anim-draw;
}
.slide.active [data-anim="pop"] {
  animation-name: anim-pop;
  animation-timing-function: var(--spring);
}
.slide.active [data-anim="rise"] {
  animation-name: anim-rise;
}
.slide.active [data-anim="sweep"] {
  animation-name: anim-sweep;
  animation-duration: var(--anim-duration, 1400ms);
}
.slide.active [data-anim="shake"] {
  animation-name: anim-shake;
  animation-duration: var(--anim-duration, 420ms);
  animation-timing-function: ease-in-out;
}
.slide.active [data-anim="ripple"] {
  animation-name: anim-ripple;
  animation-duration: var(--anim-duration, 900ms);
  animation-timing-function: ease-out;
}
.slide.active [data-anim="spin"] {
  animation: anim-spin var(--anim-duration, 40s) linear infinite;
}
.slide.active [data-anim="pulse"] {
  animation: anim-pulse var(--anim-duration, 4s) ease-in-out infinite alternate;
}
/* Inside a fragment that has not been shown yet: hold, so it plays when the fragment appears. */
.slide.active .step:not(.step-shown) [data-anim],
.slide.active .step[data-anim]:not(.step-shown) {
  animation-name: none;
}

@keyframes anim-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes anim-pop {
  from {
    opacity: 0;
    scale: 0.6;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}
@keyframes anim-rise {
  from {
    opacity: 0;
    translate: 0 24px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes anim-sweep {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes anim-shake {
  20% {
    translate: -6px 2px;
  }
  40% {
    translate: 5px -2px;
  }
  60% {
    translate: -3px 1px;
  }
  80% {
    translate: 2px -1px;
  }
}
@keyframes anim-ripple {
  from {
    opacity: 0.9;
    scale: 0.3;
  }
  to {
    opacity: 0;
    scale: 1.6;
  }
}
@keyframes anim-spin {
  to {
    rotate: calc(360deg * var(--spin, 1));
  }
}
@keyframes anim-pulse {
  from {
    opacity: 0.6;
    scale: 0.92;
  }
  to {
    opacity: 1;
    scale: 1.12;
  }
}

/* Title silk: sweeps in, then drifts slowly while the title waits on screen before the talk. */
.slide.active .motif--silk {
  animation:
    silk-sweep 1400ms var(--ease) both,
    silk-drift 14s ease-in-out 1400ms infinite alternate;
}
/* The lines only occupy the right half, so the sweep starts there instead of revealing empty space. */
@keyframes silk-sweep {
  from {
    clip-path: inset(0 50% 0 0);
    opacity: 0;
  }
  to {
    clip-path: inset(0 0 0 0);
    opacity: var(--motif-opacity, 0.6);
  }
}
@keyframes silk-drift {
  from {
    translate: 0 0;
  }
  to {
    translate: 0 18px;
  }
}

/* ---------- Staged entrance: every slide builds itself ----------
   deck.js marks each top-level part of a slide (header, kicker, title, content, footer) with
   .enter and --enter-i; they rise and fade in one after another. Fragments (.step), motifs and
   notes are left alone. Going backwards shows the slide finished, as Keynote does. */
.slide.active > .enter {
  animation: slide-enter var(--enter-duration) var(--ease-expo) both;
  animation-delay: calc(var(--enter-delay) + var(--enter-i, 0) * var(--enter-stagger));
}
.deck.is-back .slide.active > .enter {
  animation: none;
}
@keyframes slide-enter {
  from {
    opacity: 0;
    translate: 0 var(--enter-rise);
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide.active [data-anim],
  .slide.active .motif--silk,
  .slide.active > .enter {
    animation: none;
  }
}

/* Print: every fragment visible and every illustration finished, whatever step the presenter was on. */
@media print {
  .step {
    opacity: 1;
    transform: none;
  }
  [data-anim],
  .motif--silk,
  .enter {
    animation: none !important;
  }
}

/* ---------- v2: closing line ---------- */
/* The line left on screen during questions ("Thank you · Questions"): large and bright enough to
   read from the back of the room. <em> marks the part in the accent. */
.t-closing {
  margin-top: var(--space-7);
  font: 600 var(--text-lead)/1.2 var(--font-label);
  letter-spacing: 0.06em;
  color: var(--ink);
}
.t-closing em {
  font-style: normal;
  color: var(--accent);
}
