/* ═══════════════════════════════════════════════════════════
   SonoPromptAttack — clinical sonar aesthetic
   No purple gradients. No glassmorphism soup.
   ═══════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;
  --bg: #070b10;
  --bg-elev: #0d141c;
  --bg-alt: #0a1118;
  --line: #1c2a38;
  --line-hot: #2a4558;
  --text: #e6edf4;
  --muted: #7f92a6;
  --faint: #4a5d70;
  --cyan: #3dfff3;
  --cyan-hot: #7dfff8;
  --cyan-dim: rgba(61, 255, 243, 0.12);
  --cyan-mid: rgba(61, 255, 243, 0.35);
  --coral: #ff6b4a;
  --coral-dim: rgba(255, 107, 74, 0.14);
  --coral-border: rgba(255, 107, 74, 0.28);
  --amber: #f0c14a;
  --green: #6dffb0;
  --green-dim: rgba(109, 255, 176, 0.06);
  --green-border: rgba(109, 255, 176, 0.25);
  --btn-primary-fg: #041016;
  --header-bg: rgba(7, 11, 16, 0.88);
  --panel-head: #0a1219;
  --panel-shadow: 0 0 0 1px rgba(61, 255, 243, 0.04), 0 24px 60px rgba(0, 0, 0, 0.45);
  --diff-original-bg: rgba(127, 146, 166, 0.06);
  --table-hover: rgba(61, 255, 243, 0.03);
  --table-sticky-hover: #0e1620;
  --ours-label-bg: rgba(61, 255, 243, 0.1);
  --bar-muted: #3a5568;
  --bar-grad-start: #1a8a82;
  --bar-hot-start: #b84a32;
  --chip-rule: rgba(28, 42, 56, 0.7);
  --paper-glow: linear-gradient(135deg, rgba(61, 255, 243, 0.04) 0%, transparent 45%);
  --nav-mobile-bg: rgba(7, 11, 16, 0.97);
  --scanline-a: rgba(0, 0, 0, 0.035);
  --scanline-opacity: 0.5;
  --noise-opacity: 0.035;
  --link-hover: #fff;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 4px;
  --max: 1120px;
  --header-h: 64px;
}

/* Clinical paper light mode — cool slate, deep teal accents */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f5f8;
  --bg-elev: #ffffff;
  --bg-alt: #e8eef3;
  --line: #cfd9e4;
  --line-hot: #aebccb;
  --text: #0c1520;
  --muted: #4a5d70;
  --faint: #6d8296;
  --cyan: #0a7f78;
  --cyan-hot: #0a6b65;
  --cyan-dim: rgba(10, 127, 120, 0.1);
  --cyan-mid: rgba(10, 127, 120, 0.28);
  --coral: #d9442e;
  --coral-dim: rgba(217, 68, 46, 0.1);
  --coral-border: rgba(217, 68, 46, 0.32);
  --amber: #b8860b;
  --green: #1a8f58;
  --green-dim: rgba(26, 143, 88, 0.08);
  --green-border: rgba(26, 143, 88, 0.3);
  --btn-primary-fg: #ffffff;
  --header-bg: rgba(242, 245, 248, 0.9);
  --panel-head: #eef3f7;
  --panel-shadow: 0 0 0 1px rgba(10, 127, 120, 0.06), 0 18px 40px rgba(12, 21, 32, 0.08);
  --diff-original-bg: rgba(74, 93, 112, 0.06);
  --table-hover: rgba(10, 127, 120, 0.04);
  --table-sticky-hover: #eef4f7;
  --ours-label-bg: rgba(10, 127, 120, 0.12);
  --bar-muted: #9aafc0;
  --bar-grad-start: #0d9a90;
  --bar-hot-start: #c45a42;
  --chip-rule: rgba(207, 217, 228, 0.95);
  --paper-glow: linear-gradient(135deg, rgba(10, 127, 120, 0.06) 0%, transparent 45%);
  --nav-mobile-bg: rgba(242, 245, 248, 0.98);
  --scanline-a: rgba(12, 21, 32, 0.02);
  --scanline-opacity: 0.35;
  --noise-opacity: 0.02;
  --link-hover: #0a6b65;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 10000;
  padding: 0.65rem 1rem;
  background: var(--cyan);
  color: var(--btn-primary-fg);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-decoration: none;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 0.75rem;
}

#top {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* subtle CRT scan + film grain — tasteful, not gimmicky */
.scanline {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--scanline-a) 2px,
    var(--scanline-a) 4px
  );
  opacity: var(--scanline-opacity);
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9997;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
  background: var(--cyan);
  color: var(--btn-primary-fg);
}

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

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

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

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--cyan);
  background: var(--cyan-dim);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

/* ── Header ─────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.theme-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

/* In dark mode, show sun (switch to light); in light, show moon */
[data-theme="dark"] .theme-toggle .icon-sun,
html:not([data-theme="light"]) .theme-toggle .icon-sun {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

[data-theme="light"] .hero-sonar {
  opacity: 0.35;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--text);
}

.logo-mark {
  width: 22px;
  height: 22px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 12px var(--cyan-mid);
}

.logo-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  background: var(--cyan);
  border-radius: 50%;
}

.logo .accent {
  color: var(--cyan);
}

.nav {
  display: flex;
  gap: clamp(0.75rem, 1.4vw, 1.5rem);
}

.nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav a:hover,
.nav a.active {
  color: var(--cyan);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
}

/* ── Hero ───────────────────────────────────────────────── */

.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2.5rem) clamp(3rem, 6vw, 5rem);
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-sonar {
  position: absolute;
  right: -8%;
  top: 50%;
  transform: translateY(-50%);
  width: min(640px, 70vw);
  height: min(640px, 70vw);
  pointer-events: none;
  opacity: 0.55;
}

.hero-sonar .ring {
  position: absolute;
  inset: 0;
  margin: auto;
  border: 1px solid var(--cyan-mid);
  border-radius: 50%;
  animation: sonar-pulse 4.5s ease-out infinite;
}

.hero-sonar .r1 { width: 25%; height: 25%; animation-delay: 0s; }
.hero-sonar .r2 { width: 45%; height: 45%; animation-delay: 0.4s; }
.hero-sonar .r3 { width: 68%; height: 68%; animation-delay: 0.8s; }
.hero-sonar .r4 { width: 92%; height: 92%; animation-delay: 1.2s; }

.sonar-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--cyan), 0 0 40px var(--cyan-mid);
}

.sonar-beam {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46%;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  transform-origin: left center;
  animation: beam-spin 6s linear infinite;
  opacity: 0.55;
}

@keyframes sonar-pulse {
  0% { opacity: 0.7; transform: scale(0.96); }
  70% { opacity: 0.15; }
  100% { opacity: 0; transform: scale(1.05); }
}

@keyframes beam-spin {
  to { transform: rotate(360deg); }
}

.hero-grid {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6.5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 1.25rem;
}

.hero h1 em {
  font-style: italic;
  font-family: var(--display);
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: -0.02em;
}

.hero-authors {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 42em;
  margin: -0.35rem 0 0.45rem;
}

.hero-authors sup,
.hero-affil sup {
  font-size: 0.7em;
  color: var(--cyan);
  margin-left: 0.05em;
}

.hero-affil {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--faint);
  max-width: 42em;
  margin: 0 0 1.25rem;
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 36em;
  margin-bottom: 1.75rem;
}

.lede strong {
  color: var(--text);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--cyan);
  color: var(--btn-primary-fg);
  border-color: var(--cyan);
}

.btn-primary:hover {
  background: var(--cyan-hot);
  color: var(--btn-primary-fg);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-hot);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Hero attack panel */

.hero-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--panel-shadow);
  outline: none;
}

.hero-panel:focus-visible {
  border-color: var(--cyan);
  box-shadow: var(--panel-shadow), 0 0 0 2px var(--cyan-mid);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-head);
}

.panel-tag,
.panel-status {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-tag {
  color: var(--faint);
}

.panel-status {
  color: var(--coral);
}

.flip-demo {
  padding: 1.15rem 1.15rem 1rem;
}

.flip-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.flip-label {
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.flip-value {
  color: var(--cyan);
}

.prompt-diff {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.diff-block {
  border-radius: 3px;
  padding: 0.75rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.5;
  border: 1px solid var(--line);
}

.diff-block.original {
  background: var(--diff-original-bg);
}

.diff-block.attacked {
  background: var(--coral-dim);
  border-color: var(--coral-border);
}

.diff-tag {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.35rem;
}

.diff-block.attacked .diff-tag {
  color: var(--coral);
}

.diff-block p {
  color: var(--muted);
}

.diff-block p mark,
.diff-block p .hl {
  background: transparent;
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid currentColor;
}

.diff-block.attacked p .hl {
  color: var(--coral);
  border-color: var(--coral);
}

.diff-arrow {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
  padding: 0.15rem 0;
}

.pred-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.pred {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border-radius: 3px;
  border: 1px solid var(--line);
}

.pred span {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.2rem;
}

.pred strong {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: lowercase;
}

.pred.clean {
  background: var(--green-dim);
  border-color: var(--green-border);
}

.pred.clean strong {
  color: var(--green);
}

.pred.attacked {
  background: var(--coral-dim);
  border-color: var(--coral-border);
}

.pred.attacked strong {
  color: var(--coral);
}

.pred-arrow {
  font-family: var(--mono);
  color: var(--faint);
  font-size: 1.1rem;
}

.demo-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1rem;
}

.demo-dots button {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: var(--line-hot);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, transform 0.15s;
}

.demo-dots button[aria-selected="true"] {
  background: var(--cyan);
  transform: scale(1.25);
}

.panel-explore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem 1rem;
  border: none;
  border-top: 1px solid var(--line);
  background: var(--panel-head);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.panel-explore:hover {
  color: var(--cyan-hot);
  background: var(--cyan-dim);
}

/* ── Stat strip ──────────────────────────────────────────── */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: var(--max);
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.stat {
  padding: 1.75rem 1.25rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}

.stat:last-child {
  border-right: none;
}

.stat-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  color: var(--cyan);
  line-height: 1;
}

.stat-unit {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--cyan);
}

.stat-desc {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ── Sections ───────────────────────────────────────────── */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 5.5rem) clamp(1rem, 4vw, 2.5rem);
}

.section-alt {
  max-width: none;
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-left: 0;
  padding-right: 0;
}

.section-alt > * {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 4vw, 2.5rem);
  padding-right: clamp(1rem, 4vw, 2.5rem);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.section-label .num {
  color: var(--cyan);
}

.section h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  max-width: 18ch;
}

.section-intro {
  color: var(--muted);
  max-width: 48em;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.explorer-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  margin: 0 0 2.5rem;
}

.explorer-cta-note {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 28rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.two-col p {
  color: var(--muted);
  margin-bottom: 1rem;
}

.two-col p:last-child {
  margin-bottom: 0;
}

.two-col em {
  color: var(--text);
  font-style: italic;
}

.risk-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.risk-card {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 1.1rem 1.2rem;
  border-left: 3px solid var(--cyan);
  transition: border-color 0.15s;
}

.risk-card:hover {
  border-left-color: var(--coral);
}

.risk-icon {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--cyan);
  display: block;
  margin-bottom: 0.4rem;
}

.risk-card h3 {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.risk-card p {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
}

/* ── Method ─────────────────────────────────────────────── */

.method-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: start;
  margin-top: 0.5rem;
}

.method-prose p {
  color: var(--muted);
  margin-bottom: 1rem;
  max-width: 42em;
  font-size: 1.02rem;
}

.method-prose p:last-child {
  margin-bottom: 0;
}

.method-prose strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Paper figures ──────────────────────────────────────── */

.paper-figure {
  margin: 2.5rem auto 0;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  overflow: hidden;
  text-align: center;
}

.paper-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  background: #fff;
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

.paper-figure figcaption {
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
  max-width: none;
  text-align: center;
}

.method-spec {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 1.25rem 1.35rem;
}

.method-spec h3 {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1rem;
  font-weight: 500;
}

.method-spec dl {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.method-spec dl > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}

.method-spec dl > div:first-child {
  border-top: none;
  padding-top: 0;
}

.method-spec dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  text-transform: uppercase;
}

.method-spec dd {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0;
}

/* ── Tables ─────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.tab {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--muted);
  padding: 0.75rem 1.15rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}

.table-caption {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
  letter-spacing: 0.04em;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
}

.data-table th,
.data-table td {
  padding: 0.55rem 0.7rem;
  text-align: right;
  border-bottom: 1px solid var(--line);
}

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--bg);
  z-index: 1;
}

.data-table thead th {
  color: var(--muted);
  font-weight: 500;
  background: var(--bg-elev);
  text-align: center;
  border-bottom: 1px solid var(--line-hot);
}

.data-table thead th:first-child {
  background: var(--bg-elev);
  text-align: left;
}

.data-table .subhead th {
  font-size: 0.62rem;
  color: var(--faint);
  font-weight: 400;
  text-align: right;
}

.data-table tbody tr:hover td {
  background: var(--table-hover);
}

.data-table tbody tr:hover td:first-child {
  background: var(--table-sticky-hover);
}

.data-table tr.ours td {
  background: var(--cyan-dim);
  color: var(--text);
}

.data-table tr.ours td:first-child {
  background: var(--ours-label-bg);
  color: var(--cyan);
  font-weight: 500;
}

.data-table tr.best td strong {
  color: var(--cyan);
}

.table-note {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 52em;
  margin-top: 0.75rem;
}

/* Anatomy bars */

.anatomy-block {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
  align-items: start;
}

.anatomy-copy h3 {
  font-family: var(--display);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.anatomy-copy p {
  color: var(--muted);
  font-size: 0.98rem;
}

.anatomy-note {
  margin-top: 1rem;
  margin-bottom: 0;
}

.anatomy-bars {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.anat-row {
  display: grid;
  grid-template-columns: 90px 1fr 48px;
  gap: 0.65rem;
  align-items: center;
}

.anat-row .name {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.anat-track {
  height: 8px;
  background: var(--line);
  border-radius: 1px;
  overflow: hidden;
}

.anat-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--bar-grad-start), var(--cyan));
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.anat-row.hot .anat-fill {
  background: linear-gradient(90deg, var(--bar-hot-start), var(--coral));
}

.anat-row .val {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text);
  text-align: right;
}

/* ── Quality compare ────────────────────────────────────── */

.compare-table {
  border: 1px solid var(--line);
  background: var(--bg);
  margin-bottom: 0.75rem;
}

.compare-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.compare-row:last-child {
  border-bottom: none;
}

.compare-row.method-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--bg-elev);
}

.method-name {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.method-ex {
  color: var(--text);
  font-size: 0.9rem;
}

.method-ex s {
  color: var(--faint);
}

.ours-row {
  background: var(--cyan-dim);
}

.ours-row .method-name {
  color: var(--cyan);
  font-weight: 600;
}

/* ── Ablation ───────────────────────────────────────────── */

.ablation-chart {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
  max-width: 640px;
}

.bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 56px;
  gap: 0.75rem;
  align-items: center;
}

.bar-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.bar-track {
  height: 22px;
  background: var(--line);
  border-radius: 1px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  background: var(--bar-muted);
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.ours-bar .bar-label {
  color: var(--cyan);
  font-weight: 600;
}

.ours-bar .bar-fill {
  background: linear-gradient(90deg, var(--bar-grad-start), var(--cyan));
  box-shadow: 0 0 16px var(--cyan-dim);
}

.bar-val {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-align: right;
  color: var(--text);
}

/* ── Models ─────────────────────────────────────────────── */

.chip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.chip-group {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 1.2rem;
}

.chip-group h3 {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.chip-group ul {
  list-style: none;
}

.chip-group li {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--chip-rule);
}

.chip-group li:last-child {
  border-bottom: none;
}

/* ── Footer ─────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 2.5rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
}

.footer-inner p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.footer-inner strong {
  color: var(--text);
  font-weight: 600;
}

.footer-inner a {
  color: var(--cyan);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.footer-meta {
  margin-top: 0.4rem;
  font-size: 0.8rem !important;
  color: var(--faint) !important;
}

.footer-meta em {
  font-style: italic;
  color: var(--muted);
}

/* ── Paper ──────────────────────────────────────────────── */

.paper-section {
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

.paper-card {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  border: 1px solid var(--line);
  background: var(--paper-glow), var(--bg-elev);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.paper-venue {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.paper-meta h2 {
  max-width: none;
  font-size: clamp(1.3rem, 2.5vw, 1.65rem);
  margin-bottom: 1.25rem;
}

.paper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-sm {
  padding: 0.5rem 0.85rem;
  font-size: 0.68rem;
}

.cite-block {
  position: relative;
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  overflow: hidden;
}

.cite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-head);
}

.cite-head h3 {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
}

.bibtex {
  margin: 0;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--muted);
  background: var(--bg);
}

.bibtex code {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  padding: 0;
  white-space: pre;
}

.copy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.paper-takeaways {
  border-left: 1px solid var(--line);
  padding-left: 1.75rem;
}

.paper-takeaways h3 {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1rem;
}

.paper-takeaways ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.paper-takeaways li {
  font-size: 0.92rem;
  color: var(--muted);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}

.paper-takeaways li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--cyan);
  font-size: 0.75rem;
  top: 0.15em;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 960px) {
  .hero-grid,
  .two-col,
  .method-layout,
  .anatomy-block,
  .paper-card {
    grid-template-columns: 1fr;
  }

  .method-spec dl > div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

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

  .stat-strip {
    grid-template-columns: 1fr 1fr;
  }

  .stat:nth-child(2) {
    border-right: none;
  }

  .hero-sonar {
    opacity: 0.25;
    right: -20%;
  }

  .paper-takeaways {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--nav-mobile-bg);
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.25rem 1.25rem;
    gap: 0.85rem;
  }

  .nav.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .site-header .nav {
    order: 3;
  }

  .header-actions {
    margin-left: auto;
  }

}

@media (max-width: 560px) {
  .stat-strip {
    grid-template-columns: 1fr;
  }

  .stat {
    border-right: none;
  }

  .compare-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .pred-row {
    flex-wrap: wrap;
  }

  .pred-arrow {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-sonar .ring,
  .sonar-beam,
  .anat-fill,
  .bar-fill {
    animation: none !important;
    transition: none !important;
  }
}
