:root {
  /* Academic talk: paper field, ink hierarchy, sparse crimson */
  --bg: #f7f6f3;
  --bg-deep: #f0eee9;
  --bg-elevated: #ffffff;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --line: rgba(26, 26, 26, 0.16);
  --accent: #9b2d3f;
  --accent-rgb: 155, 45, 63;
  --steel: #3a3a3a;
  --steel-rgb: 58, 58, 58;
  --accent-2: #4a4a4a;
  --danger-soft: #8f5346;
  --shadow: none;
  --radius: 2px;
  --font-display: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --paper: var(--bg);
}

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

html {
  font-size: clamp(18px, 0.7vw + 14px, 21px);
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--paper);
  border-top: 2px solid rgba(var(--accent-rgb), 0.55);
}

body::after {
  display: none;
}

code {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.92em;
  color: var(--accent);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

a:hover {
  color: var(--ink);
}

a code {
  color: inherit;
}

.deck {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 100%;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  /* safe centering: falls back to start-aligned when content is taller than
     the viewport, so overflow is always reachable by scrolling down instead
     of being centered out of view above scrollTop 0 */
  place-items: safe center;
  padding: 2.1rem 1.85rem 3.6rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 320ms ease,
    transform 360ms ease,
    visibility 0ms linear 320ms;
  overflow: auto;
  background: transparent;
}

.slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0ms;
  z-index: 1;
}

.slide-inner {
  width: min(1480px, 94vw);
  position: relative;
  z-index: 1;
}

.slide-inner.split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 1.35rem;
  align-items: center;
}

.slide-inner.split-bench {
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 1.15rem;
  align-items: center;
}

.precision-hardware-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  align-items: center;
}

.precision-hardware-copy h2 {
  max-width: 22ch;
}

.precision-tier-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.precision-tier-list article {
  padding: 0.2rem 0 0.2rem 0.65rem;
  border-left: 2px solid rgba(var(--accent-rgb), 0.55);
}

.precision-tier-list h3 {
  margin: 0 0 0.18rem;
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.25;
}

.precision-tier-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.core-explainer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: stretch;
  margin: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.core-explainer-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.65rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 55%, white);
  text-align: center;
}

.core-explainer-tensor {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.06);
}

.core-explainer-label {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}

.scalar-visual {
  display: grid;
  grid-template-columns: repeat(4, 1.55rem);
  gap: 0.22rem;
  margin: 0.2rem 0 0.7rem;
}

.scalar-visual span {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border: 1px solid rgba(26, 26, 26, 0.25);
  border-radius: 3px;
  background: #fff;
  color: var(--muted);
  font-size: 0.75rem;
}

.matrix-visual {
  display: grid;
  grid-template-columns: repeat(4, 1.55rem);
  gap: 0.1rem;
  margin: 0.2rem 0 0.7rem;
  padding: 0.25rem;
  border: 2px solid var(--accent);
  border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.1);
}

.matrix-visual span {
  width: 1.55rem;
  height: 1.55rem;
  background: rgba(var(--accent-rgb), 0.35);
}

.core-explainer-column h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 0.88rem;
  line-height: 1.25;
}

.core-explainer-column > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.core-explainer-versus {
  align-self: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.core-explainer figcaption {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 0.15rem;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
  text-align: center;
}

.title-slide {
  text-align: center;
}

.toc-slide {
  width: min(1100px, 92vw);
}

.toc-slide h2 {
  max-width: none;
}

.toc-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1.25rem;
  counter-reset: none;
}

.toc-list > li {
  margin: 0;
}

.toc-item {
  appearance: none;
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: baseline;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.toc-item:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.05);
}

.toc-num {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.toc-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.toc-text strong {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.25;
}

.toc-text span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

@media (max-width: 800px) {
  .toc-list {
    grid-template-columns: 1fr;
  }
}

.title-main {
  max-width: min(36ch, 92vw);
  margin-inline: auto;
  font-size: clamp(1.55rem, 2.8vw, 2.45rem);
  line-height: 1.22;
  font-weight: 700;
}

.title-subtitle {
  max-width: min(48ch, 90vw);
  margin: 0.9rem auto 0;
  color: var(--muted);
  font-family: var(--font-body);
  /* ~0.75–0.8 of .title-main so it reads as a true secondary line */
  font-size: clamp(1.35rem, 2.15vw, 1.95rem);
  font-weight: 600;
  line-height: 1.35;
}

.title-meta {
  margin: 1.35rem auto 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.55;
}

.title-author,
.title-affiliation {
  margin: 0.2rem 0 0;
}

.title-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.title-github {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition:
    border-color 160ms ease,
    color 160ms ease;
}

.title-github:hover {
  border-color: rgba(var(--accent-rgb), 0.55);
  color: var(--accent);
}

.title-github-icon {
  flex: 0 0 auto;
  display: block;
}

.eyebrow {
  margin: 0 0 0.3rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--accent);
  font-weight: 600;
}

.eyebrow-chapter {
  font-size: clamp(0.92rem, 1.15vw, 1.02rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 0.35rem;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.45rem;
  line-height: 1.18;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.4rem, 4.4vw, 3.5rem);
}

h2 {
  font-size: clamp(1.65rem, 2.5vw, 2.15rem);
  max-width: 34ch;
  font-weight: 600;
}

.title-slide h2 {
  max-width: none;
  margin-inline: auto;
}

.title-thanks {
  font-size: clamp(3.4rem, 7vw, 5.4rem);
  margin-bottom: 1.1rem;
  letter-spacing: -0.02em;
}

.close-note {
  margin-inline: auto;
  max-width: 38rem;
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);
  line-height: 1.45;
}

.close-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 1.35rem auto 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.15vw, 1.1rem);
  font-weight: 600;
}

.close-links a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.35);
}

.close-links a:hover {
  border-bottom-color: var(--accent);
}

.conclude-slide {
  width: min(1080px, 92vw);
}

.conclude-slide h2 {
  max-width: 28ch;
}

.conclude-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.conclude-list li {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid rgba(var(--accent-rgb), 0.7);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.conclude-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.55vw, 1.45rem);
  font-weight: 700;
  line-height: 1.25;
}

.conclude-desc {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.25vw, 1.22rem);
  line-height: 1.4;
}

.rq-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.rq-list > li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem 0.7rem;
  align-items: start;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-left: 3px solid rgba(var(--accent-rgb), 0.7);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.rq-label {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.rq-list p {
  margin: 0;
  color: var(--ink);
  font-size: clamp(0.92rem, 1.05vw, 1.05rem);
  line-height: 1.35;
}

.lede {
  margin: 0;
  font-size: clamp(1.12rem, 1.3vw, 1.32rem);
  line-height: 1.34;
  color: var(--ink);
  max-width: 58rem;
}

.lede.narrow {
  max-width: 56rem;
  margin-bottom: 0.85rem;
}

.lede-tight {
  margin-bottom: 0.55rem !important;
}

.slide-inner-charts {
  width: min(1480px, 94vw);
}

.title-slide .lede {
  margin-inline: auto;
}

.hint {
  margin-top: 2.5rem;
  color: var(--muted);
  font-size: 1rem;
}

.callout {
  margin-top: 0.75rem;
  padding: 0.55rem 0 0.55rem 0.85rem;
  border-left: 2px solid var(--accent);
  background: transparent;
  color: var(--ink);
  line-height: 1.35;
  font-size: 1.05rem;
}

.callout.center {
  text-align: center;
  border-left: none;
  border-top: 3px solid var(--accent);
  max-width: 36rem;
  margin-inline: auto;
}

.bullets {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink);
  line-height: 1.35;
  font-size: 1.08rem;
}

.bullets li::marker {
  color: var(--accent);
}

.atmosphere,
.atmosphere-omt,
.atmosphere-title {
  display: none;
}

.fm-preset-map {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 24px minmax(0, 0.9fr) 24px minmax(0, 0.95fr);
  gap: 0.3rem 0.5rem;
  max-width: 1280px;
  margin: 0.4rem auto 0;
}

.fm-preset-map-heading {
  margin: 0 0 0.3rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}

.fm-preset-model,
.fm-preset-token,
.fm-preset-task {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.22rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.fm-preset-model strong {
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.2;
}

.fm-preset-model span {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.2;
}

.fm-preset-shared {
  grid-row: span 2;
}

.fm-preset-token {
  flex-direction: row;
  align-items: center;
  border-color: rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.05);
}

.fm-preset-token code {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.fm-preset-task {
  color: var(--ink);
  font-size: 0.77rem;
  font-weight: 600;
  line-height: 1.25;
}

.fm-preset-arrow {
  position: relative;
  align-self: center;
  height: 2px;
  background: var(--accent);
}

.fm-preset-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--accent);
  border-top: 2px solid var(--accent);
  transform: translateY(-50%) rotate(45deg);
}

.fm-preset-map-note {
  max-width: 1280px;
  margin: 0.35rem auto 0;
  padding-left: 0.6rem;
  border-left: 2px solid rgba(var(--accent-rgb), 0.55);
  color: var(--ink);
  font-size: 0.68rem;
  line-height: 1.3;
}

@media (max-width: 900px) {
  .slide-inner.split {
    grid-template-columns: 1fr;
  }

  .slide-inner.split.arch-layout {
    grid-template-columns: 1fr;
  }

  .precision-hardware-layout {
    grid-template-columns: 1fr;
  }

  .core-explainer {
    grid-template-columns: 1fr;
  }

  .core-explainer-versus {
    display: none;
  }

  .core-explainer figcaption {
    grid-column: 1;
  }
}

/* Nested package sets: scheduler > engine > models */
.slide-inner.split.arch-layout {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 1.1rem;
}

.arch-layout .arch-nest {
  margin-top: 0;
}

.arch-summary {
  margin-top: 0.65rem;
  font-size: 0.94rem;
  line-height: 1.35;
}

.arch-summary li + li {
  margin-top: 0.28rem;
}

.arch-layout .callout {
  margin-top: 0.65rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.94rem;
}

.arch-nest {
  margin-top: 0.35rem;
  position: relative;
}

.arch-nest-root {
  margin: 0 0 0.35rem;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.arch-shell {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem 0.7rem;
}

.arch-shell-sched {
  border-color: rgba(138, 75, 58, 0.4);
  background: rgba(138, 75, 58, 0.04);
}

.arch-shell-engine {
  margin-top: 0.45rem;
  border-color: rgba(var(--steel-rgb), 0.35);
  background: rgba(var(--steel-rgb), 0.05);
}

.arch-shell-model {
  margin-top: 0.45rem;
  border-color: rgba(var(--accent-rgb), 0.4);
  background: color-mix(in srgb, var(--bg-elevated) 82%, #f0e4e7);
}

.arch-shell-head h3 {
  margin: 0 0 0.08rem;
  font-size: 1.08rem;
  font-weight: 700;
}

.arch-shell-role {
  margin: 0 0 0.28rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.35;
}

.arch-shell-points {
  margin: 0;
  padding-left: 0.95rem;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.28;
}

.arch-shell-points li + li {
  margin-top: 0.08rem;
}

.arch-path {
  margin: 0 0 0.15rem;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.78rem;
  color: var(--ink);
  opacity: 0.7;
}

.arch-lifecycle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0.25rem;
  margin: 0.45rem 0 0;
  padding: 0;
}

.arch-lifecycle > [role="listitem"] {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 1.65rem;
  padding: 0.25rem 0.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.arch-lifecycle-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  opacity: 0.55;
  font-size: 0.85rem;
  line-height: 1;
  user-select: none;
}

.arch-set-caption {
  margin: 0.45rem 0 0;
  text-align: center;
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.3;
  opacity: 0.85;
}

@media (max-width: 900px) {
  .arch-lifecycle {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .arch-lifecycle-arrow {
    display: none;
  }
}

.figure-bench {
  background: #fff;
}

.figure-bench img {
  background: #fff;
  max-height: min(58vh, 620px);
}

.figure-zoomable {
  cursor: zoom-in;
}

.figure-zoomable img {
  pointer-events: none;
}

.figure-frame figcaption {
  display: block;
  padding: 0.55rem 0.85rem 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  text-align: left;
}

.figure-caption-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
}

.figure-zoom-hint {
  appearance: none;
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  cursor: zoom-in;
  white-space: nowrap;
}

.figure-zoomable:hover .figure-zoom-hint {
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--accent);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: rgba(12, 17, 24, 0.78);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(98vw, 1800px);
  max-height: min(90vh, 1100px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.lightbox-caption {
  margin: 0;
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
  max-width: 90vw;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

body.lightbox-open {
  overflow: hidden;
}

.tier-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.tier {
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
}

.tier h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.tier p {
  margin: 0;
  color: var(--ink);
  line-height: 1.38;
  font-size: 1.05rem;
}

.distributed-run-slide {
  max-width: 1180px;
}

.distributed-hw-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  margin-top: 0.75rem;
}

.distributed-hw-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
}

.distributed-hw-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 55%, white);
}

.distributed-hw-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.distributed-hw-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.distributed-hw-rows {
  display: grid;
  gap: 0;
}

.distributed-hw-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.75rem;
}

.distributed-hw-row + .distributed-hw-row {
  border-top: 1px solid var(--line);
}

.distributed-hw-preset strong {
  display: block;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
}

.distributed-hw-preset span {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.distributed-hw-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 0;
}

.distributed-hw-metrics div {
  margin: 0;
}

.distributed-hw-metrics dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.2;
}

.distributed-hw-metrics dd {
  margin: 0.12rem 0 0;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

@media (max-width: 900px) {
  .distributed-hw-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .tier-board {
    grid-template-columns: 1fr;
  }

  .distributed-hw-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}

.figure-frame {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
}

.figure-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(56vh, 580px);
  object-fit: contain;
  background: var(--bg-elevated);
}

.figure-frame.figure-bench-lg img {
  max-height: min(58vh, 620px);
}

/* Transparent art PNGs: use the page surface, not a black plate. */
.figure-frame.figure-dark-art {
  background: var(--bg-elevated);
}

.figure-frame.figure-dark-art img {
  background: transparent;
}

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.gif-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem 0.6rem;
  margin-top: 0.35rem;
  align-items: stretch;
}

.roi-slide {
  width: min(1480px, 94vw);
}

.roi-map-shell {
  margin-top: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
}

.roi-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 55%, white);
}

.roi-map-group {
  display: inline-flex;
  gap: 0.3rem;
}

.roi-map-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.roi-map-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
}

.roi-map-btn.is-active {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

.roi-map-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0 auto;
  font-size: 0.75rem;
  color: var(--muted);
}

.roi-map-ramp {
  width: 7rem;
  height: 0.55rem;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: linear-gradient(
    90deg,
    rgb(15, 50, 95),
    rgb(70, 130, 180),
    rgb(240, 240, 235),
    rgb(200, 90, 60),
    rgb(120, 30, 40)
  );
}

.roi-map {
  width: 100%;
  height: min(52vh, 520px);
  background: #e8e6e1;
}

.roi-map-status {
  margin: 0;
  padding: 0.4rem 0.7rem 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.roi-map .leaflet-container {
  font-family: var(--font-body);
  background: #e8e6e1;
}

/*
  Root cause of misalignment: GIFs have different pixel aspect ratios
  (three ~square globes vs tc_tracks 1003x655). If the media box sizes to the
  image, the cyclone card stays shorter. Lock the media row in px via grid.
*/
.figure-frame.figure-gif {
  margin: 0;
  display: grid;
  grid-template-rows: 280px auto;
  grid-template-columns: minmax(0, 1fr);
  align-self: stretch;
  height: auto;
  min-height: 0;
}

.figure-frame.figure-gif .figure-gif-media {
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #0f1114;
  overflow: hidden;
  position: relative;
}

.figure-frame.figure-gif .figure-gif-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  object-fit: contain;
  object-position: center center;
  background: transparent;
}

.figure-frame.figure-gif > figcaption {
  grid-row: 2;
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.credit {
  margin: 0.7rem 0 0;
  max-width: 58rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

.credit a {
  color: var(--muted);
  text-underline-offset: 0.1em;
}

.credit a:hover {
  color: var(--accent);
}

.duo-charts .figure-chart {
  background: #fff;
}

.duo-charts .figure-chart img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(48vh, 480px);
  object-fit: contain;
  background: #fff;
}

@media (max-width: 900px) {
  .duo-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .gif-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .duo {
    grid-template-columns: 1fr;
  }

  .gif-board {
    grid-template-columns: 1fr;
  }

  .figure-frame.figure-gif {
    grid-template-rows: 240px auto;
  }
}

.omt-layout {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(1480px, 94vw);
}

.omt-copy {
  text-align: left;
}

.omt-copy h2 {
  max-width: 28ch;
  margin-bottom: 0.55rem;
}

.omt-copy .lede {
  max-width: 62rem;
}

.slide-refs {
  width: min(1200px, 94vw);
}

.slide-refs h2 {
  max-width: none;
  margin-bottom: 1.1rem;
}

.ref-list {
  margin: 0;
  padding-left: 1.6rem;
  color: var(--ink);
  font-size: clamp(0.92rem, 1.15vw, 1.08rem);
  line-height: 1.35;
}

.ref-list li + li {
  margin-top: 0.32rem;
}

.ref-list li {
  padding-left: 0.35rem;
}

.figure-omt {
  margin: 0;
  background: #fff;
}

.figure-omt img {
  width: 100%;
  height: auto;
  max-height: min(52vh, 540px);
  object-fit: contain;
  background: #fff;
}

/* Idle-hide: menu + bottom bar share is-chrome-visible. */
.chrome {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem calc(0.65rem + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

body.is-chrome-visible .chrome,
body.is-drawer-open .chrome {
  opacity: 1;
  pointer-events: auto;
}

.chrome-hotzone {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 29;
  height: 3.25rem;
}

.nav-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
}

.nav-btn[aria-pressed="true"] {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.progress {
  flex: 1;
  display: flex;
  gap: 0.28rem;
  min-width: 0;
  align-items: center;
}

.progress button {
  flex: 1;
  height: 28px;
  border: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.progress button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  border-radius: 0;
  background: rgba(26, 26, 26, 0.14);
}

.progress button.is-current::after,
.progress button.is-done::after {
  background: var(--accent);
}

.progress button.is-done::after {
  opacity: 0.4;
}

.progress button:hover::after {
  height: 2px;
  background: rgba(var(--accent-rgb), 0.55);
}

.progress button.is-current:hover::after,
.progress button.is-done:hover::after {
  background: var(--accent);
  opacity: 1;
}

.counter {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.85rem;
  min-width: 4.5rem;
  text-align: right;
}

.menu-toggle {
  position: fixed;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 30;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

body.is-chrome-visible .menu-toggle,
body.is-drawer-open .menu-toggle {
  opacity: 1;
  pointer-events: auto;
}

.menu-hotzone {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 29;
  width: 4.5rem;
  height: 4.5rem;
}

.menu-toggle:hover,
.menu-toggle.is-open {
  border-color: rgba(var(--accent-rgb), 0.55);
}

.menu-toggle-bar {
  display: block;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform 160ms ease, opacity 160ms ease;
}

.menu-toggle.is-open .menu-toggle-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.menu-toggle.is-open .menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open .menu-toggle-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 28;
  background: rgba(26, 26, 26, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 0ms linear 220ms;
}

body.is-drawer-open .drawer-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0ms;
}

.slide-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 29;
  display: flex;
  flex-direction: column;
  width: min(360px, 90vw);
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: var(--bg-elevated);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 220ms ease, visibility 0ms linear 220ms;
}

body.is-drawer-open .slide-drawer {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0ms;
}

.slide-drawer-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0.85rem 3.6rem 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.slide-drawer-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.slide-drawer-list {
  /* min-height: 0 is required for a flex child to scroll instead of grow */
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-content: start;
  scrollbar-gutter: stable;
}

.slide-drawer-list::-webkit-scrollbar {
  width: 10px;
}

.slide-drawer-list::-webkit-scrollbar-thumb {
  background: rgba(26, 26, 26, 0.28);
  border-radius: 1px;
}

.slide-drawer-list::-webkit-scrollbar-track {
  background: rgba(26, 26, 26, 0.06);
}

.slide-thumb {
  position: relative;
  flex: 0 0 auto;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.slide-thumb:hover,
.slide-thumb:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.45);
  outline: none;
}

.slide-thumb.is-current {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.slide-thumb-num {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 2;
  min-width: 1.35rem;
  padding: 0.08rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  text-align: center;
}

.slide-thumb.is-current .slide-thumb-num {
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--accent);
}

.slide-thumb-stage {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  /* JS also sets an explicit pixel height; both keep the frame from collapsing */
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}

.slide-thumb-buffer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 120ms ease;
}

.slide-thumb-buffer.is-front {
  opacity: 1;
  z-index: 1;
}

.slide-thumb-scale {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
}

.slide-thumb-scale .slide {
  position: relative !important;
  inset: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  width: 960px;
  height: 540px;
  padding: 1.1rem 1rem;
  overflow: hidden;
  display: grid;
  place-items: start center;
  background: var(--bg);
}

.slide-thumb-scale .slide-inner,
.slide-thumb-scale .slide-inner.split,
.slide-thumb-scale .slide-inner.split-bench,
.slide-thumb-scale .precision-hardware-layout,
.slide-thumb-scale .omt-layout,
.slide-thumb-scale .distributed-run-slide,
.slide-thumb-scale .roi-slide,
.slide-thumb-scale .wf-slide {
  width: 900px !important;
  max-width: none !important;
}

.slide-thumb-scale .chrome,
.slide-thumb-scale .menu-toggle,
.slide-thumb-scale .lightbox,
.slide-thumb-scale .slide-drawer,
.slide-thumb-scale .drawer-backdrop {
  display: none !important;
}

.slide-thumb-map-placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  background:
    linear-gradient(180deg, #d8d4cc 0%, #e8e6e1 100%);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.slide-thumb-map-placeholder::after {
  content: "Map preview";
}

/* --- Workflow animation (Engine chapter) --- */
.wf-slide {
  width: min(1480px, 94vw);
}

.wf-slide h2 {
  max-width: none;
  margin-bottom: 0.4rem;
}

.wf-stages {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) 28px minmax(0, 1.8fr) 28px minmax(0, 0.8fr);
  gap: 0.55rem;
  margin: 0.35rem 0 0.15rem;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}

.wf-stages span:nth-child(2) {
  grid-column: 3;
}

.wf-stages span:nth-child(3) {
  grid-column: 5;
}

.wf-module-hint {
  margin: -0.1rem 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
}

.wf {
  --wf-delay: 160ms;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) 28px minmax(0, 1.8fr) 28px minmax(0, 0.8fr);
  gap: 0.55rem;
  align-items: stretch;
  margin-top: 0.55rem;
}

.wf-col {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.wf-module {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem 0.6rem 0.65rem;
  border: 1px solid rgba(26, 26, 26, 0.16);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  opacity: 0;
  transform: translateY(10px);
  animation: wf-rise 520ms ease forwards;
  animation-delay: calc(var(--s, 0) * var(--wf-delay));
}

.wf-optional {
  border-style: dashed;
  border-color: rgba(var(--steel-rgb), 0.35);
  background: color-mix(in srgb, var(--bg-elevated) 90%, #ebe9e4);
}

.wf-engine {
  flex: 1;
  border-color: rgba(var(--accent-rgb), 0.55);
  border-width: 1.5px;
}

.wf-route-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  align-items: stretch;
}

.wf-route {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wf-route-label {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
  text-transform: none;
}

.wf-route-scheduled .wf-route-label {
  color: var(--muted);
}

.wf-route-board .wf-module {
  flex: 1;
}

.wf-route-board .wf-node {
  padding: 0.34rem 0.4rem;
  font-size: clamp(0.78rem, 0.85vw, 0.9rem);
}

.wf-route-board .wf-sub {
  font-size: 0.68rem;
  line-height: 1.28;
}

.wf-route-board .wf-module-hint {
  font-size: 0.64rem;
}

.wf-module-title {
  margin: 0 0 0.15rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink);
}

.wf-module-title span {
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.wf-node {
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: clamp(0.9rem, 1.1vw, 1.02rem);
  line-height: 1.28;
  font-weight: 600;
  color: var(--ink);
  opacity: 0;
  transform: translateY(8px);
  animation: wf-rise 480ms ease forwards;
  animation-delay: calc(var(--s, 0) * var(--wf-delay) + 80ms);
}

.wf-sub {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.wf-in {
  border-color: rgba(90, 78, 68, 0.28);
  background: #efeae4;
}

.wf-op {
  border-color: rgba(var(--accent-rgb), 0.32);
  background: #f3e8eb;
}

.wf-out {
  border-color: rgba(58, 58, 58, 0.28);
  background: #eaeaea;
}

.wf-final {
  border-width: 2px;
  border-color: rgba(26, 26, 26, 0.4);
  background: #dddcdb;
}

.wf-dashed {
  border-style: dashed;
  opacity: 0;
}

.wf-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr);
  gap: 0.35rem;
  align-items: center;
}

.wf-engine-branch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: center;
  row-gap: 0.15rem;
}

.wf-engine-prepare,
.wf-engine-prepare-arrow,
.wf-engine-run {
  grid-column: 1 / -1;
}

.wf-engine-prepare-arrow {
  margin-top: -0.05rem;
  margin-bottom: -0.05rem;
}

.wf-dashed-arrow {
  background: repeating-linear-gradient(
    0deg,
    var(--accent) 0 4px,
    transparent 4px 8px
  );
}

.wf-dashed-arrow::after {
  border-color: var(--accent);
}

.wf-mini-arrow {
  height: 2px;
  background: var(--accent);
  position: relative;
  opacity: 0;
  animation: wf-rise 400ms ease forwards;
  animation-delay: calc(var(--s, 0) * var(--wf-delay) + 120ms);
}

.wf-mini-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--accent);
  border-top: 2px solid var(--accent);
  transform: translateY(-50%) rotate(45deg);
}

.wf-down-arrow {
  position: relative;
  display: block;
  width: 2px;
  height: 0.65rem;
  margin: -0.1rem auto;
  background: var(--accent);
  opacity: 0;
  animation: wf-rise 400ms ease forwards;
  animation-delay: calc(var(--s, 0) * var(--wf-delay) + 120ms);
}

.wf-down-arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateX(-50%) rotate(45deg);
}

.wf-rail {
  position: relative;
  align-self: center;
  height: 55%;
  min-height: 120px;
  width: 2px;
  margin: 0 auto;
  background: rgba(var(--accent-rgb), 0.35);
  opacity: 0;
  animation: wf-rise 500ms ease forwards;
  animation-delay: calc(var(--s, 0) * var(--wf-delay));
}

.wf-rail::before,
.wf-rail::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 10px;
  height: 2px;
  background: rgba(var(--accent-rgb), 0.35);
  transform: translateX(-50%);
}

.wf-rail::before {
  top: 0;
}

.wf-rail::after {
  bottom: 0;
}

.wf-rail-main {
  /* horizontal connector look via rotate in wide layouts handled by width */
  width: 100%;
  height: 2px;
  min-height: 0;
  align-self: center;
  background: rgba(var(--accent-rgb), 0.4);
}

.wf-rail-main::before,
.wf-rail-main::after,
.wf-rail-out::before,
.wf-rail-out::after {
  display: none;
}

.wf-rail-out {
  width: 100%;
  height: 2px;
  min-height: 0;
  align-self: center;
  background: repeating-linear-gradient(
    90deg,
    rgba(var(--accent-rgb), 0.55) 0 5px,
    transparent 5px 9px
  );
}

.wf-pulse {
  position: absolute;
  top: 50%;
  left: 0;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: wf-flow 2.4s ease-in-out infinite;
  animation-delay: calc(var(--s, 0) * var(--wf-delay) + 700ms);
}

.wf-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.78rem;
}

.wf-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.wf-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid transparent;
}

.wf-swatch-in {
  background: #efeae4;
  border-color: rgba(90, 78, 68, 0.28);
}

.wf-swatch-op {
  background: #f3e8eb;
  border-color: rgba(var(--accent-rgb), 0.32);
}

.wf-swatch-out {
  background: #eaeaea;
  border-color: rgba(58, 58, 58, 0.28);
}

.wf-swatch-dash {
  background: #f3e8eb;
  border-color: rgba(var(--accent-rgb), 0.32);
  border-style: dashed;
}

@media (max-width: 1180px) {
  .wf-route-board {
    grid-template-columns: 1fr;
  }
}

@keyframes wf-rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes wf-flow {
  0% {
    opacity: 0;
    left: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    left: calc(100% - 2px);
  }
}

@media (max-width: 900px) {
  .wf-stages {
    display: none;
  }

  .wf {
    grid-template-columns: 1fr;
  }

  .wf-rail-main,
  .wf-rail-out {
    width: 2px;
    height: 28px;
    min-height: 28px;
    margin: 0 auto;
  }

  .wf-pulse {
    left: 50%;
    top: 0;
    margin-left: -5px;
    animation-name: wf-flow-v;
  }
}

@keyframes wf-flow-v {
  0% {
    opacity: 0;
    top: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    top: calc(100% - 2px);
  }
}

