/* ==========================================================================
   CLIFT project page — dark "tech" system shared with the paper film.
   Tokens mirror clift_video/src/theme.ts.
   ========================================================================== */

:root {
  --bg: #000000;
  --surface: #121a29;
  --surface-2: #161e2e;
  --border: #243044;
  --text: #e8edf5;
  --text-dim: #8da3c0;
  --text-faint: #7d8fa9;
  --brand: #5b9dff;
  --brand-bright: #7cb3ff;
  --brand2: #8b5cf6;
  --brand2-bright: #a78bfa;
  --pos: #34d399;
  --neg: #fb7185;
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --radius: 16px;
  --container: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow { max-width: 700px; }

::selection { background: rgba(91, 157, 255, 0.35); }

/* ---------------- nav ---------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(36, 48, 68, 0.6);
}
.nav-brand {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.5px;
  text-decoration: none;
  background-image: linear-gradient(105deg, var(--brand-bright), var(--brand2-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: rgba(91, 157, 255, 0.10); }
.nav-links a.active { color: var(--brand-bright); background: rgba(91, 157, 255, 0.12); }
.nav.scrolled { background: rgba(0, 0, 0, 0.93); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
@supports (animation-timeline: scroll()) {
  .progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 60;
    transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--brand), var(--brand2));
    animation: growX linear both;
    animation-timeline: scroll(root);
  }
  @keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  overflow: visible;
  padding: 96px 0 40px;
  text-align: center;
}
.hero-glow {
  position: absolute;
  inset: 0 0 -420px;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 50% 12%, rgba(91, 157, 255, 0.16) 0%, rgba(91, 157, 255, 0.05) 45%, transparent 74%),
    radial-gradient(900px 560px at 76% 70%, rgba(139, 92, 246, 0.11) 0%, transparent 72%);
}
.hero-glow::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -260px;
  width: 1200px;
  height: 1200px;
  margin-left: -600px;
  background: conic-gradient(from 0deg, transparent, rgba(91, 157, 255, 0.09) 12%, transparent 32%, rgba(139, 92, 246, 0.08) 55%, transparent 78%);
  filter: blur(64px);
  animation: heroSpin 42s linear infinite;
}
@keyframes heroSpin { to { transform: rotate(1turn); } }
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(141, 163, 192, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(640px 340px at 50% 26%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(640px 340px at 50% 26%, #000 20%, transparent 75%);
}
.hero .container { position: relative; }

.kicker {
  margin: 0 0 22px;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--brand-bright);
}

.title { margin: 0 auto; max-width: 900px; }
.title-name {
  display: block;
  font-size: clamp(56px, 7vw, 84px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 18px;
  background-size: 220% 100%;
  animation: sheen 7s ease-in-out infinite alternate;
}
@keyframes sheen {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}
.title-deck {
  display: block;
  font-size: clamp(19px, 2.3vw, 27px);
  font-weight: 600;
  line-height: 1.42;
  letter-spacing: -0.01em;
  color: #dce4f2;
  max-width: 800px;
  margin: 0 auto;
  text-wrap: balance;
}
.grad,
.grad-inline {
  background-image: linear-gradient(105deg, var(--brand-bright), var(--brand2-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.grad { filter: drop-shadow(0 0 22px rgba(91, 157, 255, 0.27)); }
.grad-inline { font-weight: 700; }

.authors {
  margin: 30px 0 8px;
  font-size: 16px;
  font-weight: 500;
  color: #b9c5da;
  line-height: 1.75;
}
.authors sup { color: var(--text-faint); font-weight: 600; font-size: 11px; }
.authors a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(91, 157, 255, 0.32);
  transition: color 0.18s ease, border-color 0.18s ease;
}
.authors a:hover {
  color: var(--brand-bright);
  border-bottom-color: var(--brand-bright);
}
.affils {
  margin: 0 0 32px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.4px;
  color: var(--text-dim);
}
.affils sup { color: var(--text-faint); }

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 44px;
  margin: 0 0 34px;
}
.logo {
  filter: brightness(0) invert(0.78);
  opacity: 0.8;
}
.logo-cal { height: 40px; }
.logo-gdm { height: 32px; }
.logo-nv { height: 32px; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.btn:hover { border-color: rgba(91, 157, 255, 0.55); background: var(--surface-2); transform: translateY(-1px); }
.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-primary {
  border: none;
  background-image: linear-gradient(105deg, var(--brand), var(--brand2));
  color: #fff;
  box-shadow: 0 8px 26px rgba(91, 157, 255, 0.28);
}
.btn-primary:hover { background-image: linear-gradient(105deg, var(--brand-bright), var(--brand2-bright)); }
.btn-primary svg { fill: currentColor; stroke: none; }
.btn-soon { color: var(--text-faint); cursor: default; font-family: var(--font); }
.btn-soon:hover { border-color: var(--border); background: var(--surface); transform: none; }
.btn-soon::after {
  content: 'soon';
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 2px;
}

/* ---------------- sections ---------------- */

.section { padding: 104px 0; position: relative; }
.section:not(#film)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91, 157, 255, 0.22) 30%, rgba(139, 92, 246, 0.22) 70%, transparent);
}
.section-alt {
  border: 0;
  background:
    radial-gradient(1000px 480px at 15% 0%, rgba(91, 157, 255, 0.05), transparent 70%),
    radial-gradient(900px 480px at 85% 100%, rgba(139, 92, 246, 0.045), transparent 70%);
}
.section-kicker::before {
  content: '';
  display: inline-block;
  width: 26px;
  height: 2px;
  margin-right: 12px;
  vertical-align: 4px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
}
.prose .section-kicker { color: var(--brand-bright); margin: 0 0 14px; text-align: left; }
.section-kicker {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-bright);
}
.section-title {
  margin: 0 0 24px;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.sub-title { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 48px 0 14px; }

.prose p { margin: 0 0 18px; color: #c9d3e4; line-height: 1.7; text-align: justify; hyphens: auto; }
.prose p:not(.section-kicker) {
  column-count: 2;
  column-gap: 56px;
  column-fill: balance;
  widows: 2;
  orphans: 2;
  -webkit-hyphenate-limit-chars: 7 4 3;
  hyphenate-limit-chars: 7 4 3;
}
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); }

[id] { scroll-margin-top: 76px; }

/* ---------------- film ---------------- */

#film.section { padding: 12px 0 64px; }
#film .container { max-width: 1200px; position: relative; }
#film .container::before {
  content: '';
  position: absolute;
  inset: -40px -60px 20px;
  z-index: -1;
  background: radial-gradient(55% 55% at 50% 38%, rgba(91, 157, 255, 0.20), rgba(139, 92, 246, 0.12) 55%, transparent 78%);
  filter: blur(56px);
}
.film-frame { position: relative; }
.film-play { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; cursor: pointer; }
.film-play span {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(11, 15, 23, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(124, 179, 255, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
}
.film-play span::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-46%, -50%);
  border-style: solid;
  border-width: 13px 0 13px 22px;
  border-color: transparent transparent transparent #fff;
}
.film-play:hover span { transform: scale(1.06); }
.film-frame {
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid transparent;
  background:
    linear-gradient(#000, #000) padding-box,
    linear-gradient(135deg, rgba(124, 179, 255, 0.45), rgba(255, 255, 255, 0.10) 40%, rgba(167, 139, 250, 0.45)) border-box;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}
.film-frame video { display: block; width: 100%; height: auto; }

.chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  justify-content: center;
}
.chip {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chip:hover { color: var(--text); border-color: rgba(91, 157, 255, 0.55); }
.chip.active {
  color: var(--brand-bright);
  border-color: rgba(91, 157, 255, 0.65);
  background: rgba(91, 157, 255, 0.10);
}

.transcript {
  margin-top: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.transcript summary {
  cursor: pointer;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-dim);
  list-style: none;
}
.transcript summary::-webkit-details-marker { display: none; }
.transcript summary::before { content: '▸ '; color: var(--brand-bright); }
.transcript[open] summary::before { content: '▾ '; }
.transcript summary:hover { color: var(--text); }
.transcript-body { padding: 4px 24px 20px; }
.transcript-body p { margin: 0 0 14px; font-size: 15.5px; color: var(--text-dim); }

/* ---------------- flywheel band ---------------- */

.band {
  padding: 40px 0;
  border-top: 1px solid rgba(36, 48, 68, 0.45);
  border-bottom: 1px solid rgba(36, 48, 68, 0.45);
  background:
    radial-gradient(760px 300px at 50% 50%, rgba(91, 157, 255, 0.06) 0%, transparent 75%),
    rgba(18, 26, 41, 0.35);
}
.band-inner { text-align: center; }
.chant {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.chant-pill {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid rgba(91, 157, 255, 0.35);
  border-radius: 12px;
  padding: 8px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.chant-arrow { color: var(--brand-bright); font-size: 18px; }
.chant-pi {
  margin-left: 14px;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--brand2-bright);
}
.band-line { margin: 16px auto 0; max-width: 640px; color: var(--text-dim); font-size: 15.5px; }
.band-line em { color: var(--brand-bright); font-style: normal; font-weight: 600; }

/* ---------------- figures ---------------- */

.figure { margin: 40px 0; }
.figure-plate {
  background: #f2f2f2;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 24px 64px rgba(0, 0, 0, 0.45);
}
.figure-plate img { display: block; width: 100%; height: auto; border-radius: 8px; filter: brightness(0.95) saturate(1.03); }
.figure-plate--photo {
  padding: 0;
  border: 1px solid transparent;
  background:
    linear-gradient(#05070c, #05070c) padding-box,
    linear-gradient(135deg, rgba(124, 179, 255, 0.35), rgba(255, 255, 255, 0.08) 40%, rgba(167, 139, 250, 0.35)) border-box;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.figure-plate--photo img { border-radius: 15px; filter: none; }
.figure figcaption {
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-dim);
  text-align: justify;
  hyphens: auto;
  column-count: 2;
  column-gap: 48px;
  widows: 2;
  orphans: 2;
  -webkit-hyphenate-limit-chars: 7 4 3;
  hyphenate-limit-chars: 7 4 3;
}
.figure figcaption strong {
  column-span: all;
  display: block;
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-bright);
}

.figure-row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 40px 0; }
.figure-row .figure { margin: 0; display: flex; flex-direction: column; }
.figure-row .figure-plate { flex: 1; display: flex; align-items: center; }
.figure-row .figure-plate img { width: 100%; }

/* ---------------- cards ---------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px 56px;
  margin: 48px 0;
  counter-reset: finding;
}
.card {
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(91, 157, 255, 0.35);
  border-radius: 0;
  padding: 22px 4px 0;
  box-shadow: none;
  counter-increment: finding;
}
.card::before {
  content: 'Finding 0' counter(finding);
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-bright);
  margin-bottom: 10px;
}
.card-step {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-bright);
}
.card-num {
  display: block;
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 10px;
  background-image: linear-gradient(105deg, var(--brand-bright), var(--brand2-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.card h3 { margin: 0 0 10px; font-size: 18.5px; font-weight: 700; letter-spacing: -0.2px; }
.card p { margin: 0; font-size: 15px; color: var(--text-dim); }

/* ---------------- results ---------------- */

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 8px 0 44px;
}
.task-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 60%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.task-card:hover {
  transform: translateY(-3px);
  border-color: rgba(91, 157, 255, 0.4);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}
.task-video { position: relative; aspect-ratio: 25 / 16; background: #000; }
.task-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.task-meta { border-top: 1px solid rgba(36, 48, 68, 0.7); padding: 18px 22px 22px; }
.task-name { margin: 0 0 6px; font-weight: 700; font-size: 16.5px; }
.task-nums { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.num-base { font-family: var(--mono); font-size: 19px; color: var(--text-faint); }
.num-arrow { color: var(--text-faint); }
.num-final {
  font-family: var(--mono);
  font-size: 46px;
  font-weight: 600;
  letter-spacing: -1px;
  color: var(--pos);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(52, 211, 153, 0.25);
}
.task-bar { position: relative; height: 4px; border-radius: 999px; background: rgba(141, 163, 192, 0.16); margin: 12px 0 0; }
.task-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--pos));
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.35);
  transition: width 1.3s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}
.task-card.reveal.in .task-bar-fill { width: var(--w); }
.task-bar-notch { position: absolute; top: -3px; bottom: -3px; width: 2px; background: rgba(141, 163, 192, 0.55); }
.task-card .num-delta { opacity: 0; transform: scale(0.8); transition: opacity 0.3s ease 1.5s, transform 0.3s ease 1.5s; }
.task-card.reveal.in .num-delta { opacity: 1; transform: none; }
.num-delta {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pos);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.30);
  border-radius: 999px;
  padding: 2px 9px;
}
.task-sub { margin: 8px 0 0; font-size: 13px; color: var(--text-faint); }

/* table */

.table-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 56px 0;
}
.table-card h3 { margin: 0 0 6px; font-size: 19px; font-weight: 700; }
.table-caption { margin: 0 0 18px; font-size: 14px; color: var(--text-dim); }
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 640px;
}
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid rgba(36, 48, 68, 0.7); }
th { border-bottom: 1px solid rgba(141, 163, 192, 0.35); }
th {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}
td { color: #c9d3e4; }
td:nth-child(n + 4), th:nth-child(n + 4) { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tr.ours td { background: linear-gradient(90deg, rgba(91, 157, 255, 0.13), rgba(91, 157, 255, 0.02)); }
tbody tr:not(.ours):hover td { background: rgba(91, 157, 255, 0.04); }
tr.ours td:first-child { border-left: 2px solid var(--brand); }
tr.ours strong { color: var(--pos); }

/* ---------------- feature rows ---------------- */

.feature { display: flex; flex-direction: column; margin: 96px 0 0; }
.section-title + .feature { margin-top: 48px; }
.feature + .figure { margin-top: 96px; }
#method .feature { margin-top: 88px; border-top: 1px solid rgba(36, 48, 68, 0.55); padding-top: 48px; }
.feature-copy {
  order: -1;
  margin: 0 0 26px;
}
.clip-frame {
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid transparent;
  background:
    linear-gradient(#000, #000) padding-box,
    linear-gradient(135deg, rgba(124, 179, 255, 0.35), rgba(255, 255, 255, 0.08) 40%, rgba(167, 139, 250, 0.35)) border-box;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.clip-frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.feature-copy h3 {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.feature-copy p { margin: 0; font-size: 17px; color: #c9d3e4; line-height: 1.75; text-align: justify; hyphens: auto; -webkit-hyphenate-limit-chars: 7 4 3; hyphenate-limit-chars: 7 4 3; }
.feature-copy .card-step { margin-bottom: 12px; }

/* ---------------- scroll reveal ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------------- bibtex ---------------- */

.bibtex-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
}
.bibtex-card pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: #c9d3e4;
}
.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover { color: var(--text); border-color: rgba(91, 157, 255, 0.55); }
.copy-btn.copied { color: var(--pos); border-color: rgba(52, 211, 153, 0.5); }

/* ---------------- footer ---------------- */

.footer {
  padding: 44px 0 52px;
  border-top: 1px solid rgba(36, 48, 68, 0.45);
  text-align: center;
  font-size: 14.5px;
  color: var(--text-dim);
}
.footer p { margin: 0 0 8px; }
.footer-dim { color: var(--text-faint); font-size: 13px; }

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .task-grid { grid-template-columns: 1fr; }
  .feature { margin: 64px 0 0; }
  .figure-row { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .chapters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  }
  .chapters::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  .nav-links {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { flex: 0 0 auto; padding: 5px 8px; font-size: 13px; }
  .nav { padding: 10px 16px; }
  .nav-links a { padding: 5px 8px; font-size: 13px; }
  .hero { padding: 64px 0 52px; }
  .authors { font-size: 15.5px; }
  .affils { font-size: 12.5px; }
  .section { padding: 56px 0; }
  .feature { margin: 48px 0 0; }
  #method .feature { margin-top: 56px; padding-top: 36px; }
  .figure { margin: 28px 0; }
  .prose p:not(.section-kicker) { column-count: 1; }
  .figure figcaption { column-count: 1; }
  .links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 340px; margin: 0 auto; }
  .btn { justify-content: center; }
  .chant-pi { margin-left: 0; width: 100%; }
}

/* focus visibility */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: 2px;
  border-radius: 6px;
}
