/* ============================================================
   rarp.org - RFC Viewer
   Comprehensive design system and component styles
   Terminal-inspired dark theme with modern polish
   ============================================================ */

/* ==========================================================
   1. CSS VARIABLES / THEMING
   ========================================================== */

:root {
  /* Dark theme (default) */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2332;
  --bg-elevated: #1e293b;
  --bg-hover: #253247;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-heading: #f1f5f9;

  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.15);
  --accent-glow: rgba(34, 211, 238, 0.3);
  --accent-secondary: #a78bfa;
  --accent-green: #34d399;
  --accent-yellow: #fbbf24;
  --accent-red: #f87171;
  --accent-orange: #fb923c;
  --accent-pink: #f472b6;
  --accent-blue: #60a5fa;

  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.25);

  --sidebar-width: 280px;
  --topbar-height: 56px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);

  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Per-RFC hero color (overridden by .hero-color-* classes) */
  --hero-accent: var(--accent);
  --hero-accent-dim: var(--accent-dim);
  --hero-accent-glow: var(--accent-glow);
}

/* --- Light Theme --- */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-hover: #e2e8f0;

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-heading: #0f172a;

  --accent: #0891b2;
  --accent-dim: rgba(8, 145, 178, 0.1);
  --accent-glow: rgba(8, 145, 178, 0.2);
  --accent-secondary: #7c3aed;
  --accent-green: #059669;
  --accent-yellow: #d97706;
  --accent-red: #dc2626;
  --accent-orange: #ea580c;
  --accent-pink: #db2777;
  --accent-blue: #2563eb;

  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
}


/* ==========================================================
   2. HERO COLOR CLASSES
   Per-RFC tinting for hero badges, subtitle decorations,
   and animation nodes
   ========================================================== */

.hero-color-cyan {
  --hero-accent: #22d3ee;
  --hero-accent-dim: rgba(34, 211, 238, 0.15);
  --hero-accent-glow: rgba(34, 211, 238, 0.3);
}

.hero-color-green {
  --hero-accent: #34d399;
  --hero-accent-dim: rgba(52, 211, 153, 0.15);
  --hero-accent-glow: rgba(52, 211, 153, 0.3);
}

.hero-color-purple {
  --hero-accent: #a78bfa;
  --hero-accent-dim: rgba(167, 139, 250, 0.15);
  --hero-accent-glow: rgba(167, 139, 250, 0.3);
}

.hero-color-orange {
  --hero-accent: #fb923c;
  --hero-accent-dim: rgba(251, 146, 60, 0.15);
  --hero-accent-glow: rgba(251, 146, 60, 0.3);
}

.hero-color-red {
  --hero-accent: #f87171;
  --hero-accent-dim: rgba(248, 113, 113, 0.15);
  --hero-accent-glow: rgba(248, 113, 113, 0.3);
}

.hero-color-yellow {
  --hero-accent: #fbbf24;
  --hero-accent-dim: rgba(251, 191, 36, 0.15);
  --hero-accent-glow: rgba(251, 191, 36, 0.3);
}

.hero-color-blue {
  --hero-accent: #60a5fa;
  --hero-accent-dim: rgba(96, 165, 250, 0.15);
  --hero-accent-glow: rgba(96, 165, 250, 0.3);
}

.hero-color-pink {
  --hero-accent: #f472b6;
  --hero-accent-dim: rgba(244, 114, 182, 0.15);
  --hero-accent-glow: rgba(244, 114, 182, 0.3);
}

/* Light theme hero color overrides */
[data-theme="light"] .hero-color-cyan {
  --hero-accent: #0891b2;
  --hero-accent-dim: rgba(8, 145, 178, 0.1);
  --hero-accent-glow: rgba(8, 145, 178, 0.2);
}

[data-theme="light"] .hero-color-green {
  --hero-accent: #059669;
  --hero-accent-dim: rgba(5, 150, 105, 0.1);
  --hero-accent-glow: rgba(5, 150, 105, 0.2);
}

[data-theme="light"] .hero-color-purple {
  --hero-accent: #7c3aed;
  --hero-accent-dim: rgba(124, 58, 237, 0.1);
  --hero-accent-glow: rgba(124, 58, 237, 0.2);
}

[data-theme="light"] .hero-color-orange {
  --hero-accent: #ea580c;
  --hero-accent-dim: rgba(234, 88, 12, 0.1);
  --hero-accent-glow: rgba(234, 88, 12, 0.2);
}

[data-theme="light"] .hero-color-red {
  --hero-accent: #dc2626;
  --hero-accent-dim: rgba(220, 38, 38, 0.1);
  --hero-accent-glow: rgba(220, 38, 38, 0.2);
}

[data-theme="light"] .hero-color-yellow {
  --hero-accent: #d97706;
  --hero-accent-dim: rgba(217, 119, 6, 0.1);
  --hero-accent-glow: rgba(217, 119, 6, 0.2);
}

[data-theme="light"] .hero-color-blue {
  --hero-accent: #2563eb;
  --hero-accent-dim: rgba(37, 99, 235, 0.1);
  --hero-accent-glow: rgba(37, 99, 235, 0.2);
}

[data-theme="light"] .hero-color-pink {
  --hero-accent: #db2777;
  --hero-accent-dim: rgba(219, 39, 119, 0.1);
  --hero-accent-glow: rgba(219, 39, 119, 0.2);
}


/* ==========================================================
   3. RESET & BASE
   ========================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 24px);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent-dim);
  color: var(--accent);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-tertiary);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--accent);
}

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


/* ==========================================================
   4. BACKGROUND CANVAS
   ========================================================== */

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

[data-theme="light"] #bg-canvas {
  opacity: 0.15;
}


/* ==========================================================
   5. TOPBAR
   ========================================================== */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  gap: 12px;
}

[data-theme="light"] .topbar {
  background: rgba(248, 250, 252, 0.85);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.topbar-center {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* --- Sidebar toggle (hamburger) --- */
.sidebar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

.sidebar-toggle:hover span {
  background: var(--accent);
}

/* --- Logo --- */
.logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}

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

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

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

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

/* --- Search box --- */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  padding: 8px 10px;
  min-width: 0;
}

#search-input::placeholder {
  color: var(--text-muted);
}

.search-kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* --- Theme toggle --- */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-icon-moon {
  display: none;
}

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

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

/* --- External link --- */
.external-link {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.external-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}


/* ==========================================================
   6. SIDEBAR
   ========================================================== */

.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 900;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 2px;
}

.sidebar-inner {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 899;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* --- Sidebar RFC header --- */
.sidebar-rfc-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-rfc-header .rfc-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(34, 211, 238, 0.2);
  letter-spacing: 0.05em;
}

.sidebar-rfc-header .rfc-status {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-rfc-header .rfc-title {
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.4;
}

/* --- Sidebar table of contents --- */
.sidebar-toc {
  padding: 16px 0;
}

.sidebar-toc .toc-title {
  padding: 0 20px 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.toc-link {
  display: block;
  padding: 5px 20px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  border-left: 2px solid transparent;
  line-height: 1.4;
}

.toc-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
}

.toc-link.toc-sub {
  padding-left: 36px;
  font-size: 0.78rem;
}

/* --- Sidebar divider --- */
.sidebar-divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 4px 20px;
}

/* --- Sidebar RFC list --- */
.sidebar-rfc-list {
  padding: 12px 0;
  flex: 1;
}

.sidebar-rfc-list .list-title {
  padding: 0 20px 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

/* --- Sidebar category --- */
.sidebar-category {
  margin-bottom: 4px;
}

.sidebar-category-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
}

.sidebar-category-title:hover {
  color: var(--text-secondary);
}

.sidebar-category-title::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.sidebar-category.collapsed .sidebar-category-title::after {
  transform: rotate(-90deg);
}

.sidebar-category-items {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar-category.collapsed .sidebar-category-items {
  max-height: 0 !important;
}

/* --- Sidebar RFC item --- */
.sidebar-rfc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px 6px 28px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border-left: 2px solid transparent;
}

.sidebar-rfc-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sidebar-rfc-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
}

.sidebar-rfc-item.featured {
  font-weight: 500;
}

.sidebar-rfc-item .rfc-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  min-width: 52px;
  text-align: center;
}

.sidebar-rfc-item.active .rfc-num {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(34, 211, 238, 0.2);
}

.sidebar-rfc-item .rfc-short {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Legacy sidebar elements (backward compat) */
.sidebar-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.rfc-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(34, 211, 238, 0.2);
  letter-spacing: 0.05em;
}

.rfc-status {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-meta {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-value {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-title {
  padding: 0 20px 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.nav-list,
.nav-sublist {
  list-style: none;
}

.nav-link {
  display: block;
  padding: 6px 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  border-left: 2px solid transparent;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
}

.nav-sublist .nav-link {
  padding-left: 36px;
  font-size: 0.8rem;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.authors-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.author {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 2px 0;
}

.author-affiliation {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}


/* ==========================================================
   7. MAIN CONTENT AREA
   ========================================================== */

.content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
  position: relative;
  z-index: 1;
}

.rfc-document {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 32px;
}


/* ==========================================================
   8. HERO SECTION
   ========================================================== */

.rfc-hero {
  padding: 80px 0 60px;
  min-height: calc(100vh - var(--topbar-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

/* --- Hero badges --- */
.hero-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hero-accent);
  background: var(--hero-accent-dim);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hero-accent-glow);
  letter-spacing: 0.05em;
}

/* --- Hero badge status variants --- */
.hero-badge-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-standard {
  color: var(--accent-green);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

[data-theme="light"] .status-standard {
  color: #059669;
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.25);
}

.status-historic {
  color: var(--accent-yellow);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

[data-theme="light"] .status-historic {
  color: #d97706;
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.25);
}

.status-proposed {
  color: var(--accent-blue);
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.25);
}

[data-theme="light"] .status-proposed {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.25);
}

.status-informational {
  color: var(--accent-secondary);
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.25);
}

[data-theme="light"] .status-informational {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.25);
}

.status-experimental {
  color: var(--accent-orange);
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.25);
}

[data-theme="light"] .status-experimental {
  color: #ea580c;
  background: rgba(234, 88, 12, 0.1);
  border-color: rgba(234, 88, 12, 0.25);
}

.status-bcp {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

[data-theme="light"] .status-bcp {
  color: #0891b2;
  background: rgba(8, 145, 178, 0.1);
  border-color: rgba(8, 145, 178, 0.25);
}

/* Legacy badge */
.hero-badge-historic {
  color: var(--accent-yellow);
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
}

/* --- Hero title & subtitle --- */
.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 480px;
  position: relative;
}

.hero-subtitle::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--hero-accent);
  border-radius: 2px;
  opacity: 0.5;
}

/* --- Hero meta --- */
.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-meta-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.hero-meta-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  min-width: 100px;
}

.hero-meta-value {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --- Hero visual --- */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Scroll indicator --- */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  color: var(--text-muted);
  font-size: 0.8rem;
  animation: float 2s ease-in-out infinite;
  opacity: 0.7;
  transition: opacity 0.4s ease;
}

.scroll-indicator svg {
  width: 20px;
  height: 20px;
  opacity: 0.6;
}


/* ==========================================================
   9. HERO ANIMATIONS
   ========================================================== */

/* --- Generic animation container --- */
.hero-anim {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  position: relative;
}

/* ---- 9a. Packet Flow Animation ---- */
.hero-anim-packet-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 320px;
}

.anim-node {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: center;
  width: 100%;
  position: relative;
  transition: var(--transition);
}

.anim-node:hover {
  border-color: var(--hero-accent, var(--accent));
  box-shadow: 0 0 20px var(--hero-accent-dim, var(--accent-dim));
}

.anim-node-top .anim-node-icon {
  color: var(--hero-accent, var(--accent));
}

.anim-node-bottom .anim-node-icon {
  color: var(--accent-green);
}

.anim-node-icon {
  font-size: 2rem;
  margin-bottom: 6px;
  line-height: 1;
}

.anim-node-label {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.anim-node-detail {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.anim-wire {
  width: 2px;
  height: 80px;
  background: var(--border-strong);
  position: relative;
  overflow: visible;
}

.anim-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--hero-accent, var(--accent));
  border-radius: 50%;
  left: 50%;
  transform: translateX(-50%);
  top: -5px;
  box-shadow: 0 0 12px var(--hero-accent-glow, var(--accent-glow)),
              0 0 24px var(--hero-accent-dim, var(--accent-dim));
  animation: packetTravel 3s ease-in-out infinite;
}

.anim-wire-label {
  position: absolute;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.anim-wire-label-req {
  top: 10px;
  animation: showReq 3s ease-in-out infinite;
}

.anim-wire-label-rep {
  bottom: 10px;
  animation: showRep 3s ease-in-out infinite;
}

/* Legacy packet animation selectors */
.packet-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 320px;
}

.packet-node {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: center;
  width: 100%;
  position: relative;
  transition: var(--transition);
}

.packet-node:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-dim);
}

.node-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.node-client .node-icon {
  color: var(--accent);
}

.node-server .node-icon {
  color: var(--accent-green);
}

.node-label {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.node-detail {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.node-ip {
  color: var(--accent-yellow);
  transition: color 0.5s;
}

.node-ip.resolved {
  color: var(--accent-green);
}

.packet-wire {
  width: 2px;
  height: 80px;
  background: var(--border-strong);
  position: relative;
  overflow: visible;
}

.packet-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  left: 50%;
  transform: translateX(-50%);
  top: -5px;
  box-shadow: 0 0 12px var(--accent-glow), 0 0 24px var(--accent-dim);
  animation: packetTravel 3s ease-in-out infinite;
}

.wire-label {
  position: absolute;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}

.wire-label-req {
  top: 10px;
  animation: showReq 3s ease-in-out infinite;
}

.wire-label-rep {
  bottom: 10px;
  animation: showRep 3s ease-in-out infinite;
}

/* ---- 9b. Handshake Animation ---- */
.hero-anim-handshake {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  position: relative;
  padding: 16px 0;
}

.hero-anim-handshake .anim-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  position: relative;
  opacity: 0.5;
  transform: translateX(-8px);
  animation: handshakeStepIn 4.5s ease infinite;
}

.hero-anim-handshake .anim-step:nth-child(1) {
  animation-delay: 0s;
}

.hero-anim-handshake .anim-step:nth-child(2) {
  animation-delay: 1.5s;
}

.hero-anim-handshake .anim-step:nth-child(3) {
  animation-delay: 3s;
}

.hero-anim-handshake .anim-step:last-child {
  margin-bottom: 0;
}

/* Arrow between handshake steps */
.hero-anim-handshake .anim-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--border-strong);
  z-index: 1;
}

.anim-step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hero-accent, var(--accent));
  background: var(--hero-accent-dim, var(--accent-dim));
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--hero-accent-glow, var(--accent-glow));
}

.anim-step-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.anim-step-detail {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- 9c. Layers Animation (protocol stack) ---- */
.hero-anim-layers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.hero-anim-layers .anim-layer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  opacity: 0;
  transform: translateY(12px);
  animation: layerReveal 0.5s ease forwards;
}

.hero-anim-layers .anim-layer:nth-child(1) { animation-delay: 0.8s; }
.hero-anim-layers .anim-layer:nth-child(2) { animation-delay: 0.6s; }
.hero-anim-layers .anim-layer:nth-child(3) { animation-delay: 0.4s; }
.hero-anim-layers .anim-layer:nth-child(4) { animation-delay: 0.2s; }
.hero-anim-layers .anim-layer:nth-child(5) { animation-delay: 0s; }

.anim-layer-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-heading);
}

.anim-layer-detail {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.hero-anim-layers .anim-layer:first-child {
  border-color: var(--hero-accent-glow, var(--accent-glow));
  background: var(--hero-accent-dim, var(--accent-dim));
}

.hero-anim-layers .anim-layer:first-child .anim-layer-name {
  color: var(--hero-accent, var(--accent));
}

/* ---- 9d. Tree Animation (DNS hierarchy) ---- */
.hero-anim-tree {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.anim-tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.anim-tree-node > .anim-tree-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-heading);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  position: relative;
  z-index: 2;
  transition: var(--transition);
}

.anim-tree-node:hover > .anim-tree-label {
  border-color: var(--hero-accent, var(--accent));
  box-shadow: 0 0 12px var(--hero-accent-dim, var(--accent-dim));
}

.anim-tree-node.anim-tree-root > .anim-tree-label {
  color: var(--hero-accent, var(--accent));
  border-color: var(--hero-accent-glow, var(--accent-glow));
  background: var(--hero-accent-dim, var(--accent-dim));
}

.anim-tree-children {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  position: relative;
}

/* Vertical connector from parent */
.anim-tree-children::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  width: 1px;
  height: 20px;
  background: var(--border-strong);
}

/* Horizontal connector between children */
.anim-tree-children::after {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: var(--border-strong);
}

.anim-tree-children .anim-tree-node > .anim-tree-label {
  font-size: 0.75rem;
  padding: 6px 12px;
}

/* Vertical line above each child node */
.anim-tree-children > .anim-tree-node::before {
  content: '';
  width: 1px;
  height: 16px;
  background: var(--border-strong);
  margin-bottom: -1px;
}

/* ---- 9e. Lock Animation (security) ---- */
.hero-anim-lock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.anim-lock-icon {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.anim-lock-icon svg {
  width: 48px;
  height: 48px;
  color: var(--hero-accent, var(--accent));
  filter: drop-shadow(0 0 12px var(--hero-accent-glow, var(--accent-glow)));
  animation: pulse 3s ease-in-out infinite;
}

.anim-lock-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--hero-accent-glow, var(--accent-glow));
  animation: pulse 3s ease-in-out infinite 0.5s;
}

.anim-lock-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.anim-lock-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}

.anim-lock-step:nth-child(1) { animation-delay: 0.2s; }
.anim-lock-step:nth-child(2) { animation-delay: 0.5s; }
.anim-lock-step:nth-child(3) { animation-delay: 0.8s; }
.anim-lock-step:nth-child(4) { animation-delay: 1.1s; }

.anim-lock-step-icon {
  color: var(--hero-accent, var(--accent));
  flex-shrink: 0;
}


/* ==========================================================
   10. CONTENT SECTIONS
   ========================================================== */

.rfc-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  /* Scroll reveal */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.rfc-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.rfc-section:last-of-type {
  border-bottom: none;
}

.section-heading {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 24px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent);
  font-weight: 600;
}

.section-body p {
  margin-bottom: 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.section-body p:last-child {
  margin-bottom: 0;
}

.section-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 28px 0 12px;
}

.section-body ol,
.section-body ul {
  margin: 0 0 16px 20px;
  font-size: 0.95rem;
}

.section-body li {
  margin-bottom: 10px;
  color: var(--text-primary);
  line-height: 1.6;
}

.section-body li::marker {
  color: var(--accent);
}

.section-body strong {
  color: var(--text-heading);
  font-weight: 600;
}

.section-body em {
  color: var(--text-secondary);
  font-style: italic;
}

.subsection {
  margin-top: 40px;
}

.subsection-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}


/* ==========================================================
   11. CALLOUTS
   ========================================================== */

.callout {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  border: 1px solid;
}

.callout-icon {
  flex-shrink: 0;
  margin-top: 2px;
  width: 20px;
  height: 20px;
}

.callout-content {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.callout-content strong {
  color: var(--text-heading);
}

.callout-info {
  background: rgba(34, 211, 238, 0.06);
  border-color: rgba(34, 211, 238, 0.15);
}

.callout-info .callout-icon {
  color: var(--accent);
}

[data-theme="light"] .callout-info {
  background: rgba(8, 145, 178, 0.06);
  border-color: rgba(8, 145, 178, 0.15);
}

.callout-note {
  background: rgba(167, 139, 250, 0.06);
  border-color: rgba(167, 139, 250, 0.15);
}

.callout-note .callout-icon {
  color: var(--accent-secondary);
}

[data-theme="light"] .callout-note {
  background: rgba(124, 58, 237, 0.06);
  border-color: rgba(124, 58, 237, 0.15);
}

.callout-warning {
  background: rgba(251, 191, 36, 0.06);
  border-color: rgba(251, 191, 36, 0.15);
}

.callout-warning .callout-icon {
  color: var(--accent-yellow);
}

[data-theme="light"] .callout-warning {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.15);
}


/* ==========================================================
   12. COMPARISON TABLE
   ========================================================== */

.comparison-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 20px 0;
  font-size: 0.875rem;
}

.comparison-header {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-heading);
}

.comparison-header .comparison-col {
  padding: 12px 16px;
}

.comparison-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

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

.comparison-row:hover {
  background: var(--bg-hover);
}

.comparison-col {
  padding: 10px 16px;
  color: var(--text-secondary);
}

.comparison-label {
  color: var(--text-heading);
  font-weight: 500;
}


/* ==========================================================
   13. PACKET DIAGRAM
   ========================================================== */

.packet-diagram {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 24px 0;
}

.packet-diagram-title {
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.packet-ascii {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--accent);
  padding: 16px 20px;
  overflow-x: auto;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}

.packet-ascii::-webkit-scrollbar {
  height: 4px;
}

.packet-ascii::-webkit-scrollbar-track {
  background: transparent;
}

.packet-ascii::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 2px;
}


/* ==========================================================
   14. FIELD LIST
   ========================================================== */

.field-list {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.field-item:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.field-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  min-width: 70px;
  flex-shrink: 0;
}

.field-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.field-size {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--text-muted);
  margin-right: 6px;
  border: 1px solid var(--border);
}


/* ==========================================================
   15. FIELD TABLE
   ========================================================== */

.field-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 16px 0;
}

.field-table-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

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

.field-table-row:hover {
  background: var(--bg-hover);
}

.field-table-row.highlight-row {
  background: var(--accent-dim);
}

.field-table-row.highlight-row:hover {
  background: var(--accent-dim);
}

.field-table-name {
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  color: var(--text-heading);
}

.field-table-val {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.field-undefined {
  color: var(--accent-yellow);
  font-style: italic;
}


/* ==========================================================
   16. OPCODE GRID
   ========================================================== */

.opcode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.opcode-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.opcode-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-strong);
}

.opcode-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.opcode-card.opcode-highlight {
  border-color: var(--accent-glow);
  background: var(--accent-dim);
}

.opcode-card.opcode-highlight::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
}

.opcode-card.opcode-highlight .opcode-number {
  color: var(--accent);
}

/* Specific opcode type styling */
.opcode-arp::before {
  background: var(--text-muted);
}

.opcode-rarp::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
}

.opcode-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-muted);
}

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

.opcode-rarp .opcode-number {
  color: var(--accent);
}

.opcode-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.opcode-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}


/* ==========================================================
   17. CODE BLOCK
   ========================================================== */

.code-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 20px 0;
}

.code-block-title {
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.03em;
}

.code-block-title::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  flex-shrink: 0;
}

.code-block pre {
  margin: 0;
  padding: 16px 20px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}

.code-block pre::-webkit-scrollbar {
  height: 4px;
}

.code-block pre::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 2px;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text-primary);
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
}

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

.code-block .code-keyword {
  color: var(--accent-secondary);
}

.code-block .code-string {
  color: var(--accent-green);
}

.code-block .code-number {
  color: var(--accent-orange);
}

.code-block .code-function {
  color: var(--accent-blue);
}


/* ==========================================================
   18. KEY POINTS
   ========================================================== */

.key-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.key-point {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}

.key-point:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.key-point-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
  line-height: 1;
}

.key-point-title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.key-point-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}


/* ==========================================================
   19. REFERENCE LIST
   ========================================================== */

.reference-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.reference-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: var(--transition);
}

.reference-item:hover {
  border-color: var(--accent);
}

.reference-number {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.reference-text {
  color: var(--text-secondary);
  line-height: 1.5;
}

.rfc-ref {
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--accent);
}


/* ==========================================================
   20. SEARCH OVERLAY
   ========================================================== */

.search-overlay {
  display: none;
  position: fixed;
  top: var(--topbar-height);
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 800;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.search-overlay.active {
  display: block;
}

.search-results {
  max-width: 640px;
  margin: 32px auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - var(--topbar-height) - 80px);
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}

.search-results::-webkit-scrollbar {
  width: 4px;
}

.search-results::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 2px;
}

.search-result-item {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-section {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.search-result-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.search-result-text mark {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 1px 3px;
  border-radius: 2px;
}

.search-no-results {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}


/* ==========================================================
   21. FOOTER
   ========================================================== */

.rfc-footer {
  padding: 32px 0;
  margin-top: 48px;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-heading);
  font-size: 0.9rem;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 8px;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-right a {
  color: var(--text-muted);
  transition: color var(--transition);
}

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

/* --- Footer links --- */

.footer-link {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.footer-link a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
}

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

.site-footer {
  padding: 32px 0 48px;
  margin-top: 64px;
  border-top: 1px solid var(--border);
}

.site-footer-inner {
  display: flex;
  justify-content: center;
}

.site-footer-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
}

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


/* ==========================================================
   22. KEYFRAME ANIMATIONS
   ========================================================== */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

@keyframes packetTravel {
  0%, 5% { top: -5px; background: var(--hero-accent, var(--accent)); }
  45%, 50% { top: calc(100% - 5px); background: var(--hero-accent, var(--accent)); }
  55% { top: calc(100% - 5px); background: var(--accent-green); }
  95%, 100% { top: -5px; background: var(--accent-green); }
}

@keyframes showReq {
  0%, 5% { opacity: 1; }
  40%, 100% { opacity: 0; }
}

@keyframes showRep {
  0%, 50% { opacity: 0; }
  55%, 90% { opacity: 1; }
  95%, 100% { opacity: 0; }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

@keyframes handshakeStepIn {
  0%, 10% {
    opacity: 0.5;
    transform: translateX(-8px);
  }
  20%, 80% {
    opacity: 1;
    transform: translateX(0);
    border-color: var(--hero-accent-glow, var(--accent-glow));
    background: var(--hero-accent-dim, var(--accent-dim));
  }
  90%, 100% {
    opacity: 0.5;
    transform: translateX(-8px);
    border-color: var(--border);
    background: var(--bg-elevated);
  }
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 8px var(--hero-accent-dim, var(--accent-dim));
  }
  50% {
    box-shadow: 0 0 20px var(--hero-accent-glow, var(--accent-glow)),
                0 0 40px var(--hero-accent-dim, var(--accent-dim));
  }
}


/* ==========================================================
   23. UTILITY CLASSES
   ========================================================== */

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

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

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

.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;
}


/* ==========================================================
   24. RESPONSIVE - TABLET (<=1024px)
   ========================================================== */

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .sidebar-toggle {
    display: flex;
  }

  .content {
    margin-left: 0;
  }

  .search-overlay {
    left: 0;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-visual {
    order: -1;
  }

  .hero-subtitle::before {
    display: none;
  }

  .packet-animation,
  .hero-anim-packet-flow {
    max-width: 280px;
  }

  .packet-wire,
  .anim-wire {
    height: 60px;
  }
}


/* ==========================================================
   25. RESPONSIVE - MOBILE (<=768px)
   ========================================================== */

@media (max-width: 768px) {
  .rfc-document {
    padding: 0 20px;
  }

  .rfc-hero {
    padding: 40px 0;
    min-height: auto;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section-heading {
    font-size: 1.3rem;
  }

  .subsection-heading {
    font-size: 1.1rem;
  }

  /* Tables stack on mobile */
  .comparison-header,
  .comparison-row {
    grid-template-columns: 1fr;
  }

  .comparison-header .comparison-col:first-child {
    display: none;
  }

  .comparison-row .comparison-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 0;
    color: var(--text-muted);
    font-weight: 600;
  }

  .comparison-col {
    padding: 6px 16px;
  }

  .comparison-row .comparison-col:first-child {
    padding-top: 12px;
  }

  .comparison-row .comparison-col:last-child {
    padding-bottom: 12px;
  }

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

  .key-points {
    grid-template-columns: 1fr;
  }

  .field-table-row {
    grid-template-columns: 1fr;
  }

  .field-table-name {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 16px;
  }

  .field-table-val {
    padding: 8px 16px;
  }

  .field-item {
    flex-direction: column;
    gap: 6px;
  }

  .search-kbd {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-right {
    align-items: center;
  }

  .scroll-indicator {
    display: none;
  }

  .topbar-center {
    display: none;
  }

  /* Simplify hero animations on mobile */
  .hero-anim-tree .anim-tree-children {
    gap: 6px;
  }

  .hero-anim-handshake .anim-step {
    padding: 10px 14px;
  }

  .hero-anim-layers .anim-layer {
    padding: 10px 14px;
  }

  /* Search overlay full width */
  .search-results {
    margin: 16px;
    max-height: calc(100vh - var(--topbar-height) - 40px);
  }
}


/* ==========================================================
   26. RESPONSIVE - SMALL MOBILE (<=480px)
   ========================================================== */

@media (max-width: 480px) {
  .rfc-document {
    padding: 0 16px;
  }

  .rfc-section {
    padding: 32px 0;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-meta-item {
    flex-direction: column;
    gap: 2px;
  }

  .hero-meta-label {
    min-width: auto;
  }

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

  .opcode-card {
    padding: 16px;
  }

  .packet-ascii {
    font-size: 0.6rem;
    padding: 12px 14px;
  }

  .code-block code {
    font-size: 0.72rem;
  }

  .callout {
    padding: 12px 14px;
    gap: 10px;
  }

  .callout-content {
    font-size: 0.82rem;
  }

  .key-point {
    padding: 16px;
  }

  .hero-badge-row {
    flex-wrap: wrap;
  }

  .hero-badge,
  .hero-badge-status {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .comparison-table {
    font-size: 0.8rem;
  }

  .section-heading {
    font-size: 1.15rem;
  }

  .subsection-heading {
    font-size: 1rem;
  }

  .hero-anim {
    max-width: 260px;
  }

  .hero-anim-packet-flow,
  .packet-animation {
    max-width: 240px;
  }
}


/* ==========================================================
   27. PREFERS REDUCED MOTION
   ========================================================== */

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

  html {
    scroll-behavior: auto;
  }

  .rfc-section {
    opacity: 1;
    transform: none;
  }

  .scroll-indicator {
    animation: none;
  }

  .packet-dot,
  .anim-dot {
    animation: none;
    top: 50%;
  }
}


/* ==========================================================
   28. PRINT STYLES
   ========================================================== */

@media print {
  .topbar,
  .sidebar,
  .sidebar-overlay,
  #bg-canvas,
  .scroll-indicator,
  .search-overlay,
  .search-box,
  .theme-toggle,
  .external-link,
  .sidebar-toggle,
  .packet-animation,
  .hero-anim,
  .hero-anim-packet-flow,
  .hero-anim-handshake,
  .hero-anim-layers,
  .hero-anim-tree,
  .hero-anim-lock,
  .hero-visual {
    display: none !important;
  }

  .content {
    margin-left: 0 !important;
    margin-top: 0 !important;
  }

  .rfc-hero {
    min-height: auto;
    padding: 20px 0;
  }

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

  .rfc-section {
    opacity: 1 !important;
    transform: none !important;
    page-break-inside: avoid;
  }

  .rfc-document {
    max-width: 100%;
    padding: 0;
  }

  body {
    background: white;
    color: black;
    font-size: 12pt;
    line-height: 1.5;
  }

  .hero-title {
    font-size: 20pt;
    color: black;
  }

  .hero-subtitle {
    color: #333;
  }

  .hero-subtitle::before {
    display: none;
  }

  .section-heading {
    color: black;
    font-size: 16pt;
  }

  .subsection-heading {
    color: black;
    font-size: 14pt;
  }

  .section-body p {
    color: black;
  }

  .hero-badge,
  .hero-badge-status,
  .rfc-badge {
    border: 1px solid #999;
    color: #333;
    background: #f0f0f0;
  }

  .callout {
    border: 1px solid #ccc;
    background: #f9f9f9;
    page-break-inside: avoid;
  }

  .comparison-table,
  .field-table,
  .packet-diagram,
  .opcode-grid,
  .code-block {
    page-break-inside: avoid;
  }

  .packet-diagram {
    border: 1px solid #ccc;
  }

  .packet-ascii {
    color: black;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  .rfc-footer {
    border-top: 1px solid #ccc;
  }
}


/* ==========================================================
   ADDENDUM: Missing classes required by app.js
   ========================================================== */

/* ---- Sidebar: Authors Footer ---- */

.sidebar-authors-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.sidebar-author {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 2px 0;
}

.sidebar-author-org {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}

/* ---- Sidebar: RFC List Title & Category Controls ---- */

.rfc-list-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 20px 8px;
}

.cat-arrow {
  display: inline-block;
  font-size: 0.6rem;
  color: var(--text-muted);
  transition: transform var(--transition);
  width: 12px;
}

.cat-count {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: auto;
  font-family: var(--font-mono);
}

/* ---- Basic RFC Page ---- */

.rfc-hero-basic {
  text-align: center;
  padding: 80px 40px 60px;
}

.rfc-hero-basic .hero-badge-row {
  justify-content: center;
}

.rfc-hero-basic .hero-title {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.rfc-hero-basic .hero-meta {
  justify-content: center;
}

.basic-rfc-actions {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bg-primary);
  background: var(--hero-accent, var(--accent));
  border: none;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 20px var(--hero-accent-dim, var(--accent-dim));
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--hero-accent-glow, var(--accent-glow));
}

/* ---- Packet-flow: extra detail ---- */

.anim-node-extra {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
  opacity: 0.7;
}

/* ---- Packet-flow wire label aliases ---- */
/* app.js uses .anim-wire-req / .anim-wire-rep */

.anim-wire-req {
  top: 10px;
  animation: showReq 3s ease-in-out infinite;
}

.anim-wire-rep {
  bottom: 10px;
  animation: showRep 3s ease-in-out infinite;
}

/* ---- Layer highlight ---- */

.anim-layer-highlight {
  border-color: var(--hero-accent, var(--accent)) !important;
  background: linear-gradient(135deg, var(--hero-accent-dim, var(--accent-dim)), var(--bg-elevated)) !important;
}

.anim-layer-highlight .anim-layer-name {
  color: var(--hero-accent, var(--accent));
}

/* ---- Handshake Animation (app.js class names) ---- */

.anim-hs-sides {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 8px;
}

.anim-hs-side {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hero-accent, var(--accent));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.anim-hs-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.anim-hs-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  opacity: 0;
  animation: handshakeStepIn 0.5s ease forwards;
}

.anim-hs-from-left {
  flex-direction: row;
}

.anim-hs-from-right {
  flex-direction: row-reverse;
}

.anim-hs-arrow {
  width: 24px;
  height: 2px;
  background: var(--hero-accent, var(--accent));
  flex-shrink: 0;
  position: relative;
}

.anim-hs-from-left .anim-hs-arrow::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -4px;
  border-left: 6px solid var(--hero-accent, var(--accent));
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.anim-hs-from-right .anim-hs-arrow::after {
  content: '';
  position: absolute;
  left: -1px;
  top: -4px;
  border-right: 6px solid var(--hero-accent, var(--accent));
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.anim-hs-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.anim-hs-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
}

.anim-hs-from-right .anim-hs-desc {
  margin-left: 0;
  margin-right: auto;
}

/* ---- Request-Response Animation ---- */

.hero-anim-request-response {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 8px 0;
}

.anim-rr-block {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow: hidden;
}

.anim-rr-request {
  border-left: 3px solid var(--hero-accent, var(--accent));
  animation: fadeInUp 0.5s ease forwards;
}

.anim-rr-response {
  border-left: 3px solid var(--accent-green);
  opacity: 0;
  animation: fadeInUp 0.5s ease 0.8s forwards;
}

.anim-rr-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.anim-rr-line {
  padding: 2px 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.anim-rr-method {
  color: var(--hero-accent, var(--accent));
  font-weight: 600;
}

.anim-rr-status {
  color: var(--accent-green);
  font-weight: 600;
}

.anim-rr-header {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.anim-rr-arrow {
  color: var(--text-muted);
  animation: pulse 1.5s ease-in-out infinite;
}

.anim-rr-arrow svg {
  display: block;
}

/* ---- Data-Format Animation ---- */

.hero-anim-data-format {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 8px 0;
}

.anim-df-block {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow: hidden;
}

.anim-df-line {
  padding: 3px 0;
  color: var(--text-secondary);
  line-height: 1.6;
  opacity: 0;
  transform: translateX(-8px);
  animation: fadeInUp 0.3s ease forwards;
  white-space: pre;
}

.anim-df-line:nth-child(odd) {
  color: var(--hero-accent, var(--accent));
}

/* ---- Fallback Animation ---- */

.hero-anim-fallback {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  min-height: 160px;
}

.anim-fallback-badge {
  color: var(--hero-accent, var(--accent));
  opacity: 0.5;
  animation: pulse 2s ease-in-out infinite;
}

.anim-fallback-badge svg {
  display: block;
}

/* ---- Responsive additions ---- */

@media (max-width: 768px) {
  .rfc-hero-basic {
    padding: 60px 20px 40px;
  }

  .btn-primary {
    padding: 10px 20px;
    font-size: 0.82rem;
  }

  .anim-hs-sides {
    padding: 0 4px;
  }

  .anim-hs-desc {
    display: none;
  }

  .hero-anim-request-response,
  .hero-anim-data-format {
    max-width: 100%;
  }
}


/* ==========================================================
   LANDING PAGE
   ========================================================== */

.landing-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.landing-hero {
  text-align: center;
  padding: 60px 0 48px;
}

.landing-title {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.landing-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0;
  font-weight: 400;
}

.landing-category {
  margin-bottom: 48px;
}

.landing-category-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.landing-card {
  display: block;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.landing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--hero-accent, var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}

.landing-card:hover {
  border-color: var(--hero-accent, var(--accent));
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.landing-card:hover::before {
  opacity: 1;
}

.landing-card-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--hero-accent, var(--accent));
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.landing-card-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 4px;
  line-height: 1.3;
}

.landing-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.landing-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.landing-card-status {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
}

.landing-card-status.status-standard { color: var(--accent-green); background: rgba(52, 211, 153, 0.1); }
.landing-card-status.status-proposed { color: var(--accent-blue); background: rgba(96, 165, 250, 0.1); }
.landing-card-status.status-historic { color: var(--accent-yellow); background: rgba(251, 191, 36, 0.1); }
.landing-card-status.status-informational { color: var(--accent-secondary); background: rgba(167, 139, 250, 0.1); }
.landing-card-status.status-experimental { color: var(--accent-orange); background: rgba(251, 146, 60, 0.1); }
.landing-card-status.status-bcp { color: var(--accent); background: var(--accent-dim); }

.landing-card-date {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* All Other RFCs compact list */

.landing-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2px;
}

.landing-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.landing-list-item:hover {
  background: var(--bg-tertiary);
}

.landing-list-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 64px;
  flex-shrink: 0;
}

.landing-list-name {
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landing-list-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .landing-page {
    padding: 20px 16px 60px;
  }

  .landing-hero {
    padding: 32px 0 24px;
  }

  .landing-title {
    font-size: 1.6rem;
  }

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

  .landing-list {
    grid-template-columns: 1fr;
  }

  .landing-list-date {
    display: none;
  }
}


/* ==========================================================
   JOURNEY: "Life of a Request" Interactive Diagram
   ========================================================== */

.journey {
  margin: 48px 0 64px;
  padding: 0;
}

.journey-header {
  text-align: center;
  margin-bottom: 48px;
}

.journey-title {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0 0 12px;
}

.journey-subtitle {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.journey-timeline {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

/* --- Individual Step --- */

.journey-step {
  display: flex;
  gap: 24px;
  position: relative;
  padding-bottom: 8px;
}

/* --- Connector (dot + line) --- */

.journey-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 56px;
}

.journey-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--hero-accent, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 16px var(--hero-accent-glow, var(--accent-glow));
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.journey-step:hover .journey-dot {
  transform: scale(1.12);
  box-shadow: 0 0 24px var(--hero-accent-glow, var(--accent-glow));
}

.journey-line {
  width: 2px;
  flex: 1;
  min-height: 24px;
  background: linear-gradient(
    to bottom,
    var(--hero-accent, var(--accent)) 0%,
    var(--border) 100%
  );
  opacity: 0.4;
}

/* --- Step Content --- */

.journey-content {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.journey-step:hover .journey-content {
  border-color: var(--hero-accent, var(--accent));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--hero-accent-dim, var(--accent-dim));
}

.journey-step-header {
  margin-bottom: 10px;
}

.journey-step-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hero-accent, var(--accent));
  display: block;
  margin-bottom: 4px;
}

.journey-step-title {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0 0 4px;
}

.journey-step-subtitle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.journey-step-desc {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0 0 14px;
}

/* --- RFC link chips --- */

.journey-rfcs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.journey-rfc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  transition: var(--transition);
  cursor: pointer;
}

.journey-rfc-link:hover {
  border-color: var(--hero-accent, var(--accent));
  color: var(--hero-accent, var(--accent));
  background: var(--hero-accent-dim, var(--accent-dim));
}

.journey-rfc-num {
  font-weight: 600;
  color: var(--hero-accent, var(--accent));
}

.journey-rfc-label {
  color: inherit;
}

.journey-rfc-external .journey-rfc-label::after {
  content: ' ↗';
  font-size: 0.65rem;
  opacity: 0.5;
}

/* --- Responsive --- */

@media (max-width: 768px) {
  .journey-title {
    font-size: 1.35rem;
  }

  .journey-header {
    margin-bottom: 32px;
  }

  .journey-connector {
    width: 40px;
  }

  .journey-dot {
    width: 38px;
    height: 38px;
    font-size: 1.05rem;
  }

  .journey-step {
    gap: 14px;
  }

  .journey-content {
    padding: 14px 16px;
  }

  .journey-step-title {
    font-size: 1rem;
  }

  .journey-step-desc {
    font-size: 0.82rem;
  }

  .journey-rfcs {
    gap: 6px;
  }

  .journey-rfc-link {
    font-size: 0.72rem;
    padding: 3px 8px;
  }
}

@media (max-width: 480px) {
  .journey-connector {
    width: 32px;
  }

  .journey-dot {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .journey-step {
    gap: 10px;
  }
}
