/* ==========================================================================
   Dynamic Physical Adversarial LED Patterns via Reinforcement Learning
   NeurIPS 2026 — project page
   Visual system taken from the conference deck:
     paper  #F5F4EF   ink  #1A1E26   deep ink #12161D
     accent #7030A0   slate #4A5260  Space Grotesk / Inter
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --paper:       #F5F4EF;
  --paper-2:     #ECEAE3;
  --card:        #FCFBF8;
  --ink:         #1A1E26;
  --ink-deep:    #12161D;
  --line:        #DDDAD2;
  --line-2:      #C9C5BC;
  --muted:       #5B6270;
  --muted-2:     #7E8694;
  --slate:       #4A5260;
  --slate-2:     #5F6B7E;
  --slate-3:     #A3ADBB;
  --accent:      #7030A0;
  --accent-2:    #8E4BC0;
  --accent-soft: #CB95D1;
  --accent-wash: #F1E8F6;
  --tan:         #C6AE97;

  --on-dark:       #F2EFE8;
  --on-dark-muted: #BCBBB5;

  --max:    1180px;
  --narrow: 820px;
  --gut:    clamp(16px, 5vw, 56px);

  --r-sm: 6px;
  --r:    12px;
  --r-lg: 18px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --disp: "Space Grotesk", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(26, 30, 38, .05);
  --shadow:    0 2px 8px rgba(26, 30, 38, .06), 0 1px 2px rgba(26, 30, 38, .04);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--disp);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink-deep);
  color: var(--on-dark);
  padding: 12px 18px;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip:focus { left: 0; }

/* ---------- layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.wrap--narrow { max-width: var(--narrow); }

section { padding-block: clamp(56px, 8vw, 104px); }
section + section { border-top: 1px solid var(--line); }

.band-alt { background: var(--paper-2); }

.eyebrow {
  font-family: var(--disp);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-2);
  max-width: 120px;
}

.sec-title {
  font-size: clamp(26px, 3.6vw, 40px);
  margin-bottom: .5em;
}

.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--slate);
  max-width: 68ch;
}

.note {
  font-size: 13.5px;
  color: var(--muted-2);
  margin-top: 20px;
  line-height: 1.6;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 244, 239, .86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 60px;
}

.nav__brand {
  font-family: var(--disp);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav__brand:hover { text-decoration: none; }

.nav__tag {
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  background: var(--accent-wash);
  border-radius: 999px;
  padding: 3px 9px;
  font-weight: 600;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 7px 11px;
  border-radius: var(--r-sm);
  transition: color .15s, background .15s;
}
.nav__links a:hover { color: var(--ink); background: rgba(26, 30, 38, .05); text-decoration: none; }
.nav__links a.is-active { color: var(--accent); background: var(--accent-wash); }

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font: 600 13px/1 var(--disp);
  color: var(--ink);
  cursor: pointer;
}

/* ---------- buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--disp);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); }

.btn--ghost {
  background: transparent;
  color: var(--on-dark);
  border-color: rgba(242, 239, 232, .28);
}
.btn--ghost:hover { border-color: rgba(242, 239, 232, .6); background: rgba(242, 239, 232, .08); }

.btn--light {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line-2);
}
.btn--light:hover { border-color: var(--accent-soft); color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  background: var(--ink-deep);
  color: var(--on-dark);
  overflow: hidden;
  padding-block: clamp(48px, 7vw, 92px) clamp(48px, 7vw, 84px);
  border-top: none;
}

/* LED-matrix motif, echoing the garment */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(203, 149, 209, .5) 1px, transparent 1.6px);
  background-size: 22px 22px;
  opacity: .16;
  -webkit-mask-image: radial-gradient(120% 90% at 18% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(120% 90% at 18% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  right: -140px; top: -180px;
  background: radial-gradient(circle, rgba(112, 48, 160, .38) 0%, transparent 65%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--disp);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent-soft);
  border: 1px solid rgba(203, 149, 209, .35);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 26px;
}
.hero__badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(203, 149, 209, .18);
}

.hero h1 {
  font-size: clamp(32px, 5.2vw, 58px);
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin-bottom: 20px;
}

.hero__sub {
  font-size: clamp(17px, 1.9vw, 21px);
  color: var(--on-dark-muted);
  max-width: 44ch;
  margin-bottom: 30px;
  line-height: 1.5;
}

.hero__authors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  margin-bottom: 8px;
}
.hero__author {
  font-family: var(--disp);
  font-size: 17px;
  font-weight: 600;
  color: var(--on-dark);
}
.hero__author span {
  display: block;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--on-dark-muted);
  letter-spacing: 0;
}
.hero__author a { color: var(--accent-soft); font-size: 13px; }

.hero__actions { margin-top: 30px; }

.hero__figure {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid rgba(242, 239, 232, .14);
  background: #0d1016;
}
.hero__figure img { width: 100%; }
.hero__figure figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 18px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--on-dark-muted);
  background: linear-gradient(to top, rgba(13, 16, 22, .94), transparent);
}

/* ---------- headline numbers ---------- */
.stats {
  background: var(--ink);
  color: var(--on-dark);
  padding-block: clamp(34px, 4.5vw, 52px);
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(242, 239, 232, .14);
  border: 1px solid rgba(242, 239, 232, .14);
  border-radius: var(--r);
  overflow: hidden;
}
.stat { background: var(--ink); padding: 22px 20px; }
.stat__num {
  font-family: var(--disp);
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
}
.stat__num em {
  font-style: normal;
  font-size: .55em;
  color: var(--accent-soft);
  margin-left: 2px;
}
.stat__label {
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--on-dark-muted);
}

/* ---------- generic cards ---------- */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.card p { font-size: 15px; color: var(--slate); line-height: 1.6; }

.card__kicker {
  font-family: var(--disp);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}

.card--rule { border-top: 3px solid var(--accent); }

.ref {
  display: inline-block;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted-2);
  font-style: italic;
}

/* three-line summary */
.threeline { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
.threeline__row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 26px;
  align-items: baseline;
}
.threeline__row + .threeline__row { border-top: 1px solid var(--line); }
.threeline__k {
  font-family: var(--disp);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.threeline__v { font-size: 16.5px; color: var(--ink); line-height: 1.55; }
.threeline__v strong { font-weight: 600; }

/* callout */
.callout {
  margin-top: 28px;
  background: var(--ink-deep);
  color: var(--on-dark);
  border-radius: var(--r);
  padding: 30px clamp(22px, 3vw, 36px);
  position: relative;
  overflow: hidden;
}
.callout::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(203, 149, 209, .5) 1px, transparent 1.6px);
  background-size: 20px 20px;
  opacity: .12;
  -webkit-mask-image: linear-gradient(100deg, #000, transparent 58%);
  mask-image: linear-gradient(100deg, #000, transparent 58%);
}
.callout > * { position: relative; }
.callout .eyebrow { color: var(--accent-soft); }
.callout .eyebrow::after { background: rgba(242, 239, 232, .2); }
.callout p {
  font-family: var(--disp);
  font-size: clamp(18px, 2.3vw, 25px);
  line-height: 1.38;
  font-weight: 500;
  letter-spacing: -0.015em;
  max-width: 38ch;
}

/* ---------- prior-work strip ---------- */
.prior { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.prior__item {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  padding: 22px 22px 20px;
}
.prior__item h3 { font-size: 17px; margin-bottom: 4px; }
.prior__item span { font-size: 13.5px; color: var(--muted-2); }

/* ---------- spec list (testbed) ---------- */
.spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.spec { background: var(--card); padding: 20px 22px; }
.spec__v {
  font-family: var(--disp);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.1;
}
.spec__k { margin-top: 6px; font-size: 13.5px; color: var(--muted); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
.split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* grid children must be allowed to shrink below their content's min-content width,
   otherwise the scrollable tables push the page sideways on narrow screens */
.split > *, .grid > *, .table-wrap, .bib { min-width: 0; }

.bullets { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.bullets li {
  position: relative;
  padding-left: 26px;
  font-size: 15.5px;
  color: var(--slate);
  line-height: 1.55;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 4px; top: .62em;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---------- figures ---------- */
.fig {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.fig img { width: 100%; border-radius: var(--r-sm); }
.fig figcaption {
  margin-top: 12px;
  padding: 0 4px 2px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.fig figcaption b { color: var(--ink); font-weight: 600; }

.fig--wide { padding: 18px; }

/* ---------- math ---------- */
.math {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 20px 24px;
  overflow-x: auto;
  font-family: "Cambria Math", "Latin Modern Math", Cambria, Georgia, serif;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.9;
  color: var(--ink);
}
.math .v { font-style: italic; }
.math .op { color: var(--muted); padding-inline: 2px; }
.math .lam { color: var(--accent); font-style: italic; }
.math sub { font-size: .66em; font-style: normal; }
.math sup { font-size: .66em; }
.math__label {
  display: block;
  font-family: var(--disp);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
  font-style: normal;
}

/* ---------- method steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.step__n {
  font-family: var(--disp);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.step__n b {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 11.5px;
  letter-spacing: 0;
}
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { font-size: 14.5px; color: var(--slate); }
.step__eq {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
  font-family: "Cambria Math", Cambria, Georgia, serif;
  font-size: 15px;
  color: var(--slate-2);
}

/* ---------- pipeline chain ---------- */
.chain {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 28px;
}
.chain__node {
  flex: 1 1 150px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  text-align: center;
}
.chain__node b {
  display: block;
  font-family: var(--disp);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.chain__node span { font-size: 12.5px; color: var(--muted-2); }
.chain__arrow {
  align-self: center;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}
.chain__node--accent { border-color: var(--accent-soft); background: var(--accent-wash); }

/* ---------- bar comparison ---------- */
.bars { display: grid; gap: 14px; }
.bar__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 7px;
}
.bar__name { font-size: 14.5px; color: var(--slate); font-weight: 500; }
.bar__val {
  font-family: var(--disp);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.bar__track {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.bar__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--slate-3);
  width: 0;
  transition: width .9s cubic-bezier(.22, 1, .36, 1);
}
.is-in .bar__fill { width: calc(var(--v) * 1%); }
.bar--best .bar__fill { background: var(--accent); }
.bar--best .bar__name, .bar--best .bar__val { color: var(--accent); font-weight: 600; }

/* ---------- results table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background-color: var(--card);
  -webkit-overflow-scrolling: touch;
  /* edge shadows appear only while the table actually overflows */
  background-image:
    linear-gradient(to right,  var(--card) 40%, rgba(252, 251, 248, 0)),
    linear-gradient(to left,   var(--card) 40%, rgba(252, 251, 248, 0)),
    radial-gradient(farthest-side at 0 50%,   rgba(26, 30, 38, .16), rgba(26, 30, 38, 0)),
    radial-gradient(farthest-side at 100% 50%, rgba(26, 30, 38, .16), rgba(26, 30, 38, 0));
  background-position: left center, right center, left center, right center;
  background-size: 44px 100%, 44px 100%, 15px 100%, 15px 100%;
  background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll;
}

table.data {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
table.data caption {
  caption-side: bottom;
  text-align: left;
  padding: 14px 20px 16px;
  font-size: 13px;
  color: var(--muted-2);
  line-height: 1.55;
}
table.data th, table.data td {
  padding: 12px 18px;
  text-align: right;
  border-bottom: 1px solid var(--line);
}
table.data thead th {
  font-family: var(--disp);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
table.data th:first-child, table.data td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tr.is-ours { background: var(--accent-wash); }
table.data tr.is-ours td { color: var(--accent); font-weight: 700; border-color: #E3D3EC; }
table.data tr.is-ours td:first-child { color: var(--accent); }
table.data tr.is-muted td { color: var(--muted-2); }
table.data td small { display: block; font-size: 11.5px; color: var(--muted-2); font-weight: 400; margin-top: 1px; }
table.data tr.is-ours td small { color: #8E62AD; }

/* heatmap */
table.heat td.cell {
  position: relative;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}
table.heat td.cell::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: var(--r-sm);
  background: var(--accent);
  opacity: calc(var(--t) * .72);
}
table.heat td.cell span { position: relative; }
table.heat td.cell.is-diag { outline: 2px solid var(--accent); outline-offset: -5px; border-radius: var(--r-sm); }
table.heat thead th { text-align: center; }
table.heat th:first-child { color: var(--muted); font-weight: 500; }

.legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted-2);
}
.legend__scale {
  height: 10px;
  width: 140px;
  border-radius: 999px;
  background: linear-gradient(to right, rgba(112, 48, 160, .08), rgba(112, 48, 160, .72));
  border: 1px solid var(--line-2);
}

/* delta pill */
.delta {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  background: var(--ink-deep);
  color: var(--on-dark);
  border-radius: 999px;
  padding: 10px 22px;
  margin-top: 26px;
}
.delta b {
  font-family: var(--disp);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent-soft);
}
.delta span { font-size: 14px; color: var(--on-dark-muted); }

/* ---------- generalization tiles ---------- */
.deltas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.dtile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
}
.dtile__name { font-family: var(--disp); font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.dtile__row { display: flex; align-items: baseline; gap: 10px; font-family: var(--disp); letter-spacing: -0.02em; }
.dtile__from { font-size: 22px; color: var(--slate-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.dtile__arrow { color: var(--accent); }
.dtile__to { font-size: 30px; font-weight: 600; color: var(--accent); }

/* ---------- bibtex ---------- */
.bib {
  position: relative;
  background: var(--ink-deep);
  border-radius: var(--r);
  overflow: hidden;
}
.bib pre {
  margin: 0;
  padding: 26px clamp(20px, 3vw, 30px);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--on-dark);
  tab-size: 2;
}
.bib .k { color: var(--accent-soft); }
.bib .s { color: #A9D4A0; }
.bib__copy {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(242, 239, 232, .08);
  border: 1px solid rgba(242, 239, 232, .22);
  color: var(--on-dark);
  font: 600 12px/1 var(--disp);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.bib__copy:hover { background: rgba(242, 239, 232, .16); border-color: rgba(242, 239, 232, .45); }
.bib__copy.is-done { color: #A9D4A0; border-color: rgba(169, 212, 160, .5); }

/* ---------- ethics ---------- */
.ethics {
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--tan);
  background: var(--card);
  border-radius: var(--r-sm);
  padding: 22px 26px;
  margin-top: 22px;
}
.ethics h3 { font-size: 16px; margin-bottom: 8px; }
.ethics p { font-size: 15px; color: var(--slate); }

/* ---------- footer ---------- */
.footer {
  background: var(--ink-deep);
  color: var(--on-dark-muted);
  padding-block: 52px 40px;
  border-top: none;
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.footer h2 {
  font-size: clamp(20px, 2.6vw, 26px);
  color: var(--on-dark);
  margin-bottom: 12px;
  max-width: 30ch;
}
.footer p { font-size: 14.5px; line-height: 1.6; max-width: 54ch; }
.footer a { color: var(--accent-soft); }
.footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer__links a { font-size: 14.5px; }
.footer__bar {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(242, 239, 232, .14);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  font-size: 13px;
}

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.22, 1, .36, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__figure { max-width: 420px; }
  .stats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split--even { grid-template-columns: minmax(0, 1fr); }
  .footer__grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 10px var(--gut) 16px;
  }
  .nav__links.is-open { display: flex; }
  .nav__inner { position: relative; }
  .nav__links a { padding: 10px 12px; font-size: 15px; }

  .grid--3, .steps, .prior, .deltas { grid-template-columns: minmax(0, 1fr); }
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .threeline__row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .spec-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .nav__tag { display: none; }
  .nav__toggle { flex: none; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .stats__grid { grid-template-columns: 1fr; }
  .chain__arrow { transform: rotate(90deg); width: 100%; }
  .chain__node { flex-basis: 100%; }
  .hero__figure { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .nav, .hero::before, .hero::after, .bib__copy { display: none; }
  body { background: #fff; }
  section { padding-block: 24px; break-inside: avoid; }
}
