/* ============================================================
 * fdrp.liviu.ai — Design System
 * Laboratory Console: CERN control room meets academic journal
 * ============================================================ */

/* --- Google Fonts (will self-host later) --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

/* ============================================================
 * 1. DESIGN TOKENS
 * ============================================================ */

:root {
  /* --- Surfaces --- */
  --bg: #07070d;
  --surface: #0e0e18;
  --card: #161625;
  --card-hover: #1c1c30;
  --border: #252540;
  --border-accent: #303055;

  /* --- Text --- */
  --text-primary: #d8d8e8;
  --text-secondary: #7878a0;
  --text-muted: #4a4a70;

  /* --- Accent (cyan instrument) --- */
  --accent: #00bfff;
  --accent-dim: #0088bb;
  --accent-glow: rgba(0, 191, 255, 0.15);
  --accent-hover: #33d4ff;

  /* --- Semantic --- */
  --success: #00e676;
  --warning: #ffab00;
  --error: #ff1744;
  --info: #7c4dff;

  /* --- Severity --- */
  --critical: #ff1744;
  --high: #ff6d00;
  --medium: #ffab00;
  --low: #00e676;

  /* --- Typography --- */
  --font-display: 'DM Serif Display', 'Georgia', serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* --- Spacing --- */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* --- Layout --- */
  --max-width: 1200px;
  --nav-height: 48px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 999px;

  /* --- Transitions --- */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out: cubic-bezier(0.42, 0, 0.58, 1);
}


/* ============================================================
 * 2. RESET & BASE
 * ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  padding-top: var(--nav-height);
}

::selection {
  background: rgba(0, 191, 255, 0.3);
  color: #fff;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s var(--ease-out);
}

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

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


/* ============================================================
 * 3. TYPOGRAPHY
 * ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  line-height: 1.2;
}

h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}

h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
}

/* h3: label/overline style */
h3 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

h4 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-md);
  max-width: 68ch;
}

.lead {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 60ch;
}

strong {
  font-weight: 600;
}

small, .text-sm {
  font-size: 0.8125rem;
}

.text-xs {
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
}

.text-mono {
  font-family: var(--font-mono);
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-accent {
  color: var(--accent);
}

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.4em;
}

pre {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  overflow-x: auto;
  margin-bottom: var(--space-lg);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

blockquote {
  border-left: 3px solid var(--border-accent);
  padding-left: var(--space-md);
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: var(--space-md);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-xl) 0;
}

ul, ol {
  padding-left: 1.5em;
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-xs);
}

li::marker {
  color: var(--text-muted);
}


/* ============================================================
 * 4. LAYOUT
 * ============================================================ */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow,
.container--narrow {
  max-width: 800px;
}

main {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-2xl);
}

section {
  margin-bottom: var(--space-xl);
}

section + section {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

/* CSS Grid system */
.grid {
  display: grid;
  gap: var(--space-lg);
}

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

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Flex utilities */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }


/* ============================================================
 * 5. NAVIGATION
 * ============================================================ */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(7, 7, 13, 0.75);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease-out),
              border-color 0.3s var(--ease-out),
              backdrop-filter 0.3s var(--ease-out);
}

.site-nav.nav-scrolled {
  background: rgba(7, 7, 13, 0.92);
  border-bottom-color: var(--border);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand:hover {
  color: var(--accent-hover);
  text-shadow: 0 0 12px var(--accent-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  display: block;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.15s var(--ease-out),
              background-color 0.15s var(--ease-out);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-links a.nav-active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  position: relative;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  position: absolute;
  left: 6px;
  transition: transform 0.25s var(--ease-in-out),
              opacity 0.2s var(--ease-out);
}

.nav-toggle span:nth-child(1) { top: 9px; }
.nav-toggle span:nth-child(2) { top: 15px; }
.nav-toggle span:nth-child(3) { top: 21px; }

.nav-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}


/* ============================================================
 * 6. CARDS
 * ============================================================ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color 0.2s var(--ease-out),
              transform 0.2s var(--ease-out),
              box-shadow 0.3s var(--ease-out);
}

.card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
              0 0 0 1px var(--border-accent);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-link:hover {
  color: inherit;
}

.card h4 {
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0;
}


/* ============================================================
 * 7. READOUT (Instrument Display)
 * ============================================================ */

.readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-lg);
  text-align: center;
}

.readout-value {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 20px var(--accent-glow),
               0 0 40px rgba(0, 191, 255, 0.08);
  animation: readoutFadeIn 0.6s var(--ease-out) both;
}

.readout-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

.readout-sub {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

@keyframes readoutFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Staggered readout animation */
.stat-grid .card:nth-child(1) .readout-value { animation-delay: 0.0s; }
.stat-grid .card:nth-child(2) .readout-value { animation-delay: 0.1s; }
.stat-grid .card:nth-child(3) .readout-value { animation-delay: 0.2s; }
.stat-grid .card:nth-child(4) .readout-value { animation-delay: 0.3s; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}


/* ============================================================
 * 8. SEVERITY BADGES
 * ============================================================ */

.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2em 0.6em;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.severity-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.severity-critical {
  color: var(--critical);
  background: rgba(255, 23, 68, 0.1);
}
.severity-critical::before { background: var(--critical); box-shadow: 0 0 6px var(--critical); }

.severity-high {
  color: var(--high);
  background: rgba(255, 109, 0, 0.1);
}
.severity-high::before { background: var(--high); box-shadow: 0 0 6px var(--high); }

.severity-medium {
  color: var(--medium);
  background: rgba(255, 171, 0, 0.1);
}
.severity-medium::before { background: var(--medium); box-shadow: 0 0 6px var(--medium); }

.severity-low {
  color: var(--low);
  background: rgba(0, 230, 118, 0.1);
}
.severity-low::before { background: var(--low); box-shadow: 0 0 6px var(--low); }


/* ============================================================
 * 9. COMPARISON TABLE
 * ============================================================ */

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.comparison-table thead {
  background: var(--surface);
}

.comparison-table th {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.comparison-table td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.comparison-table tbody tr:nth-child(even) {
  background: rgba(14, 14, 24, 0.5);
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.comparison-table tbody tr:hover {
  background: var(--card-hover);
}

/* Support level cells */
.comparison-table .support-full {
  color: var(--success);
  font-weight: 600;
}

.comparison-table .support-partial {
  color: var(--warning);
  font-weight: 500;
}

.comparison-table .support-none {
  color: var(--error);
  font-weight: 500;
}

.comparison-table .support-na {
  color: var(--text-muted);
  font-style: italic;
}

/* First column (feature name) styling */
.comparison-table td:first-child {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

/* FDRP column highlight */
.comparison-table th.col-fdrp,
.comparison-table td.col-fdrp {
  background: rgba(0, 191, 255, 0.04);
  border-left: 1px solid var(--accent-glow);
  border-right: 1px solid var(--accent-glow);
}


/* ============================================================
 * 10. RETRACTION NOTICE
 * ============================================================ */

.retraction-notice {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  position: relative;
}

.retraction-notice::before {
  content: '\26A0';  /* warning sign */
  display: block;
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.retraction-notice h4 {
  color: var(--warning);
  font-family: var(--font-body);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.retraction-notice p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0;
}

.retraction-notice .retraction-detail {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  margin-top: var(--space-sm);
  color: var(--text-muted);
}


/* ============================================================
 * 11. BIBTEX BLOCK
 * ============================================================ */

.bibtex-block {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.bibtex-block pre {
  margin: 0;
  padding: var(--space-lg);
  padding-right: 3.5rem;
  border: none;
  background: none;
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-x: auto;
}

.bibtex-block .copy-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: color 0.15s var(--ease-out),
              border-color 0.15s var(--ease-out),
              background 0.15s var(--ease-out);
}

.bibtex-block .copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
  background: var(--card-hover);
}

.bibtex-block .copy-btn.copied {
  color: var(--success);
  border-color: rgba(0, 230, 118, 0.3);
}


/* ============================================================
 * 12. BREADCRUMB
 * ============================================================ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  list-style: none;
  padding: 0;
}

.breadcrumb li + li::before {
  content: '\203A';  /* single right-pointing angle */
  margin-right: 0.375rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

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

.breadcrumb .current {
  color: var(--text-primary);
}


/* ============================================================
 * 13. CTA / DOWNLOAD BUTTON
 * ============================================================ */

.cta-paper {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s var(--ease-out),
              box-shadow 0.2s var(--ease-out),
              transform 0.15s var(--ease-out);
}

.cta-paper:hover {
  background: var(--accent-hover);
  color: var(--bg);
  box-shadow: 0 4px 20px rgba(0, 191, 255, 0.3),
              0 0 0 1px rgba(0, 191, 255, 0.2);
  transform: translateY(-1px);
}

.cta-paper:active {
  transform: translateY(0);
}

.cta-paper .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.cta-paper .file-size {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.7;
}

/* Secondary CTA */
.cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s var(--ease-out),
              border-color 0.15s var(--ease-out);
}

.cta-secondary:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}


/* ============================================================
 * 14. TAGS
 * ============================================================ */

.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2em 0.6em;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--surface);
  white-space: nowrap;
}

.tag-physics     { color: #7c4dff; border-color: rgba(124, 77, 255, 0.3); background: rgba(124, 77, 255, 0.08); }
.tag-automotive  { color: #ff6d00; border-color: rgba(255, 109, 0, 0.3); background: rgba(255, 109, 0, 0.08); }
.tag-cyber       { color: #ff1744; border-color: rgba(255, 23, 68, 0.3); background: rgba(255, 23, 68, 0.08); }
.tag-safety      { color: #00e676; border-color: rgba(0, 230, 118, 0.3); background: rgba(0, 230, 118, 0.08); }
.tag-fire        { color: #ffab00; border-color: rgba(255, 171, 0, 0.3); background: rgba(255, 171, 0, 0.08); }
.tag-regulatory  { color: #00bfff; border-color: rgba(0, 191, 255, 0.3); background: rgba(0, 191, 255, 0.08); }
.tag-software    { color: #e040fb; border-color: rgba(224, 64, 251, 0.3); background: rgba(224, 64, 251, 0.08); }
.tag-meta        { color: #d8d8e8; border-color: rgba(216, 216, 232, 0.2); background: rgba(216, 216, 232, 0.05); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}


/* ============================================================
 * 15. TIMELINE
 * ============================================================ */

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-lg);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.5em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border-accent);
  z-index: 1;
  margin-left: 3px;
}

.timeline-item.active::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.timeline-item.retracted::before {
  background: var(--warning);
  border-color: var(--warning);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.timeline-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.timeline-body {
  font-size: 0.875rem;
  color: var(--text-secondary);
}


/* ============================================================
 * 16. FOOTER
 * ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-xl) 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.8;
}

.site-footer a {
  color: var(--text-secondary);
}

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

.footer-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.footer-author {
  color: var(--text-secondary);
}

.footer-licenses {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}


/* ============================================================
 * 17. ANIMATIONS
 * ============================================================ */

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeSlideUp 0.5s var(--ease-out) both;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ============================================================
 * 18. ERROR PAGES
 * ============================================================ */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height) - 10rem);
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.error-code {
  font-family: var(--font-mono);
  font-size: 6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 40px var(--accent-glow),
               0 0 80px rgba(0, 191, 255, 0.06);
  margin-bottom: var(--space-md);
  animation: readoutFadeIn 0.8s var(--ease-out) both;
}

.error-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.error-body {
  max-width: 440px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: var(--space-lg);
}

.error-body code {
  font-size: 0.8125rem;
}


/* ============================================================
 * 19. MISC COMPONENTS
 * ============================================================ */

/* Separator dot */
.dot-sep::before {
  content: '\00B7';
  margin: 0 0.5em;
  color: var(--text-muted);
}

/* Visually hidden (accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  z-index: 9999;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* Figure */
figure {
  margin-bottom: var(--space-lg);
}

figcaption {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  font-style: italic;
}

/* Definition list (for methodology params) */
dl {
  margin-bottom: var(--space-lg);
}

dt {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

dd {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
  padding-left: var(--space-md);
}

/* Tooltip (title-based, CSS only) */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s var(--ease-out);
  z-index: 100;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* Glow divider */
.glow-divider {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent-dim) 30%,
    var(--accent) 50%,
    var(--accent-dim) 70%,
    transparent 100%
  );
  opacity: 0.4;
  margin: var(--space-xl) 0;
}


/* ============================================================
 * 20. RESPONSIVE
 * ============================================================ */

/* Tablet: <= 1024px */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  h1 { font-size: 1.875rem; }
  .readout-value { font-size: 2rem; }
  .error-code { font-size: 4.5rem; }
}

/* Mobile: <= 768px */
@media (max-width: 768px) {
  :root {
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;
  }

  body {
    font-size: 0.875rem;
  }

  .container {
    padding: 0 var(--space-md);
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .readout-value { font-size: 1.75rem; }

  /* Grid collapses */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Nav mobile */
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(7, 7, 13, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-md);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s var(--ease-out);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 0.9375rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
  }

  /* Table horizontal scroll */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(-1 * var(--space-md));
    padding: 0 var(--space-md);
  }

  .comparison-table {
    min-width: 600px;
  }

  /* Error page */
  .error-code { font-size: 3.5rem; }
  .error-title { font-size: 1.25rem; }
}

/* Small mobile: <= 480px */
@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .cta-paper {
    width: 100%;
    justify-content: center;
  }
}
