/* Ru BizGen presentations — Soft Product Light */

:root {
  --bg: #e6eaf5;
  --bg-elevated: #ffffff;
  --bg-panel: #f7f8fc;
  --bg-muted: #e8ecf5;
  --ink: #262c40;
  --ink-muted: #5c6578;
  --blue: #476bf0;
  --blue-hover: #3a5ad6;
  --blue-deep: #2f4bc4;
  --blue-dim: rgba(71, 107, 240, 0.12);
  --blue-soft: rgba(71, 107, 240, 0.06);
  --line: #dde3ef;
  --line-strong: #c8d0e0;
  --danger: #e03b4c;
  --ok: #1f9d63;
  --shadow: 0 6px 18px rgba(38, 44, 64, 0.12), 0 24px 64px rgba(71, 107, 240, 0.08);
  --shadow-sm: 0 2px 10px rgba(38, 44, 64, 0.06);
  --font: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Code", "Consolas", monospace;
  --toc-w: 280px;
  --content-max: 1440px;
  --content-w: min(100%, var(--content-max));
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --slide-dur: 420ms;
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(50% 50% at 50% 50.05%, #f5dfeefa, rgba(244, 218, 213, 0) 95.31%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 17.18%),
    linear-gradient(112.95deg, rgba(255, 255, 255, 0.4) 4.11%, rgba(255, 255, 255, 0) 23.6%),
    linear-gradient(0deg, rgba(246, 246, 246, 0.3), rgba(246, 246, 246, 0.3)),
    linear-gradient(86.29deg, #ede7e7 3.46%, #efeef2 21.07%, #f0f2f9 35.01%, #eff6ff 57.86%, #e6eaf5 96.95%),
    #fff;
  background-attachment: fixed;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--blue-soft);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--blue-deep), var(--blue), #8aa0f8);
  z-index: 50;
  transition: width var(--slide-dur) var(--ease);
}

.layout {
  display: grid;
  grid-template-columns: var(--toc-w) 1fr;
  height: 100vh;
  height: 100dvh;
  gap: 1rem;
  padding: 1.1rem 1.25rem 1.25rem 1.1rem;
  box-sizing: border-box;
}

.toc-toggle {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 40;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.toc {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 1.35rem 1rem 1.75rem;
  border: 1px solid rgba(221, 227, 239, 0.9);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: var(--shadow);
}

.toc__brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 0.2rem;
}

.toc__sub {
  margin: 0 0 1.2rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.toc nav {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.toc a {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border-left: 2px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.toc__num {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-muted);
  min-width: 1.5rem;
  transition: color 0.2s;
}

.toc a:hover {
  color: var(--ink);
  background: var(--blue-soft);
}

.toc a:hover .toc__num {
  color: var(--blue);
}

.toc a[aria-current="true"] {
  color: var(--blue);
  border-left-color: var(--blue);
  background: var(--blue-dim);
  font-weight: 700;
}

.toc a[aria-current="true"] .toc__num {
  color: var(--blue);
}

.toc__hint {
  margin: auto 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.toc__hint kbd,
.kbd-bar kbd {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--bg-muted);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.12rem 0.38rem;
  color: var(--ink);
}

/* ——— Deck viewport ——— */

.main {
  position: relative;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
}

.card-shell {
  position: relative;
  height: 100%;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.deck-chrome {
  position: absolute;
  top: 1.35rem;
  right: 1.75rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  pointer-events: none;
}

.slide-counter {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--blue);
  background: #fff;
  border: 1.5px solid var(--blue);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 12px rgba(71, 107, 240, 0.16);
}

.deck-nav {
  display: flex;
  gap: 0.35rem;
  pointer-events: auto;
}

.deck-nav__btn {
  width: 2.15rem;
  height: 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  color: var(--ink);
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.deck-nav__btn:hover:not(:disabled) {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  transform: translateY(-1px);
}

.deck-nav__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.deck-nav__btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

section.deck {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2.25rem clamp(1.5rem, 3.2vw, 2.75rem) 3rem;
  max-width: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(18%, 0, 0);
  transition:
    transform var(--slide-dur) var(--ease-out),
    opacity calc(var(--slide-dur) * 0.85) var(--ease),
    visibility 0s linear var(--slide-dur);
  will-change: transform, opacity;
  z-index: 0;
}

section.deck.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  transition-delay: 0s;
  z-index: 2;
}

section.deck.is-enter-from-right {
  opacity: 0;
  visibility: visible;
  transform: translate3d(22%, 0, 0);
  transition: none;
}

section.deck.is-enter-from-left {
  opacity: 0;
  visibility: visible;
  transform: translate3d(-22%, 0, 0);
  transition: none;
}

section.deck.is-exit-to-left {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transform: translate3d(-18%, 0, 0);
  z-index: 1;
  transition-delay: 0s;
}

section.deck.is-exit-to-right {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transform: translate3d(18%, 0, 0);
  z-index: 1;
  transition-delay: 0s;
}

.deck > *:not(.hero__glow):not(.layers-layout):not(.fill-stack):not(.duo-grid):not(.map-layout):not(.pred-flow):not(.pred-formula):not(.method-grid):not(.rule-grid):not(.bench-story) {
  max-width: var(--content-w);
}

/* Fill remaining viewport — content-sized, with chrome clearance */
.deck.deck--fill {
  --fill-chrome-pad: 2rem; /* breathing room above card bottom edge */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  width: 100%;
  padding: 2.25rem clamp(1.5rem, 3.2vw, 2.75rem) var(--fill-chrome-pad);
  box-sizing: border-box;
  overflow: hidden;
}

.deck.deck--fill.is-active {
  overflow: hidden;
}

.deck.deck--fill > * {
  max-width: none !important;
  width: 100%;
}

.deck.deck--fill > .section-title {
  flex: 0 0 auto;
  padding-right: 8rem;
}

.deck.deck--fill > .section-lead {
  flex: 0 0 auto;
  margin-bottom: 0.75rem;
  max-width: 60rem !important;
  font-size: 1.02rem;
}

.deck.deck--fill > .pred-flow {
  flex: 0 0 auto;
  margin-bottom: 0.65rem;
}

/* Content panels: hug content, constrained width, never eat chrome zone */
.deck.deck--fill > .fill-stack,
.deck.deck--fill > .duo-grid,
.deck.deck--fill > .map-layout,
.deck.deck--fill > .method-grid,
.deck.deck--fill > .layers-layout,
.deck.deck--fill > .bench-story {
  flex: 0 1 auto;
  height: auto;
  min-height: 0;
  width: 100%;
  max-width: min(1080px, 100%) !important;
  margin-inline: auto;
  overflow: hidden;
}

#benchmarks.deck.deck--fill,
#benchmarks.deck.deck--fill.is-active {
  overflow-x: hidden;
  overflow-y: auto;
}

.deck.deck--fill > .bench-story {
  flex: 0 1 auto;
  max-width: min(1600px, 100%) !important;
  width: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 0;
  overflow: visible;
}

.deck.deck--fill > .method-grid.method-grid--2x2 {
  flex: 1 1 auto;
  max-width: min(1200px, 100%) !important;
}

.deck.deck--fill > .map-layout {
  flex: 1 1 auto;
  max-width: min(1600px, 100%) !important;
  width: 100%;
  align-items: stretch;
}

.deck.deck--fill > .layers-layout {
  flex: 0 1 auto;
  max-width: min(1400px, 100%) !important;
  width: 100%;
  align-items: stretch;
  align-self: center;
  margin-inline: auto;
  margin-block: auto;
}

.deck.deck--fill > .duo-grid:not(.duo-grid--pred) {
  flex: 0 1 auto;
  max-width: min(1600px, 100%) !important;
  width: 100%;
  height: auto;
  align-self: stretch;
}

.deck.deck--fill > .duo-grid.duo-grid--pred {
  flex: 0 1 auto;
  max-width: min(1600px, 100%) !important;
  width: 100%;
  gap: 1.15rem;
  margin-bottom: 0.75rem;
}

.deck.deck--fill > .pred-formula {
  flex: 0 0 auto;
  margin-top: 0;
  max-width: min(1600px, 100%) !important;
  margin-inline: auto;
  width: 100%;
}

.deck.deck--fill > .pred-flow {
  max-width: min(1600px, 100%) !important;
  margin-inline: auto;
  width: 100%;
  margin-bottom: 0.85rem;
}

/* ——— Duo cards (Library / Predicates) ——— */

.duo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  max-width: none;
  align-items: stretch;
}

.duo-grid--pred {
  gap: 1.15rem;
}

.duo-grid--pred .duo-card {
  padding: 1.25rem 1.35rem 1.3rem;
  gap: 0.65rem;
}

.duo-grid--pred .duo-card__head .method-card__title {
  font-size: 1.2rem;
}

.duo-grid--pred .duo-card__text {
  font-size: 1rem;
  line-height: 1.5;
}

.duo-grid--pred .duo-card__list {
  font-size: 0.96rem;
  line-height: 1.5;
}

.duo-grid--pred .duo-card .code {
  font-size: 0.8rem !important;
  line-height: 1.45 !important;
  padding: 0.8rem 0.95rem !important;
  margin-top: 0.15rem;
}

.duo-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
}

.duo-card__head {
  flex: 0 0 auto;
}

.duo-card__head .method-card__kicker {
  font-size: 0.78rem;
}

.duo-card__head .method-card__title {
  font-size: 1.15rem;
}

.duo-card__where {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue);
}

.duo-card__text {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.duo-card__list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.92rem;
  color: var(--ink-muted);
  flex: 0 0 auto;
  line-height: 1.45;
}

.duo-card__list li {
  margin-bottom: 0.25rem;
}

.duo-card__aside {
  margin: 0.35rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

.duo-card .code {
  margin: 0.15rem 0 0;
  flex: 0 0 auto;
  font-size: 0.74rem !important;
  line-height: 1.4 !important;
  padding: 0.65rem 0.75rem !important;
  overflow-x: auto;
}

.mini-layers {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  margin: 0.15rem 0 0.25rem;
}

.mini-layers__row {
  background: var(--blue-soft);
  border: 1px solid rgba(71, 107, 240, 0.28);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue-deep);
}

.mini-layers__arrow {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.mini-slices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin: 0.15rem 0 0.25rem;
}

.mini-slices__chip {
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.mini-slices__note {
  flex: 1 1 100%;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* ——— Predicates flow ——— */

.pred-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: stretch;
  gap: 0.55rem 0.65rem;
  width: 100%;
  max-width: none;
}

.pred-flow__step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  flex: 1 1 0;
  min-width: 10rem;
  padding: 0.7rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.pred-flow__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue);
}

.pred-flow__step code {
  background: transparent;
  padding: 0;
  font-size: 0.95rem;
  color: var(--ink);
}

.pred-flow__arrow {
  color: var(--blue);
  font-size: 1.25rem;
  font-weight: 700;
  align-self: center;
  flex: 0 0 auto;
}

.pred-formula {
  display: grid;
  grid-template-columns: minmax(220px, 28%) 1fr;
  gap: 0.85rem 1.1rem;
  align-items: stretch;
  width: 100%;
  max-width: none;
}

.pred-formula .code {
  margin: 0;
  font-size: 0.86rem !important;
  line-height: 1.45 !important;
  padding: 0.85rem 1rem !important;
}

.pred-formula__note {
  margin: 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--blue);
  background: linear-gradient(90deg, var(--blue-dim), transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  line-height: 1.45;
}

/* ——— Project map ——— */

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 1rem 1.25rem;
  width: 100%;
  max-width: none;
  align-items: stretch;
}

.graph.graph--fill {
  margin: 0;
  max-width: none;
  height: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1.1rem 1.2rem;
  box-sizing: border-box;
}

.graph.graph--fill svg {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 280px;
  max-height: none;
  aspect-ratio: auto;
  display: block;
}

.graph__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-top: 0.55rem;
  flex: 0 0 auto;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.graph__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.graph__swatch {
  display: inline-block;
  width: 1.35rem;
  height: 0;
  border-top: 2.5px solid var(--blue);
}

.graph__swatch--dash {
  border-top-style: dashed;
  border-top-color: #8b95a8;
}

.map-side {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
  height: 100%;
  align-self: stretch;
  overflow: auto;
}

.map-mod {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  cursor: pointer;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.map-mod.is-active {
  border-color: var(--blue);
  background: var(--blue-dim);
  box-shadow: 0 0 0 2px var(--blue-soft);
}

.map-mod--arch {
  border-style: dashed;
}

.map-mod__name {
  margin: 0 0 0.15rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue);
}

.map-mod__text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

.callout--tight {
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.86rem;
  line-height: 1.4;
  flex: 0 0 auto;
}

.fill-stack {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
  width: 100%;
  max-width: none;
}

.fill-stack--split {
  gap: 0.65rem;
}

.method-row {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(180px, 22%) 1fr;
  gap: 0.75rem 1.5rem;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-sm);
  min-height: 0;
  width: 100%;
}

.method-row--accent {
  background: var(--blue-soft);
  border-color: rgba(71, 107, 240, 0.28);
}

.method-row--code {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  flex: 1.4 1 0;
}

.method-row--code .code,
.method-row--code .callout {
  margin: 0;
}

.method-row__head {
  min-width: 0;
}

.method-row__body {
  min-width: 0;
}

.method-row__body .code {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  padding: 0.85rem 1rem;
}

.method-row__body .method-card__text {
  margin-bottom: 0.3rem;
  font-size: 1.05rem;
  line-height: 1.45;
}

.method-row .method-card__kicker {
  font-size: 0.78rem;
}

.method-row .method-card__title {
  font-size: clamp(1.15rem, 1.35vw, 1.35rem);
  margin-bottom: 0.2rem;
}

.method-row .method-card__list {
  font-size: 1rem;
}

.method-row .method-card__hint {
  margin-top: 0.3rem;
  font-size: 0.9rem;
}

.rule--row {
  flex: 1 1 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1.25rem;
  align-items: center;
  margin: 0;
  padding: 0.75rem 1.15rem;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.rule--row .rule__name {
  font-size: 0.98rem;
  word-break: break-word;
  margin-bottom: 0.15rem;
}

.rule--row .rule__because {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.rule--row .rule__human {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
}

.rule--row .code {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  padding: 0.55rem 0.75rem;
  line-height: 1.4;
}

.rule--row .break {
  margin: 0;
  align-self: start;
  justify-self: end;
  white-space: nowrap;
}

.rule-row__main {
  min-width: 0;
}

.deck.deck--dense {
  padding-top: 2rem;
  padding-bottom: 2.25rem;
}

.deck.deck--dense .section-lead {
  margin-bottom: 1rem;
}

.deck.deck--dense .rule {
  margin: 0.65rem 0;
  padding: 0.85rem 1rem;
}

.deck.deck--dense pre.code,
.deck.deck--dense .code-block {
  margin: 0.55rem 0 0.65rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.78rem;
  line-height: 1.45;
}

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  padding-top: 2rem;
}

.hero > * {
  max-width: 640px;
  position: relative;
}

.hero__glow {
  position: absolute;
  width: min(420px, 70vw);
  height: min(420px, 70vw);
  left: -8%;
  top: 18%;
  background: radial-gradient(circle, rgba(71, 107, 240, 0.22), transparent 68%);
  pointer-events: none;
  z-index: 0;
  filter: blur(8px);
  max-width: none;
}

.hero__eyebrow {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}

.hero__brand {
  font-size: clamp(2.6rem, 6.5vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.96;
  margin: 0 0 0.85rem;
  color: var(--ink);
}

.hero__title {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--blue);
}

.hero__lead {
  margin: 0 0 2rem;
  color: var(--ink-muted);
  font-size: 1.08rem;
  max-width: 36rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  align-self: start;
  width: fit-content;
  gap: 0.5rem;
  border: none;
  background: var(--blue);
  color: #fff;
  padding: 0.8rem 1.3rem;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(71, 107, 240, 0.32);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  background: var(--blue-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(71, 107, 240, 0.4);
}

.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

h2.section-title {
  font-size: clamp(1.55rem, 2.8vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  color: var(--ink);
  padding-right: 7rem;
}

.section-lead {
  color: var(--ink-muted);
  margin: 0 0 1.35rem;
  max-width: 48rem;
  font-size: 1.02rem;
}

h3 {
  font-size: 1.15rem;
  margin: 2rem 0 0.65rem;
  color: var(--ink);
  font-weight: 700;
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  color: var(--ink-muted);
}

li {
  margin-bottom: 0.4rem;
}

li strong {
  color: var(--ink);
}

.pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 1.5rem 0 2rem;
}

.pipeline__step {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  box-shadow: none;
}

.pipeline__arrow {
  color: var(--blue);
  font-size: 1.1rem;
}

pre.code,
.code-block {
  margin: 1rem 0 1.25rem;
  padding: 1.05rem 1.15rem;
  /* IntelliJ Light editor */
  background: #ffffff;
  border: 1px solid rgba(71, 107, 240, 0.35);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: #080808;
  box-shadow: var(--shadow-sm);
}

/* IntelliJ Light token colors */
.code-block .tok-kw {
  color: #0033b3;
}
.code-block .tok-str {
  color: #067d17;
}
.code-block .tok-fn {
  color: #00627a;
}
.code-block .tok-cm {
  color: #8c8c8c;
}
.code-block .tok-type {
  color: #000000;
}
.code-block .tok-hi {
  background: rgba(71, 107, 240, 0.14);
  outline: 1px solid rgba(71, 107, 240, 0.4);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s;
}
.code-block .tok-hi.is-active,
.code-block .tok-hi:hover {
  background: rgba(71, 107, 240, 0.26);
}

.glossary {
  display: grid;
  gap: 0.55rem;
  margin: 1.25rem 0;
}

.glossary__item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.glossary__item[open] {
  border-color: rgba(71, 107, 240, 0.35);
}

.glossary__item summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--blue);
  list-style: none;
  font-weight: 500;
}

.glossary__item summary::-webkit-details-marker {
  display: none;
}

.glossary__item summary::before {
  content: "+";
  display: inline-block;
  width: 1.2rem;
  color: var(--ink-muted);
}

.glossary__item[open] summary::before {
  content: "−";
}

.glossary__item .body {
  padding: 0 1rem 1rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.glossary__item.is-spotlight {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0.5rem;
}

.chip {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.chip:hover,
.chip.is-active {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
}

.chip:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.callout {
  border-left: 3px solid var(--blue);
  background: linear-gradient(90deg, var(--blue-soft), transparent);
  padding: 0.95rem 1.1rem;
  margin: 1.25rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.callout--cyan {
  border-left-color: var(--blue);
  background: linear-gradient(90deg, var(--blue-dim), transparent);
}

.callout strong {
  color: var(--ink);
}

.graph {
  margin: 1.25rem 0;
  padding: 1.15rem 1.35rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: var(--content-w);
}

.graph svg {
  width: 100%;
  height: auto;
  display: block;
}

.graph__node {
  cursor: pointer;
}

.graph__node rect {
  fill: var(--bg-panel);
  stroke: var(--line-strong);
  stroke-width: 1.5;
  transition: stroke 0.25s, fill 0.25s;
}

.graph__node text {
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  pointer-events: none;
}

.graph__node:hover rect,
.graph__node.is-active rect {
  stroke: var(--blue);
  fill: var(--blue-dim);
}

.graph__edge {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.75;
  opacity: 0.45;
  transition: opacity 0.3s, stroke-width 0.3s;
}

.graph__edge.is-lit {
  opacity: 1;
  stroke-width: 2.5;
  stroke-dasharray: 6 4;
  animation: dash 1.2s linear infinite;
}

.graph__edge--dashed {
  stroke-dasharray: 5 4;
  stroke: #8b95a8;
}

.graph__caption {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
  min-height: 1.4em;
  flex: 0 0 auto;
}

@keyframes dash {
  to {
    stroke-dashoffset: -20;
  }
}

.layers-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.35fr);
  gap: 1rem 1.25rem;
  align-items: stretch;
  max-width: none;
  width: 100%;
  min-height: 0;
}

.layers-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: auto;
  padding: 1.15rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.layers-svg {
  margin: 0;
  width: 100%;
  max-width: 360px;
  height: auto;
  min-height: 280px;
}

.layers-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: auto;
}

.layers-body .rule {
  margin: 0;
  flex: 0 1 auto;
  height: auto;
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.layers-body .rule .code {
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0.7rem 0.85rem;
  margin: 0.2rem 0 0.35rem;
}

.layers-body .rule .break {
  margin-top: 0.35rem;
}

.compact-list {
  margin: 0.25rem 0 0.15rem;
  padding-left: 1.1rem;
  font-size: 0.92rem;
  line-height: 1.4;
}

.compact-list li {
  margin-bottom: 0.2rem;
}

.code--sm {
  font-size: 0.76rem !important;
  line-height: 1.4 !important;
  padding: 0.65rem 0.8rem !important;
}

.rule--compact {
  margin: 0.75rem 0;
  padding: 0.9rem 1rem;
}

.rule--compact .rule__because {
  margin-bottom: 0.5rem;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  max-width: var(--content-w);
  align-items: stretch;
}

.rule-grid--2 {
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  max-width: min(1600px, 100%);
  width: 100%;
  align-items: start;
}

.rule-grid--2 .rule .code {
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.65rem 0.8rem;
  margin: 0.35rem 0 0.5rem;
}

.rule-grid .rule {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.rule-grid .rule .break {
  margin-top: auto;
}

/* ——— Benchmark naming story ——— */

.bench-story {
  width: 100%;
  max-width: none;
  min-height: 0;
}

.bench-contract {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
  padding: 0.85rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
}

.bench-contract__pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.55rem 0.35rem 0.35rem;
  background: var(--bg-panel);
  border: 1px solid rgba(71, 107, 240, 0.22);
  border-radius: 8px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.bench-contract__n {
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  border-radius: 6px;
}

.bench-contract__meta {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.bench-contract__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.2;
}

.bench-contract__meta code {
  font-size: 0.7rem;
  background: transparent;
  padding: 0;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

.bench-contract__op {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
  text-align: center;
  padding: 0.05rem 0;
}

.bench-contract__formula {
  margin: 0.2rem 0 0;
  text-align: center;
  font-size: 0.74rem;
  color: var(--ink-muted);
  line-height: 1.35;
}

.bench-main {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.35fr);
  gap: 0.75rem 1rem;
  flex: 0 0 auto;
  min-height: 0;
  align-items: start;
}

.bench-examples {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.bench-lead {
  margin: 0;
  padding: 1rem 1.05rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
}

.bench-lead__title {
  margin: 0 0 0.45rem;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.bench-lead__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

.bench-pairs-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.05rem 1.05rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
  min-width: 0;
}

.bench-examples__head {
  flex: 0 0 auto;
}

.bench-examples__title {
  margin: 0.1rem 0 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.bench-pairs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.bench-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.15fr);
  gap: 0.2rem 0.45rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.bench-pair--alt {
  background: linear-gradient(90deg, var(--blue-soft), var(--bg-panel));
  border-color: rgba(71, 107, 240, 0.28);
}

.bench-pair__gen {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  padding: 0;
  overflow-wrap: anywhere;
}

.bench-pair__arrow {
  color: var(--blue);
  font-weight: 700;
  font-size: 1rem;
}

.bench-pair__bench {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue-deep);
  background: transparent;
  padding: 0;
  overflow-wrap: anywhere;
}

.bench-hierarchy {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  margin: 0.1rem 0;
  flex: 0 0 auto;
  padding: 0.65rem 0.75rem;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.bench-hierarchy__row {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue-deep);
  padding: 0.35rem 0.55rem;
  background: var(--blue-soft);
  border: 1px solid rgba(71, 107, 240, 0.22);
  border-radius: 8px;
}

.bench-hierarchy__fork {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.bench-hierarchy__branch {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  min-width: 0;
}

.bench-hierarchy__arrow {
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink-muted);
  line-height: 1;
}

.bench-hierarchy__branch .bench-hierarchy__row {
  font-size: 0.74rem;
  padding: 0.4rem 0.45rem;
}

.bench-gates {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  min-width: 0;
  min-height: 0;
  height: auto;
}

.bench-gate {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.65rem;
  flex: 0 0 auto;
  min-height: 0;
  margin: 0;
  padding: 1rem 1.05rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: visible;
}

.bench-gate__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  flex: 0 0 auto;
}

.bench-gate__n {
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue-deep);
  background: var(--blue-dim);
  border-radius: 7px;
}

.bench-gate__head .method-card__kicker {
  margin: 0 0 0.1rem;
}

.bench-gate__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.bench-gate__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-muted);
  flex: 0 0 auto;
}

.bench-gate .code {
  margin: 0;
  font-size: 0.72rem !important;
  line-height: 1.45 !important;
  padding: 0.75rem 0.9rem !important;
  flex: 0 0 auto;
  overflow: visible;
  white-space: pre;
}

.bench-gate__fail {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink-muted);
  padding-left: 0.55rem;
  border-left: 2px solid var(--danger);
  flex: 0 0 auto;
}

@media (max-height: 900px) {
  .bench-story {
    gap: 0.5rem;
  }

  .bench-contract {
    padding: 0.5rem 0.55rem;
    gap: 0.2rem;
  }

  .bench-contract__n {
    width: 1.65rem;
    height: 1.65rem;
    font-size: 0.8rem;
  }

  .bench-contract__formula {
    font-size: 0.7rem;
  }

  .bench-main {
    gap: 0.55rem 0.75rem;
  }

  .bench-examples {
    gap: 1rem;
  }

  .bench-gates {
    gap: 1rem;
    height: auto;
  }

  .bench-examples__title {
    font-size: 1rem;
  }

  .bench-gate {
    flex: 0 0 auto;
    justify-content: flex-start;
    padding: 0.85rem 0.9rem;
    gap: 0.5rem;
  }

  .bench-gate__title {
    font-size: 0.9rem;
  }

  .bench-gate__text {
    font-size: 0.8rem;
  }

  .bench-gate .code {
    font-size: 0.68rem !important;
    padding: 0.45rem 0.6rem !important;
  }
}

/* Methodology slides */
.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: var(--content-w);
  align-items: stretch;
}

.method-grid--2x2 {
  grid-template-columns: 1fr 1fr;
  max-width: none;
  gap: 1rem;
  flex: 1 1 auto;
  align-content: stretch;
}

.method-grid--2x2 .method-card {
  margin: 0;
  padding: 1.25rem 1.35rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.method-grid--2x2 .method-card__kicker {
  margin: 0;
  font-size: 0.78rem;
}

.method-grid--2x2 .method-card__title {
  margin: 0;
  font-size: 1.15rem;
}

.method-grid--2x2 .method-card__text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
}

.method-grid--2x2 .method-card__list {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.method-grid--2x2 .code {
  margin: 0.35rem 0 0;
}

.method-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.method-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.method-card:hover {
  border-color: rgba(71, 107, 240, 0.3);
  box-shadow: var(--shadow);
}

.method-card__kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}

.method-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.method-card__title code {
  font-size: 0.95em;
  background: transparent;
  padding: 0;
  color: var(--blue-deep);
}

.method-card__text {
  margin: 0 0 0.65rem;
  color: var(--ink-muted);
  font-size: 0.93rem;
}

.method-card__list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.method-card__list li {
  margin-bottom: 0.2rem;
}

.method-card__hint {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue);
}

.method-card pre.code {
  margin-bottom: 0.35rem;
}

.ext-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1rem 1.5rem;
  max-width: var(--content-w);
  align-items: start;
}

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

.ext-col .method-card {
  margin: 0;
}

.ext-col .callout {
  margin: 0;
}

.history-layout {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 220px);
  gap: 1.5rem;
  align-items: start;
  max-width: var(--content-w);
}

.pitch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  max-width: var(--content-w);
}

.sell-cta {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  background: var(--bg-panel);
  border: 1px solid rgba(71, 107, 240, 0.22);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  max-width: var(--content-w);
}

.sell-cta--compact {
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
}

.layers-svg .layer-box {
  fill: var(--bg-elevated);
  stroke: var(--blue);
  stroke-width: 1.5;
}

.layers-svg text {
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}

.layers-svg .arrow {
  stroke: var(--blue);
  stroke-width: 2;
  fill: none;
  marker-end: url(#arrowHead);
}

.rule {
  margin: 1.5rem 0;
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rule:hover {
  border-color: rgba(71, 107, 240, 0.28);
  box-shadow: var(--shadow);
}

.rule__name {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--blue);
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.rule__because {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin: 0 0 0.85rem;
  font-style: italic;
}

.rule__human {
  margin: 0.75rem 0;
}

.rule__flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0 1rem;
  font-size: 0.88rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.badge--ok {
  background: rgba(31, 157, 99, 0.1);
  color: var(--ok);
  border: 1px solid rgba(31, 157, 99, 0.3);
}

.badge--bad {
  background: rgba(224, 59, 76, 0.08);
  color: var(--danger);
  border: 1px solid rgba(224, 59, 76, 0.28);
}

.rule details.break {
  margin-top: 0.5rem;
}

.rule details.break summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 0.92rem;
  list-style: none;
  font-weight: 500;
}

.rule details.break summary::-webkit-details-marker {
  display: none;
}

.rule details.break .break-body {
  margin-top: 0.65rem;
  padding: 0.75rem;
  background: rgba(224, 59, 76, 0.05);
  border: 1px solid rgba(224, 59, 76, 0.2);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.group-title {
  margin: 2.5rem 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.35rem;
  color: var(--ink);
}

.checklist {
  list-style: none;
  padding: 0;
}

.checklist li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.55rem;
  color: var(--ink-muted);
}

.checklist li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--blue);
}

.kbd-bar {
  /* Hint lives in .toc__hint — floating bar overlaps fill cards */
  display: none;
}

/* History + pitch */
.fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.fact {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: border-color 0.2s, transform 0.2s;
}

.fact:hover {
  border-color: rgba(71, 107, 240, 0.3);
  transform: translateY(-1px);
}

.fact__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--blue);
  font-weight: 700;
}

.fact__value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.fact__note {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.history-points {
  color: var(--ink-muted);
  margin: 0 0 1rem;
}

.history-links {
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin: 0;
}

.qr-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.qr-card__img {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
  margin: 0 auto 0.85rem;
  border-radius: 8px;
}

.qr-card__title {
  margin: 0 0 0.25rem;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
}

.qr-card__url {
  margin: 0;
  font-size: 0.82rem;
  word-break: break-all;
}

.pitch {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  min-height: 7.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.pitch:hover {
  border-color: rgba(71, 107, 240, 0.3);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.pitch__title {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  color: var(--blue);
  font-weight: 700;
}

.pitch__text {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ——— Unified slide content rail ———
   Every desktop slide uses the same 1440px frame. Text remains left-aligned,
   while grids and cards share stable outer edges between slides. */
@media (min-width: 901px) {
  section.deck {
    --content-offset: max(0px, calc((100% - var(--content-max)) / 2));
  }

  section.deck:not(.hero) > *:not(.section-lead):not(.btn) {
    width: 100%;
    max-width: var(--content-w) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  section.deck:not(.hero) > .section-lead {
    width: min(60rem, 100%);
    max-width: 60rem !important;
    margin-left: var(--content-offset) !important;
    margin-right: auto !important;
  }

  section.deck > .btn,
  .hero > *:not(.hero__glow):not(.btn) {
    margin-left: var(--content-offset);
    margin-right: auto;
  }

  .hero > *:not(.hero__glow):not(.btn) {
    width: min(640px, 100%);
  }

  .hero > .btn {
    margin-left: var(--content-offset);
  }
}

.sell-cta__label {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  font-weight: 700;
}

.sell-cta__text {
  margin: 0.2rem 0 0;
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
    height: auto;
  }

  .history-layout,
  .fact-grid,
  .pitch-grid,
  .layers-layout,
  .method-grid,
  .method-grid--3,
  .method-grid--2x2,
  .ext-layout,
  .rule-grid,
  .method-row,
  .rule--row,
  .duo-grid,
  .map-layout,
  .pred-formula,
  .bench-main {
    grid-template-columns: 1fr;
  }

  .bench-gates {
    height: auto;
  }

  .bench-gate {
    flex: 0 0 auto;
    justify-content: flex-start;
  }

  .bench-pair {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .bench-pair__arrow {
    transform: rotate(90deg);
  }

  .deck.deck--fill {
    --fill-chrome-pad: 5rem; /* bottom nav on mobile */
    display: block;
    overflow-y: auto;
    height: auto;
    min-height: 100dvh;
  }

  .deck.deck--fill > .fill-stack,
  .deck.deck--fill > .duo-grid,
  .deck.deck--fill > .map-layout,
  .deck.deck--fill > .method-grid,
  .deck.deck--fill > .layers-layout,
  .deck.deck--fill > .bench-story,
  .deck.deck--fill > .pred-formula,
  .deck.deck--fill > .pred-flow {
    max-width: none !important;
  }

  .map-mod {
    flex: none;
  }

  .graph.graph--fill svg {
    aspect-ratio: 640 / 320;
    flex: none;
    height: auto;
    min-height: 0;
  }

  .layers-svg {
    max-width: 280px;
    margin: 0 auto;
  }

  .layers-diagram {
    height: auto;
    padding: 1.15rem;
  }

  .qr-card {
    max-width: 240px;
    margin: 0 auto;
  }

  .layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
    gap: 0;
    padding: 0;
  }

  .toc {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 85vw);
    height: 100%;
    border-radius: 0;
    border: none;
    border-right: 1px solid rgba(221, 227, 239, 0.9);
    transform: translateX(-105%);
    transition: transform 0.3s var(--ease);
    z-index: 45;
    box-shadow: 8px 0 32px rgba(26, 31, 44, 0.12);
  }

  .toc.is-open {
    transform: none;
  }

  .toc-toggle {
    display: inline-flex;
  }

  .kbd-bar {
    display: none;
  }

  .main {
    min-height: 100dvh;
    height: 100dvh;
    padding: 0.75rem;
  }

  .card-shell {
    border-radius: 18px;
  }

  section.deck {
    padding: 4.5rem 1.15rem 5rem;
  }

  h2.section-title {
    padding-right: 0;
  }

  .deck-chrome {
    top: auto;
    bottom: 1.35rem;
    right: 1.35rem;
    left: auto;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --slide-dur: 0ms;
  }

  section.deck,
  section.deck.is-active,
  section.deck.is-exit-to-left,
  section.deck.is-exit-to-right,
  section.deck.is-enter-from-left,
  section.deck.is-enter-from-right {
    transition: none;
    transform: none;
  }

  .graph__edge.is-lit {
    animation: none;
  }

  .progress {
    transition: none;
  }

  .fact:hover,
  .pitch:hover,
  .btn:hover,
  .deck-nav__btn:hover:not(:disabled) {
    transform: none;
  }
}
