/* ============================================================
   Semaglutide Dr. — AI Native UI Console Aesthetic
   Ground: #0A0E1A  |  Palette: indigo/cyan/emerald
   Fonts: Sora (headings) + IBM Plex Sans (body) + IBM Plex Mono (code/chips)
   ============================================================ */

:root {
  --primary:           #6366F1;
  --primary-50:        #1A1E36;
  --primary-300:       #9396F7;
  --primary-700:       #4548C4;
  --primary-900:       #2D2F7A;
  --secondary:         #22D3EE;
  --accent:            #10B981;
  --indigo:            #6366F1;
  --cyan:              #22D3EE;
  --emerald:           #10B981;
  --neutral-50:        #F5F5F5;
  --neutral-100:       #E4E6F0;
  --neutral-200:       #1E2640;
  --neutral-300:       #283151;
  --neutral-400:       #3A4670;
  --neutral-500:       #8089B0;
  --neutral-700:       #3A4670;
  --neutral-900:       #0A0E1A;
  --bg:                #0A0E1A;
  --surface:           #101627;
  --surface-elevated:  #141B30;
  --surface-glass:     rgba(20, 27, 48, 0.62);
  --text:              #F5F5F5;
  --text-muted:        #A6AECC;
  --text-dim:          #737CA0;
  --rule:              #1E2640;
  --rule-accent:       #6366F1;
  --success:           #10B981;
  --warning:           #F6B73C;
  --danger:            #F87171;
  --info:              #22D3EE;

  --max-width:         75rem;
  --container-px:      clamp(1rem, 3vw, 2.5rem);

  --font-heading:      'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body:         'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-mono:         'IBM Plex Mono', 'JetBrains Mono', 'Courier New', monospace;

  --radius-button:     0.625rem;
  --radius-card:       0.75rem;

  --grad-accent:       linear-gradient(90deg, var(--indigo), var(--cyan), var(--emerald));
  --grad-accent-angle: linear-gradient(135deg, var(--indigo), var(--cyan), var(--emerald));
  --grad-border:       linear-gradient(var(--surface-elevated), var(--surface-elevated)) padding-box,
                       linear-gradient(135deg, var(--indigo), var(--cyan), var(--emerald)) border-box;
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--indigo);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 200ms ease-out;
}

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

a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.5);
  border-radius: 2px;
}

/* ============================================================
   TYPOGRAPHY SCALE
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--text);
}

h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

h3 {
  font-size: 1.3125rem;
  font-weight: 500;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
}

p {
  max-width: 64ch;
  margin-bottom: 1rem;
}

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

.lede {
  font-size: 1.1875rem;
  line-height: 1.55;
  max-width: 64ch;
}

small, .small {
  font-size: 0.875rem;
  line-height: 1.5;
}

.micro {
  font-size: 0.8125rem;
}

code, kbd, samp, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--neutral-200);
  border-radius: 0.25rem;
  padding: 0.1em 0.35em;
}

sup { font-size: 0.7em; }

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  background-clip: padding-box;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--grad-accent);
  opacity: 0.14;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.75rem;
  gap: 1.5rem;
}

.site-brand {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.site-brand::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--indigo);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.8);
  flex-shrink: 0;
}

.site-brand:hover { color: var(--text); text-decoration: none; }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

.site-nav a {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  display: block;
  position: relative;
  transition: color 200ms ease-out;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0.25rem; left: 0.75rem; right: 0.75rem;
  height: 1.5px;
  background: var(--grad-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease-out;
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
  height: 1.5px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--neutral-300);
  color: var(--text-muted);
  border-radius: 0.375rem;
  padding: 0.375rem 0.625rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: color 200ms ease-out, border-color 200ms ease-out;
}

.nav-toggle:hover { color: var(--text); border-color: var(--neutral-500); }
.nav-toggle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    width: 100%;
    order: 3;
    padding-bottom: 0.75rem;
  }

  .site-nav.is-open { display: block; }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .site-nav a {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--rule);
  }

  .site-nav a::after { display: none; }

  .site-header .container {
    flex-wrap: wrap;
  }
}

/* ============================================================
   AURORA BACKDROP (hero)
   ============================================================ */
@keyframes aurora-drift {
  0%   { background-position: 0% 50%; opacity: 0.10; }
  50%  { background-position: 100% 50%; opacity: 0.16; }
  100% { background-position: 0% 50%; opacity: 0.10; }
}

.aurora-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.aurora-bg::before {
  content: '';
  position: absolute;
  top: -20%; left: -20%;
  width: 80%; height: 80%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(99,102,241,0.3) 0%, transparent 70%);
  animation: aurora-drift 28s ease-in-out infinite;
}

.aurora-bg::after {
  content: '';
  position: absolute;
  bottom: -10%; right: -10%;
  width: 70%; height: 70%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(34,211,238,0.18) 0%, transparent 70%);
  animation: aurora-drift 22s ease-in-out infinite reverse;
}

.dot-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(163,172,204,0.08) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .hero-inner {
    grid-template-columns: 46rem 1fr;
    align-items: center;
    gap: 4rem;
  }
}

.hero-content { max-width: 46rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}

.eyebrow::after {
  content: '';
  display: block;
  height: 2px;
  width: 3rem;
  margin-top: 0.375rem;
  background: var(--grad-accent);
  border-radius: 1px;
}

.hero h1 {
  margin-bottom: 1.25rem;
}

.hero .lede {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.cta-row {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

/* Clinical Question Launcher */
.launcher {
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid transparent;
  background-clip: padding-box;
  border-radius: 0.75rem;
  padding: 0.875rem 1.125rem;
  position: relative;
  max-width: 42rem;
}

.launcher::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 0.8125rem;
  background: var(--grad-accent);
  z-index: -1;
  opacity: 0.5;
}

.launcher-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.launcher-placeholder {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-dim);
  flex: 1;
}

/* Typing dots */
@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.3; }
  40%           { opacity: 1; }
}

.typing-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
}

.typing-dots span:nth-child(1) { animation: dot-pulse 1.4s ease-in-out 0s infinite; }
.typing-dots span:nth-child(2) { animation: dot-pulse 1.4s ease-in-out 0.2s infinite; }
.typing-dots span:nth-child(3) { animation: dot-pulse 1.4s ease-in-out 0.4s infinite; }

.starter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--neutral-300);
  border-radius: 9999px;
  padding: 0.3125rem 0.75rem;
  transition: color 200ms ease-out, border-color 200ms ease-out, box-shadow 200ms ease-out;
  white-space: nowrap;
}

.chip:hover {
  color: var(--text);
  border-color: var(--indigo);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
  text-decoration: none;
}

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

/* Hero figure */
.hero-figure {
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid transparent;
  background: var(--grad-border);
  box-shadow: 0 0 60px rgba(99, 102, 241, 0.15);
}

.hero-figure img {
  width: 100%;
  height: auto;
  border-radius: 0.6875rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: var(--radius-button);
  padding: 0.875rem 1.625rem;
  text-decoration: none;
  transition: box-shadow 200ms ease-out, border-color 200ms ease-out;
  cursor: pointer;
  border: none;
}

.btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.5);
}

.btn-primary {
  background: var(--surface-elevated);
  color: var(--text);
  border: 1.5px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: calc(var(--radius-button) + 1.5px);
  background: var(--grad-accent);
  z-index: -1;
}

.btn-primary:hover {
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.35);
  color: var(--text);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--neutral-300);
}

.btn-secondary:hover {
  border-color: var(--indigo);
  color: var(--text);
  text-decoration: none;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  border-radius: 0;
}

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

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
main {
  min-height: 60vh;
}

.content-surface {
  background: var(--surface);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.content-section {
  padding: clamp(2rem, 4vw, 3.5rem) 0;
}

/* Section accent rule above h2 */
.section-heading {
  position: relative;
  padding-top: 1.75rem;
  margin-bottom: 1.25rem;
}

.section-heading::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4rem;
  height: 2px;
  background: var(--grad-accent);
  border-radius: 1px;
}

/* Reading prose wrapper */
.prose {
  max-width: 64ch;
}

.prose h2 { margin-bottom: 0.875rem; }
.prose h3 { margin-top: 1.75rem; margin-bottom: 0.625rem; }

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

.prose ul, .prose ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.prose ul li, .prose ol li {
  margin-bottom: 0.375rem;
}

.prose ul { list-style: disc; }
.prose ul li::marker { color: var(--indigo); }

.prose ol {
  counter-reset: prose-ol;
  list-style: none;
  padding-left: 0;
}

.prose ol li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.25rem;
}

.prose ol li::before {
  counter-increment: prose-ol;
  content: counter(prose-ol, decimal-leading-zero) '.';
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--cyan);
  font-weight: 500;
  padding-top: 0.1em;
}

/* Strong text in body */
.prose strong { color: var(--text); font-weight: 600; }

/* Citation superscripts */
.cite-ref {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 1px;
  text-decoration-thickness: 1px;
  transition: color 200ms ease-out;
}

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

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface-elevated);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-card);
  padding: 1.75rem;
  transition: box-shadow 200ms ease-out;
}

.card:hover {
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.4), 0 8px 32px rgba(99, 102, 241, 0.12);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  flex-wrap: wrap;
}

.card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.35;
}

.card-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.375rem;
  display: block;
}

/* Card grid */
.card-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .card-grid-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .card-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   PROVENANCE CHIPS
   ============================================================ */
.prov-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  border-radius: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.prov-chip--trial {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #9396F7;
}

.prov-chip--rct {
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--cyan);
}

.prov-chip--preclinical {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--emerald);
}

.prov-chip--regulatory {
  background: rgba(246, 183, 60, 0.08);
  border: 1px solid rgba(246, 183, 60, 0.3);
  color: var(--warning);
}

.prov-chip--hypothesis {
  background: rgba(115, 124, 160, 0.1);
  border: 1px solid rgba(115, 124, 160, 0.2);
  color: var(--text-dim);
}

/* ============================================================
   CALLOUTS
   ============================================================ */
.callout {
  background: var(--surface-elevated);
  border: 1px solid var(--neutral-200);
  border-left: none;
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 1.125rem 1.25rem;
  margin: 1.5rem 0;
  position: relative;
  max-width: 64ch;
}

.callout::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--grad-accent);
  border-radius: 1.5px 0 0 1.5px;
}

.callout-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.callout-warning::before {
  background: linear-gradient(to bottom, var(--warning), var(--danger));
}

.callout-warning .callout-eyebrow { color: var(--warning); }

.callout-regulatory::before {
  background: linear-gradient(to bottom, var(--warning), var(--warning));
}

.callout-regulatory .callout-eyebrow { color: var(--warning); }

.callout p { max-width: none; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: var(--radius-card);
  border: 1px solid var(--neutral-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-elevated);
  font-size: 0.9375rem;
}

thead tr {
  border-top: 2px solid transparent;
  background-image: linear-gradient(var(--surface-elevated), var(--surface-elevated)),
                    var(--grad-accent);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border-bottom: 1px solid var(--neutral-200);
}

th {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--neutral-200);
  color: var(--text);
  vertical-align: top;
}

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

.td-mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--cyan);
}

/* ============================================================
   FIGURES
   ============================================================ */
.fig-plate {
  margin: 2rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid transparent;
  background: var(--grad-border);
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.1);
}

.fig-plate img {
  width: 100%;
  height: auto;
  border-radius: 0.6875rem;
  display: block;
}

.fig-caption {
  padding: 0.75rem 1rem;
  background: var(--surface-elevated);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.fig-label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--cyan);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
  margin-top: 0.1em;
}

.fig-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   FAQ LAYOUT
   ============================================================ */
.faq-section-heading {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 2.5rem 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.faq-section-heading::before {
  content: '';
  display: inline-block;
  width: 2.5rem;
  height: 2px;
  background: var(--grad-accent);
  border-radius: 1px;
  flex-shrink: 0;
}

.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-q {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.faq-a {
  color: var(--text-muted);
  max-width: 58ch;
  line-height: 1.65;
}

.faq-a p { margin-bottom: 0.5rem; max-width: none; }

/* ============================================================
   REFERENCES
   ============================================================ */
.references-list {
  list-style: none;
  padding: 0;
  counter-reset: refs;
}

.references-list li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.5rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--rule);
  counter-increment: refs;
}

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

.references-list li::before {
  content: '[' counter(refs) ']';
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--cyan);
  font-weight: 500;
  padding-top: 0.1em;
  align-self: flex-start;
}

.ref-content {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  max-width: 70ch;
}

.ref-doi {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  border-bottom: 1px solid var(--cyan);
  padding-bottom: 1px;
  display: inline-block;
  text-decoration: none;
}

.ref-doi:hover { color: var(--cyan); }

/* ============================================================
   SECTION BANDS
   ============================================================ */
.section-band {
  position: relative;
  overflow: hidden;
  padding: 1px 0;
}

.section-band-img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.5;
}

.hairline-rule {
  border: none;
  height: 1px;
  background: var(--rule);
  margin: 0;
}

.accent-hairline {
  border: none;
  height: 1px;
  background: var(--grad-accent);
  opacity: 0.14;
  margin: 0;
}

/* ============================================================
   CHART CONTAINER
   ============================================================ */
.chart-container {
  background: var(--surface-elevated);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-card);
  padding: 1.75rem;
  margin: 1.75rem 0;
  max-width: 52rem;
}

.chart-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.chart-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: none;
}

canvas { max-width: 100%; }

/* ============================================================
   CONTACT FORM
   ============================================================ */
.contact-form {
  max-width: 36rem;
  display: grid;
  gap: 1.25rem;
}

.form-group {
  display: grid;
  gap: 0.375rem;
}

.form-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.form-input,
.form-textarea {
  background: var(--surface-elevated);
  border: 1px solid var(--neutral-300);
  border-radius: 0.5rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  width: 100%;
  transition: border-color 200ms ease-out;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

.form-disclaimer {
  font-size: 0.875rem;
  color: var(--text-dim);
  max-width: none;
}

/* ============================================================
   READING PROGRESS
   ============================================================ */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--grad-accent);
  z-index: 200;
  width: 0%;
  transition: width 100ms linear;
  pointer-events: none;
}

/* ============================================================
   TIPPY.JS OVERRIDES
   ============================================================ */
.tippy-box {
  background: var(--surface-elevated) !important;
  border: 1px solid transparent !important;
  border-top: 2px solid var(--indigo) !important;
  color: var(--text) !important;
  font-family: var(--font-body) !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  max-width: 26rem !important;
  border-radius: 0.5rem !important;
  padding: 0.625rem 0.875rem !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}

.tippy-box .tippy-content {
  padding: 0 !important;
  color: var(--text-muted) !important;
}

.tippy-box[data-placement^="top"] > .tippy-arrow::before {
  border-top-color: var(--surface-elevated) !important;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg);
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(1.5rem, 3vw, 2rem);
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--grad-accent);
  opacity: 0.14;
}

.footer-disclaimer {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: none;
}

.footer-columns {
  display: grid;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .footer-columns { grid-template-columns: repeat(3, 1fr); }
}

.footer-col-heading {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: 0.875rem;
  letter-spacing: -0.01em;
}

.footer-links {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 200ms ease-out;
}

.footer-links a:hover { color: var(--text); }

.footer-colophon {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-colophon-mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-copyright {
  font-size: 0.875rem;
  color: var(--text-dim);
  max-width: none;
}

/* ============================================================
   404 PAGE
   ============================================================ */
.page-404 {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: 4rem var(--container-px);
}

.page-404 h1 {
  font-family: var(--font-mono);
  font-size: clamp(5rem, 15vw, 9rem);
  color: var(--primary-50);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  list-style: none;
  padding: 0;
}

.breadcrumb li + li::before {
  content: '/';
  color: var(--text-dim);
  margin-right: 0.25rem;
  opacity: 0.5;
}

.breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 200ms ease-out;
}

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

/* ============================================================
   PAGE HERO (inner pages)
   ============================================================ */
.page-hero {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}

.page-hero h1 { margin-bottom: 0.75rem; }

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

/* ============================================================
   LAYOUT — SIDEBAR RAIL (desktop)
   ============================================================ */
.content-with-rail {
  display: grid;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .content-with-rail {
    grid-template-columns: 1fr 16rem;
    align-items: start;
  }
}

.sidebar-rail {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar-rail {
    display: block;
    position: sticky;
    top: 5rem;
  }
}

.rail-heading {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.875rem;
}

.rail-links {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.rail-links a {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-dim);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 200ms ease-out;
}

.rail-links a::before {
  content: '';
  display: inline-block;
  width: 1.25rem;
  height: 1px;
  background: var(--neutral-400);
  flex-shrink: 0;
  transition: background 200ms ease-out;
}

.rail-links a:hover {
  color: var(--text-muted);
}

.rail-links a:hover::before { background: var(--indigo); }

/* ============================================================
   UTILITY
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Intro paragraph on pages */
.intro-para {
  color: var(--text-muted);
  max-width: 64ch;
  margin-bottom: 2.5rem;
  font-size: 1.0625rem;
}

/* Narrow prose container for FAQ / About / Contact */
.prose-narrow {
  max-width: 58ch;
}
