/* Fonts loaded via <link> in HTML (preconnect + display=swap) — avoid CSS @import. */

/* AIDegrees — Neutral slate + restrained cyan accent */

:root {
  /* Type scale (7 steps) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3.5rem;

  --font-headline: 'Lexend', system-ui, sans-serif;
  --font-body: 'Lexend', system-ui, -apple-system, sans-serif;
  --font-label: system-ui, -apple-system, sans-serif;
  --font-logo: 'Alata', 'Lexend', system-ui, sans-serif;

  --heading: #0c1929;
  --text: #0c1929;
  --text-secondary: #475569;
  --muted: #64748b;
  --border: #dce5ec;
  --border-light: #e8eef3;
  --surface: #ffffff;
  --bg: #f5f9fc;
  --surface-muted: #f5f9fc;
  --table-head: #f5f9fc;

  --accent: #0ea5e9;
  --accent-hover: #0369a1;
  --accent-soft: #38bdf8;
  --accent-deep: #0369a1;
  --accent-bg: #e0f2fe;
  --accent-range: #bae6fd;
  --heading-secondary: #0c1929;

  --callout-bg: #f5f9fc;
  --callout-border: #dce5ec;
  --footer-bg: #0c1929;
  --footer-text: rgba(255, 255, 255, 0.72);
  --footer-heading: #ffffff;
  --footer-divider: rgba(255, 255, 255, 0.12);
  --cta-text: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.92);
  --rank-1: #0369a1;
  --rank-2: #0ea5e9;
  --rank-badge: var(--rank-2);
  --bg-glow: none;
  --shadow: 0 1px 2px rgba(12, 25, 41, 0.04), 0 4px 14px rgba(12, 25, 41, 0.03);
  --shadow-hover: 0 4px 14px rgba(12, 25, 41, 0.08);
  --focus-ring: 0 0 0 3px rgba(14, 165, 233, 0.3);

  --keyfacts-bg: var(--callout-bg);

  --site-width: 1120px;
  --content-width: 800px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --hero-bg: #070b12;
  --hero-text: #f1f5f9;
  --hero-muted: rgba(255, 255, 255, 0.62);
  --hero-border: rgba(255, 255, 255, 0.1);
  --hero-surface: rgba(255, 255, 255, 0.06);

  --page-hero-bg: #ffffff;
  --page-hero-text: #0c1929;
  --page-hero-muted: #64748b;
  --page-hero-border: #e8eef3;

  --chart-1: #0369a1;
  --chart-2: #0ea5e9;
  --chart-3: #38bdf8;
  --chart-4: #7dd3fc;
  --chart-5: #bae6fd;
  --chart-track: #e8eef3;
  --chart-fill: #38bdf8;

  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --info: #0ea5e9;
  --info-bg: #f0f9ff;
  --info-border: #bae6fd;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --positive: #059669;
  --negative: #dc2626;
}

/* Dark theme: head script always sets data-theme */
:root[data-theme="dark"] {
  --heading: #f1f5f9;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --muted: #94a3b8;
  --border: #243044;
  --border-light: #1a2436;
  --surface: #0f1623;
  --bg: #070b12;
  --surface-muted: #151e2e;
  --table-head: #151e2e;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-soft: #0ea5e9;
  --accent-deep: #7dd3fc;
  --accent-bg: #0c4a6e;
  --accent-range: #0c2233;
  --heading-secondary: #f1f5f9;
  --callout-bg: #151e2e;
  --callout-border: #243044;
  --footer-bg: #05080e;
  --footer-text: rgba(255, 255, 255, 0.68);
  --footer-heading: #f1f5f9;
  --footer-divider: rgba(255, 255, 255, 0.1);
  --header-bg: rgba(7, 11, 18, 0.9);
  --rank-1: #7dd3fc;
  --rank-2: #38bdf8;
  --rank-badge: var(--rank-2);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.4);
  --focus-ring: 0 0 0 3px rgba(56, 189, 248, 0.35);
  --page-hero-bg: #0f1623;
  --page-hero-text: #f1f5f9;
  --page-hero-muted: #94a3b8;
  --page-hero-border: #243044;
  --chart-track: #243044;
  --chart-fill: #38bdf8;
  --success-bg: #052e1a;
  --success-border: #065f46;
  --warning-bg: #2a1f05;
  --warning-border: #92400e;
  --info-bg: #0c1929;
  --info-border: #075985;
  --danger-bg: #2a0a0a;
  --danger-border: #991b1b;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

main { flex: 1; }

/* Headlines: Lexend */
h1, h2, h3, h4,
.page-title,
.hero h1,
.toc-title,
.key-facts h3,
.related-card h3,
.card h3,
.sidebar h3,
.author-bio h3,
.site-footer h4,
.section-label,
.stat-value {
  font-family: var(--font-headline);
}

/* Labels only: JetBrains Mono (not nav/CTA — keeps product readable) */
.card-tag,
.note,
.stat-label,
th,
.section-kicker {
  font-family: var(--font-label);
}

.card-tag,
.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

th {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.note,
.stat-label {
  letter-spacing: 0.01em;
}

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

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

a:focus-visible,
button:focus-visible,
.theme-toggle:focus-visible,
.header-cta:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

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

/* ── Page hero — light research band (white page, dark type) ── */

.page-hero {
  background: var(--page-hero-bg);
  color: var(--page-hero-text);
  padding: 2.25rem 0 2.5rem;
  border-bottom: 1px solid var(--page-hero-border);
  background-image: none;
  position: relative;
}

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

.page-hero .section-kicker {
  color: var(--accent-deep);
  margin: 0 0 0.55rem;
}

a.section-kicker {
  text-decoration: none;
  width: fit-content;
}

a.section-kicker:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.page-hero a.section-kicker:hover {
  color: var(--accent);
}

.page-hero h1,
.page-hero .page-title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.9rem, 4vw, 2.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--page-hero-text);
}

.page-hero-lead,
.page-hero .deck {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--page-hero-muted);
  max-width: 40rem;
}

.page-hero .article-meta {
  color: var(--page-hero-muted);
  margin: 0 0 0.15rem;
}

.page-hero .page-updated {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
}

/* Reading column — Medium-like ~680px for heroes + article/hub body */
.page-hero > .container,
.page-hero > .container-wide,
.page-main > .container,
.page-main > .container-wide {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Legacy alias — same padding as .page-hero */
.page-hero--compact {
  padding: 1.75rem 0 2.25rem;
}

/* ── Layout bands ── */

.page-main {
  padding: 2.5rem 0 4rem;
}

.page-main--band {
  background: var(--surface);
}

.section-block {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.section-block:last-child {
  border-bottom: none;
}

.section-title {
  margin: 0 0 1.5rem;
  font-family: var(--font-headline);
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--heading);
  line-height: 1.2;
}

.section-title--sm {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.section-subtitle {
  margin: 1.25rem 0 0.5rem;
  font-family: var(--font-headline);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--heading);
  line-height: 1.3;
}

.how-choose-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin: 1.5rem 0 2.25rem;
  max-width: 42rem;
}

.how-choose-item {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 0.85rem 1rem;
  align-items: start;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.how-choose-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  border-radius: var(--radius-sm, 6px);
  background: var(--accent-bg);
  color: var(--accent-deep);
  flex-shrink: 0;
}

.how-choose-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  color: currentColor;
  overflow: visible;
}

.how-choose-icon .aidr-accent {
  stroke: var(--accent);
}

.how-choose-icon .aidr-accent-fill {
  fill: var(--accent);
  stroke: none;
}

.how-choose-copy {
  min-width: 0;
}

.how-choose-title {
  display: block;
  margin: 0.15rem 0 0;
  font-family: var(--font-headline);
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--heading);
}

.how-choose-item p {
  margin: 0.4rem 0 0;
  font-size: 0.975rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

[data-theme="dark"] .how-choose-item {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: none;
}

[data-theme="dark"] .how-choose-icon-wrap {
  background: rgba(14, 165, 233, 0.14);
  color: var(--accent-soft);
}


}

/* ── Buttons ── */

.btn-primary {
  display: inline-block;
  padding: 0.75rem 1.35rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--cta-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(3, 105, 161, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(3, 105, 161, 0.45);
  text-decoration: none;
  color: var(--cta-text);
}

.btn-text {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

.btn-text:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.btn-secondary {
  display: inline-block;
  padding: 0.75rem 1.35rem;
  background: var(--surface);
  color: var(--heading);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.btn-secondary:hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--heading);
}

.btn-outline {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.btn-outline:hover {
  background: var(--accent-bg);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--accent-hover);
}

.btn-ghost {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.btn-ghost:hover {
  color: var(--accent);
  background: var(--surface-muted);
  text-decoration: none;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* ── Stat strip ── */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.15rem;
  box-shadow: var(--shadow);
}

.stat-card-value {
  display: block;
  font-family: var(--font-headline);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--heading);
  line-height: 1.1;
  margin-bottom: 0.45rem;
}

.stat-card-label {
  display: block;
  font-family: var(--font-label);
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ── Panels & charts ── */

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.45rem;
  box-shadow: var(--shadow);
}

.panel h3 {
  margin: 0 0 1.15rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--heading);
}

.bar-chart {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.bar-chart li {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 0.6rem 0.85rem;
  align-items: center;
}

.bar-label {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.3;
}

.bar-track {
  height: 0.45rem;
  background: var(--surface-muted);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: var(--chart-fill);
  border-radius: 999px;
}

.bar-pct {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 2.5rem;
  text-align: right;
}

.req-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.req-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.req-list li:last-child { border-bottom: none; }

.req-list li span { color: var(--text); }

.req-list li strong {
  font-family: var(--font-label);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

/* ── Hub card grid ── */

.card-grid--2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

@media (max-width: 960px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .card-grid--2col { grid-template-columns: 1fr; }
  .bar-chart li { grid-template-columns: 1fr; gap: 0.35rem; }
  .bar-pct { text-align: left; }
}

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

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: none;
}

:root[data-theme="dark"] .site-header {
  background: rgba(12, 25, 41, 0.94);
}



.header-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--heading);
  font-family: var(--font-logo);
  font-size: 1.12rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

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

.logo-mark {
  display: block;
  width: 2.05rem;
  height: 2.05rem;
  padding: 0;
  margin: 0;
  border-radius: 0;
  background: none;
  object-fit: contain;
  flex-shrink: 0;
  align-self: center;
  order: 1;
}

.logo-text {
  display: inline-flex;
  align-items: center;
  color: inherit;
  font-family: var(--font-logo);
  line-height: 1;
  margin: 0;
  padding: 0;
  /* Optical center with the mark (Alata sits slightly low on the em box). */
  transform: translateY(-0.06em);
  order: 2;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem 1.15rem;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
}

.nav-item {
  position: relative;
}

.nav-link,
.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: var(--heading);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover,
.nav-trigger:hover,
.nav-item.is-active > .nav-link,
.nav-item.is-active > .nav-trigger,
.nav-item.is-open > .nav-trigger {
  color: var(--accent-deep);
  text-decoration: none;
  background: transparent;
}

.nav-chevron {
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.nav-item.is-open .nav-chevron {
  transform: rotate(225deg) translateY(-1px);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 15.5rem;
  padding: 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(12, 25, 41, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
  z-index: 120;
}

.nav-item:hover > .nav-dropdown,
.nav-item:focus-within > .nav-dropdown,
.nav-item.is-open > .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 0.55rem 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.nav-dropdown a:hover,
.nav-dropdown a:focus-visible {
  background: var(--surface-muted);
  color: var(--heading);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--heading);
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.05rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

.header-cta {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  background: var(--accent-deep);
  color: var(--cta-text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
  transition: background 0.15s ease, filter 0.15s;
}

.header-cta:hover {
  background: var(--accent);
  filter: none;
  transform: none;
  box-shadow: none;
  text-decoration: none;
  color: var(--cta-text);
}

/* Legacy dark/hero header modifiers — keep light chrome like Programs.com */
.site-header.site-header--dark,
.site-header.site-header--hero {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

:root[data-theme="dark"] .site-header.site-header--dark,
:root[data-theme="dark"] .site-header.site-header--hero {
  background: rgba(12, 25, 41, 0.94);
}



@media (max-width: 1040px) {
  .nav-toggle {
    display: inline-flex;
    order: 3;
  }

  .header-actions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem 1rem 1.15rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 28px rgba(12, 25, 41, 0.08);
  }

  .site-header.is-nav-open .header-actions {
    display: flex;
  }

  .site-nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.15rem;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link,
  .nav-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 0.7rem 0.55rem;
  }

  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    box-shadow: none;
    border: 0;
    background: var(--surface-muted);
    margin: 0 0 0.35rem;
    min-width: 0;
  }

  .nav-item.is-open > .nav-dropdown {
    display: block;
  }

  .header-cta {
    text-align: center;
    width: 100%;
  }

  .theme-toggle {
    align-self: flex-start;
  }
}

@media (min-width: 1041px) {
  .nav-item.has-dropdown:hover > .nav-trigger {
    color: var(--accent-deep);
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

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

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

:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }


  :root:not([data-theme="light"])[data-theme="light"] .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"])[data-theme="light"] .theme-toggle .icon-moon { display: inline; }
}

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

/* ── Layout ── */

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-wide {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Optional nested reading column */
.prose-column {
  max-width: var(--content-width);
}

/* ── Article header ── */

.page-title {
  margin: 0 0 0.55rem;
  font-size: clamp(2rem, 4.5vw, 2.5rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--heading);
}

.article-meta {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
  margin: 0.35rem 0 0;
  font-family: var(--font-body);
  letter-spacing: 0;
  text-transform: none;
}

.article-meta em { font-style: normal; }

.article-meta a {
  color: var(--muted);
  text-decoration: none;
}

.article-meta a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

.hero {
  background: transparent;
  color: var(--text);
  padding: 2.75rem 0 0;
}

.hero .container { padding-top: 0; }

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 4.5vw, 2.5rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--heading);
}

.hero p {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.65;
}

.hero-compact { padding-top: 2.75rem; }

/* ── Typography ── */

h2 {
  font-size: 1.4rem;
  margin: 2.5rem 0 0.85rem;
  color: var(--heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--heading);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.section-kicker {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.page-main .section-kicker {
  margin-top: 0;
}

.lead,
.deck {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 1.35rem;
}

.section-intro { margin-bottom: 1.5rem; }

.note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.65rem 0 0;
}

p { margin: 0 0 1rem; }

/* ── Key facts & TOC ── */

.key-facts {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin: 1.5rem 0;
  box-shadow: none;
}

.key-facts h3 {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.01em;
}

.key-facts ul {
  margin: 0;
  padding-left: 1.15rem;
}

.key-facts li {
  margin: 0.4rem 0;
  font-size: 0.98rem;
  line-height: 1.55;
}

.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 1.5rem 0 2rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.toc > summary.toc-title,
.toc-title {
  margin: 0;
  padding: 0.9rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--heading);
  background: var(--callout-bg);
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-headline);
  user-select: none;
}

.toc > summary.toc-title::-webkit-details-marker {
  display: none;
}

.toc > summary.toc-title::after {
  content: "+";
  font-family: var(--font-label);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.toc[open] > summary.toc-title {
  border-bottom: 1px solid var(--border);
}

.toc[open] > summary.toc-title::after {
  content: "−";
}

.toc > summary.toc-title:hover {
  background: var(--surface-muted);
}

.toc ul {
  margin: 0;
  padding: 0.85rem 1.15rem 0.95rem 2rem;
  list-style: disc;
}

.toc li {
  margin: 0.4rem 0;
  font-size: 0.95rem;
}

.toc a {
  color: var(--accent);
  font-weight: 500;
}

/* ── Cards ── */

.card-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

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

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

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--heading);
}

.card p {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
}

.card-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

a.card:hover .card-link {
  text-decoration: underline;
}

.card-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.related-section {
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-section h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.related-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.7rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.related-card:hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  background: var(--surface);
}

.related-card .card-tag { margin-bottom: 0.35rem; }

.related-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--heading);
}

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

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.quick-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--heading);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.quick-links a::after {
  content: "→";
  color: var(--accent);
  font-weight: 600;
  transition: transform 0.15s;
}

.quick-links a:hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--heading);
}

.quick-links a:hover::after {
  transform: translateX(3px);
}

/* ── Tables ── */

.table-wrap {
  overflow-x: auto;
  margin: 1.15rem 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.table-wrap caption {
  caption-side: bottom;
  padding: 0.65rem 0.15rem 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: left;
  line-height: 1.45;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 0.8rem 1.05rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--table-head);
  font-weight: 600;
  color: var(--heading);
  font-size: 0.7rem;
}

tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover td {
  background: var(--bg);
}

.rank-col {
  width: 3.25rem;
  font-family: var(--font-headline);
  font-weight: 800;
  color: var(--rank-2);
  font-size: 1.05rem;
}

.rank-col--1,
tr:nth-child(1) > .rank-col {
  color: var(--rank-1);
}

tr:nth-child(2) > .rank-col,
tr:nth-child(3) > .rank-col {
  color: var(--rank-2);
}

tr:nth-child(n+4) > .rank-col {
  color: var(--text-secondary);
  font-weight: 700;
}

/* Ranking research tables — restrained */
.table-wrap--ranking {
  box-shadow: none;
  border-color: var(--border-light);
}

.table-wrap--ranking th {
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
}

.chart-range {
  background: var(--accent-range);
}

/* ── Info boxes ── */

.info-box {
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  border-left: 4px solid var(--accent);
  padding: 1.05rem 1.2rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  font-size: 0.98rem;
  line-height: 1.6;
}

.info-box strong { color: var(--heading); }

.content-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}

.sidebar h3 {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--heading);
}

.sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

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

.stats-row {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 0.65rem;
  margin: 1.35rem 0;
}

.stats-row > .stat {
  flex: 1 1 calc(25% - 0.5rem);
  min-width: min(100%, 10.5rem);
  box-sizing: border-box;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.05rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--heading);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.school-stats {
  flex-direction: row;
  gap: 0.65rem;
}

.school-stats .stat {
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.15rem 0.65rem;
  gap: 0.35rem;
  background: linear-gradient(180deg, var(--callout-bg) 0%, var(--surface) 100%);
  border-color: var(--callout-border);
}

.school-stats .stat-value {
  font-size: 1.45rem;
  line-height: 1.15;
  color: var(--accent);
}

.school-stats .stat-label {
  font-size: 0.68rem;
  text-align: center;
  line-height: 1.3;
  text-transform: uppercase;
}

@media (max-width: 540px) {
  .school-stats { flex-direction: column; }

  .stats-row > .stat {
    flex: 1 1 100%;
    min-width: 0;
  }
}

.check-list {
  padding-left: 0;
  list-style: none;
  margin: 0 0 1rem;
}

.check-list li {
  padding: 0.4rem 0 0.4rem 1.65rem;
  position: relative;
  line-height: 1.55;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.author-bio {
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  box-shadow: none;
}

.author-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: #e8eef3;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.author-bio-body {
  min-width: 0;
}

.author-bio h3 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading);
}

.author-bio h3 a {
  color: inherit;
  text-decoration: none;
}

.author-bio h3 a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

.author-role {
  display: block;
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 400;
}

.author-bio p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.author-bio p + p {
  margin-top: 0.65rem;
}

/* Contributor profile page */
.contributor-profile {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  margin: 0 0 3rem;
}

.contributor-profile .author-avatar {
  width: 7.5rem;
  height: 7.5rem;
  font-size: 1rem;
}

.contributor-profile-copy h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 3vw, 2.15rem);
  font-weight: 800;
  color: var(--heading);
  letter-spacing: -0.02em;
}

.contributor-profile-copy .author-role {
  margin-bottom: 1.15rem;
  font-size: 1.05rem;
}

.contributor-profile-copy p {
  margin: 0 0 1rem;
  color: var(--text);
  line-height: 1.7;
  font-size: 1.02rem;
}

.contributor-profile-copy p:last-of-type {
  margin-bottom: 0;
}

.contributor-posts {
  margin-top: 2.5rem;
}

.contributor-posts h2 {
  margin: 0 0 1.15rem;
  font-size: 1.45rem;
}

.post-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 0.55rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}

.post-row:hover {
  background: var(--border-light);
  text-decoration: none;
}

.post-row-title {
  margin: 0;
  font-family: var(--font-headline);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.35;
}

.post-row-cta {
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent-deep);
  white-space: nowrap;
}

.contributor-card {
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
}

.contributor-card:last-child {
  border-bottom: none;
}

.contributor-card:hover .contributor-card-name {
  color: var(--accent-deep);
}

.contributor-card .author-avatar {
  width: 4.25rem;
  height: 4.25rem;
}

.contributor-card-name {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading);
}

.contributor-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

@media (max-width: 640px) {
  .contributor-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .post-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* About page */
.about-stats {
  margin: 1.75rem 0 0.5rem;
  grid-template-columns: repeat(3, 1fr);
}

.about-cover-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin: 1.25rem 0 2rem;
}

.about-cover-card {
  padding: 1.25rem 1.35rem;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.about-cover-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  color: var(--heading);
}

.about-cover-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.team-list {
  margin: 1.25rem 0 2rem;
  border-top: 1px solid var(--border-light);
}

.team-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}

.team-list-item strong {
  font-family: var(--font-headline);
  font-size: 1.05rem;
  color: var(--heading);
}

.team-list-item span {
  font-size: 0.95rem;
  color: var(--muted);
}

.about-cta {
  margin: 2.5rem 0 0;
  padding: 1.75rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.about-cta h2 {
  margin: 0 0 0.45rem;
  font-size: 1.35rem;
}

.about-cta p {
  margin: 0 0 1.15rem;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .about-stats {
    grid-template-columns: 1fr;
  }
}

/* ── Footer ── */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 2.75rem 0 1.75rem;
  font-size: 0.9rem;
  margin-top: auto;
}

.footer-brand {
  margin-bottom: 1.75rem;
}

.footer-brand .logo {
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.footer-brand .logo .logo-text {
  color: #ffffff;
}

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

.footer-brand p {
  margin: 0;
  max-width: 28rem;
  font-size: 0.88rem;
  line-height: 1.55;
  opacity: 0.85;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 2rem;
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }
}

.site-footer h4 {
  color: var(--footer-heading);
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-label);
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li { padding: 0.25rem 0; }

.site-footer a {
  color: var(--footer-text);
  text-decoration: none;
  font-size: 0.9rem;
}

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

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--footer-divider);
  font-size: 0.78rem;
  opacity: 0.65;
  font-family: var(--font-label);
  letter-spacing: 0.02em;
}

.site-footer .container-wide {
  max-width: var(--site-width);
}

/* Selection */
::selection {
  background: var(--accent-bg);
  color: var(--heading);
}

/* ── Design system extensions ── */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--cta-text);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  left: 0.5rem;
}

/* Badges & chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-label);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
}

.badge--accent {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: var(--callout-border);
}

.badge--online {
  color: var(--info);
  background: var(--info-bg);
  border-color: var(--info-border);
}

.badge--new {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success-border);
}

.badge--rank {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border: none;
  min-width: 1.75rem;
  justify-content: center;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.85rem 0 1.15rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.chip:hover {
  border-color: var(--accent-soft);
  color: var(--accent);
}

.chip--active {
  background: var(--accent-bg);
  border-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* Forms & search */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--heading);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: var(--focus-ring);
}

.textarea {
  min-height: 6rem;
  resize: vertical;
}

.search-bar {
  display: flex;
  align-items: stretch;
  max-width: 32rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-bar .input {
  border: none;
  border-radius: 0;
  box-shadow: none;
  flex: 1;
}

.search-bar .btn-primary {
  border-radius: 0;
  padding-inline: 1.25rem;
  box-shadow: none;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}

.filter-bar label {
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* Alerts & callouts */
.alert {
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 1.15rem 0;
}

.alert strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--heading);
  font-size: 0.88rem;
}

.alert--tip {
  background: var(--callout-bg);
  border-color: var(--callout-border);
  border-left: 4px solid var(--accent);
}

.alert--info {
  background: var(--info-bg);
  border-color: var(--info-border);
  border-left: 4px solid var(--info);
}

.alert--warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  border-left: 4px solid var(--warning);
}

.alert--success {
  background: var(--success-bg);
  border-color: var(--success-border);
  border-left: 4px solid var(--success);
}

.methodology-box {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin: 1.75rem 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.methodology-box h4 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--heading);
}

.data-source {
  font-family: var(--font-label);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.65rem;
  line-height: 1.45;
}

.blockquote,
.pull-quote {
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--accent);
  background: var(--callout-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.blockquote p,
.pull-quote p {
  margin: 0;
  font-family: var(--font-headline);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.blockquote cite,
.pull-quote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-style: normal;
  color: var(--muted);
}

/* Trends & metrics */
.trend {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 600;
}

.trend--up { color: var(--positive); }
.trend--down { color: var(--negative); }

.metric-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.metric-inline .stat-card-value {
  display: inline;
  font-size: 1.25rem;
  margin: 0;
}

/* Charts (shared) */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.chart-card--dark {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--hero-border);
  color: var(--hero-text);
}

.chart-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.chart-kicker {
  margin: 0 0 0.25rem;
  font-family: var(--font-label);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.chart-card--dark .chart-kicker {
  color: var(--hero-muted);
}

.chart-headline {
  margin: 0;
  font-family: var(--font-headline);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--heading);
  line-height: 1.1;
}

.chart-card--dark .chart-headline {
  color: var(--hero-text);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chart-swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.donut {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: conic-gradient(
    var(--chart-1) 0deg 126deg,
    var(--chart-3) 126deg 234deg,
    var(--chart-5) 234deg 306deg,
    var(--chart-track) 306deg 360deg
  );
  position: relative;
  flex-shrink: 0;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 22%;
  background: var(--surface);
  border-radius: 50%;
}

.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 2rem;
}

.sparkline span {
  flex: 1;
  min-width: 4px;
  background: var(--chart-track);
  border-radius: 2px 2px 0 0;
}

.sparkline span:nth-child(4),
.sparkline span:nth-child(7) {
  background: var(--chart-1);
}

.bar-fill--2 { background: var(--chart-2); }
.bar-fill--3 { background: var(--chart-3); }
.bar-fill--range { background: var(--chart-5); }

/* School profile card */
.school-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}

.school-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.school-card-head h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--heading);
}

.school-card-location {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.15rem 0 0;
}

.school-card .school-stats {
  margin: 0.85rem 0 1rem;
}

.school-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Compare strip */
.compare-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.75rem 1rem;
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.compare-strip strong {
  color: var(--heading);
}

/* FAQ accordion */
.faq {
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.faq-item + .faq-item {
  border-top: 1px solid var(--border);
}

.faq-item summary {
  padding: 0.95rem 1.15rem;
  font-weight: 600;
  color: var(--heading);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background 0.12s;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-family: var(--font-label);
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item summary:hover {
  background: var(--surface-muted);
}

.faq-body {
  padding: 0 1.15rem 1rem;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
}

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

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 1.5rem 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.pagination a:hover {
  border-color: var(--accent-soft);
  color: var(--accent);
  background: var(--accent-bg);
}

.pagination .is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--cta-text);
  font-weight: 600;
}

.pagination .is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Newsletter */
.newsletter-box {
  background: linear-gradient(135deg, #0c1929 0%, #0c4a6e 50%, #0369a1 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.85rem;
  margin: 2rem 0;
}

.newsletter-box h3 {
  margin: 0 0 0.4rem;
  color: #fff;
  font-size: 1.15rem;
}

.newsletter-box p {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.78);
  max-width: 28rem;
}

.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 24rem;
}

.newsletter-form .input {
  flex: 1;
  min-width: 12rem;
}

/* Color swatches (UI kit) */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.65rem;
}

.swatch {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.swatch-color {
  height: 3rem;
}

.swatch-meta {
  padding: 0.45rem 0.55rem;
  font-family: var(--font-label);
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.35;
}

.swatch-meta strong {
  display: block;
  color: var(--heading);
  font-size: 0.68rem;
}

.type-scale .type-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

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

.type-meta {
  flex: 0 0 5.5rem;
  font-family: var(--font-label);
  font-size: 0.65rem;
  color: var(--muted);
}

.table-compact th,
.table-compact td {
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
}

.table-striped tbody tr:nth-child(even) td {
  background: var(--surface-muted);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--surface-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty-state h3 {
  margin: 0 0 0.35rem;
  color: var(--heading);
  font-size: 1.05rem;
}

.empty-state p {
  margin: 0 0 1rem;
  font-size: 0.92rem;
}

.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin: 1.25rem 0 0.75rem;
  padding: 1rem 1.1rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.catalog-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--font-label);
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 9rem;
}

.catalog-filters input,
.catalog-filters select {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.catalog-count {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.stat-strip--compact {
  margin: 1rem 0 1.5rem;
}

.card-grid--3col {
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}

.card--compact {
  padding: 0.85rem 1rem;
}

.card--compact h3 {
  font-size: 0.98rem;
  margin: 0 0 0.25rem;
}

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

/* School writeups — Programs-style Overview + summary (AIDR twist) */
.school-rank-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin: var(--space-3) 0 var(--space-6);
}

.school-rank-item {
  --school-rank-name-size: var(--text-2xl);
  --school-rank-name-lh: 1.22;
  --school-rank-loc-size: 0.95rem;
  --school-rank-loc-lh: 1.4;
  --school-rank-loc-gap: 0.55rem;
  --school-rank-badge: 3.1rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-left: 2px solid color-mix(in srgb, var(--accent-deep) 45%, var(--border));
  border-radius: var(--radius-sm);
  padding: 1.3rem 1.4rem 1.15rem 1.2rem;
  box-shadow: none;
}

.school-rank-item:nth-child(even) {
  background: var(--surface-muted);
}

.school-rank-identity {
  display: grid;
  grid-template-columns: var(--school-rank-badge) 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.75rem;
  row-gap: var(--school-rank-loc-gap);
  align-items: center;
  margin: 0 0 1.2rem;
}

.school-rank-num {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--school-rank-badge);
  min-width: var(--school-rank-badge);
  height: var(--school-rank-badge);
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0.5rem;
  background: var(--accent-deep);
  font-family: var(--font-headline);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--cta-text);
  white-space: nowrap;
}

:root[data-theme="dark"] .school-rank-num {
  background: var(--accent);
  color: #0c1929;
}

.school-rank-heading {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  margin: 0;
  font-family: var(--font-headline);
  font-size: var(--school-rank-name-size);
  font-weight: 700;
  line-height: var(--school-rank-name-lh);
  letter-spacing: -0.02em;
  color: var(--heading);
  overflow-wrap: anywhere;
}

.school-rank-location {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  font-size: var(--school-rank-loc-size);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: var(--school-rank-loc-lh);
  color: var(--muted);
}

.school-rank-program {
  margin: 0 0 0.85rem;
  max-width: 42rem;
  font-family: var(--font-headline);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--heading);
}

.school-rank-overview {
  margin: 0 0 1rem;
  max-width: 42rem;
}

.school-rank-summary {
  margin: 0 0 1.05rem;
  max-width: 42rem;
}

.school-rank-subhead {
  margin: 0 0 0.4rem;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--heading);
  letter-spacing: 0;
  text-transform: none;
}

.school-rank-summary .school-rank-subhead {
  color: var(--accent-deep);
}

.school-rank-ov-list {
  margin: 0;
  padding: 0 0 0 1.15rem;
  list-style: disc;
  color: var(--text);
}

.school-rank-ov-list li {
  margin: 0 0 0.32rem;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.school-rank-ov-list li:last-child {
  margin-bottom: 0;
}

.school-rank-ov-program {
  margin-bottom: 0.55rem;
  font-size: 1.02rem;
  line-height: 1.4;
}

.school-rank-ov-list strong {
  font-weight: 700;
  color: var(--heading);
}

.school-rank-summary-text {
  margin: 0 0 0.65rem;
  font-size: 0.98rem;
  line-height: 1.62;
  color: var(--heading);
}

.school-rank-summary-text a {
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.school-rank-summary-text a:hover {
  color: var(--accent);
}

:root[data-theme="dark"] .school-rank-summary-text a {
  color: var(--accent-soft);
}

.school-rank-summary-text:last-child {
  margin-bottom: 0;
}

.school-rank-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem 1.35rem;
  margin: 0.55rem 0 0;
}

.school-rank-cta {
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-secondary);
  text-decoration: none;
}

.school-rank-cta:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

.school-rank-cta--primary {
  font-weight: 700;
  color: var(--accent-deep);
}

.school-rank-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: block;
  color: var(--muted);
  overflow: visible;
}

.school-rank-icon--btn {
  width: 15px;
  height: 15px;
}

.aidr-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
  color: var(--text);
}

.aidr-icon .aidr-accent {
  stroke: var(--accent);
}

.aidr-icon .aidr-accent-fill {
  fill: var(--accent);
  stroke: none;
}

.school-rank-icon .aidr-accent {
  stroke: var(--accent-deep);
}

.school-rank-icon .aidr-accent-fill {
  fill: var(--accent-deep);
  stroke: none;
}

@media (max-width: 640px) {
  .school-rank-item {
    --school-rank-name-size: 1.12rem;
    padding: 1.15rem 1.05rem 1.05rem;
  }

  .school-rank-footer {
    justify-content: flex-start;
  }
}

/* Legacy text-footer links (if any older HTML remains) */
.school-rank-links {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
}

.school-rank-links-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.45rem;
}

@media (max-width: 640px) {
  .catalog-filters label {
    min-width: calc(50% - 0.5rem);
    flex: 1 1 calc(50% - 0.5rem);
  }
  .catalog-filters label:first-child {
    min-width: 100%;
    flex-basis: 100%;
  }
}

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


/* Hub OG / hero art */
.hub-hero-art {
  margin: 1.25rem 0 0;
  max-width: 42rem;
}
.hub-hero-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--page-hero-border);
}


/* profile program links: wrap long titles on phones */
.check-list a {
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 480px) {
  .stat-strip--compact {
    grid-template-columns: 1fr 1fr;
  }
  .home-hero-lead {
    font-size: 1.05rem;
  }
}
