/**
 * Combined Course - Base Stylesheet
 * Design: "Convergence" — Where Biology Meets Public Health
 * Split-discipline aesthetic: Clinical Medical + Modern Editorial
 * UniSQ Bachelor of Paramedicine, Trimester 1 2026
 */

/* ============================================
   FONTS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300..800&family=DM+Sans:opsz,wght@9..40,300..700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

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

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

body {
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  /* --- Swiss Medical / Modern Editorial --- */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-surface: #ffffff;
  --bg-hover: #e2e8f0;
  --bg-overlay: rgba(248, 250, 252, 0.92);

  /* Text — Ink dark */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-tertiary: #64748b;
  --text-inverse: #ffffff;

  /* --- Bioscience Colors — Clinical Blue/Teal --- */
  --bio-primary: #2563eb;
  --bio-secondary: #1d4ed8;
  --bio-dim: rgba(37, 99, 235, 0.08);
  --bio-glow: rgba(37, 99, 235, 0.15);
  --bio-accent: #60a5fa;
  --bio-warm: #3b82f6;
  --bio-terracotta: #0ea5e9;

  /* --- Public Health Colors — Coral/Orange --- */
  --ph-primary: #ea580c;
  --ph-secondary: #c2410c;
  --ph-dim: rgba(234, 88, 12, 0.08);
  --ph-glow: rgba(234, 88, 12, 0.15);
  --ph-accent: #f97316;
  --ph-clinical: #fb923c;
  --ph-critical: #dc2626;

  /* --- Convergence — Deep Violet / Indigo --- */
  --convergence: #7c3aed;
  --convergence-dim: rgba(124, 58, 237, 0.08);
  --convergence-glow: rgba(124, 58, 237, 0.15);

  /* Semantic */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);

  /* Borders & Shadows */
  --border-color: rgba(15, 23, 42, 0.1);
  --border-color-strong: rgba(15, 23, 42, 0.2);
  --border-bio: rgba(37, 99, 235, 0.2);
  --border-ph: rgba(234, 88, 12, 0.2);
  --border-convergence: rgba(124, 58, 237, 0.2);
  --border-subtle: rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12);

  /* Typography */
  --font-heading: 'Bricolage Grotesque', sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
  --line-height: 1.6;
  --line-height-tight: 1.25;
  --line-height-heading: 1.05;

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

  /* Radius (Brutalist / Sharp) */
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-xl: 0px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms cubic-bezier(0.25, 1, 0.5, 1);
  --transition-slow: 600ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-max: 1200px;
  --header-height: 64px;
  --sidebar-width: 280px;

  /* Previously undefined but referenced */
  --surface-dim: #f1f5f9;
  --surface-card: #ffffff;
  --convergence-border: rgba(124, 58, 237, 0.2);
}

/* ============================================
   BASE STYLES
   ============================================ */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
}

/* Convergence gradient edge — the signature element */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(
    180deg,
    var(--bio-primary) 0%,
    var(--bio-secondary) 20%,
    var(--convergence) 50%,
    var(--ph-secondary) 80%,
    var(--ph-primary) 100%
  );
  background-size: 100% 200%;
  z-index: 200;
  animation: gradientEdgeFlow 12s ease-in-out infinite alternate;
}

/* Warm ambient glow — subtle, not distracting */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 8% 15%, rgba(52, 211, 153, 0.04) 0%, transparent 45%),
    radial-gradient(ellipse at 92% 85%, rgba(240, 134, 74, 0.03) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(177, 148, 246, 0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

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

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--line-height-heading);
  font-weight: 400;
  color: var(--text-primary);
  font-variation-settings: 'opsz' 32;
}

h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  letter-spacing: -0.025em;
  font-variation-settings: 'opsz' 72;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.015em;
  font-variation-settings: 'opsz' 48;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-variation-settings: 'opsz' 36;
}

h4 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-variation-settings: 'opsz' 24;
}

h5 {
  font-size: 1.05rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.01em;
}

h6 {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

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

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

em {
  font-style: italic;
}

small {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

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

/* ============================================
   LINKS
   ============================================ */
a {
  transition: color var(--transition-fast);
}

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

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

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

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

@media (min-width: 1024px) {
  .container--narrow {
    max-width: 920px;
  }
}

@media (min-width: 1400px) {
  .container--narrow {
    max-width: 1040px;
  }
}

.container--wide {
  max-width: 1400px;
}

/* Tighten container padding on mobile */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }
}

main {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--header-height));
  padding-top: var(--space-xl);
  padding-bottom: var(--space-3xl);
}

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

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(19, 17, 14, 0.88);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-variation-settings: 'opsz' 24;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.site-header__logo-icon {
  display: flex;
  align-items: center;
  gap: 2px;
}

.site-header__logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.site-header__logo-dot--bio {
  background: var(--bio-primary);
  box-shadow: 0 0 8px var(--bio-glow);
}

.site-header__logo-dot--ph {
  background: var(--ph-primary);
  box-shadow: 0 0 8px var(--ph-glow);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.site-nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  text-decoration: none;
}

.site-nav__link:hover {
  color: var(--text-primary);
  background: rgba(239, 230, 213, 0.04);
}

.site-nav__link--active {
  color: var(--convergence);
  background: var(--convergence-dim);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-xs);
  cursor: pointer;
}

.nav-toggle__bar {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all var(--transition-fast);
}

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

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: var(--space-md);
    gap: var(--space-xs);
  }

  .site-nav--open {
    display: flex;
  }

  .site-nav__link {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
  }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.6rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--convergence);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--convergence);
  color: var(--text-inverse);
  border-color: var(--convergence);
}

.btn--primary:hover {
  background: #b49dfc;
  border-color: #b49dfc;
  box-shadow: 0 0 20px var(--convergence-glow);
}

.btn--bio {
  background: var(--bio-primary);
  color: var(--text-inverse);
  border-color: var(--bio-primary);
}

.btn--bio:hover {
  background: var(--bio-accent);
  box-shadow: 0 0 20px var(--bio-glow);
}

.btn--ph {
  background: var(--ph-primary);
  color: white;
  border-color: var(--ph-primary);
}

.btn--ph:hover {
  background: var(--ph-accent);
  box-shadow: 0 0 20px var(--ph-glow);
}

.btn--outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color-strong);
}

.btn--outline:hover {
  background: var(--bg-elevated);
  border-color: var(--text-tertiary);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
}

.btn--ghost:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn--sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn--lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

.btn--block {
  width: 100%;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-color-strong);
  box-shadow: var(--shadow-md);
}

.card--bio {
  border-left: 3px solid var(--bio-primary);
}

.card--bio:hover {
  border-color: var(--border-bio);
  border-left-color: var(--bio-primary);
  background: linear-gradient(135deg, var(--bio-dim) 0%, var(--bg-secondary) 40%);
}

.card--ph {
  border-left: 3px solid var(--ph-primary);
}

.card--ph:hover {
  border-color: var(--border-ph);
  border-left-color: var(--ph-primary);
  background: linear-gradient(135deg, var(--ph-dim) 0%, var(--bg-secondary) 40%);
}

.card--convergence {
  border-left: 3px solid var(--convergence);
}

.card--convergence:hover {
  border-color: var(--border-convergence);
  border-left-color: var(--convergence);
  background: linear-gradient(135deg, var(--convergence-dim) 0%, var(--bg-secondary) 40%);
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.card__title {
  font-size: 1.1rem;
  font-family: var(--font-heading);
}

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

.card__footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ============================================
   SUBJECT BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge--bio {
  background: var(--bio-dim);
  color: var(--bio-primary);
  border: 1px solid var(--border-bio);
}

.badge--ph {
  background: var(--ph-dim);
  color: var(--ph-primary);
  border: 1px solid var(--border-ph);
}

.badge--convergence {
  background: var(--convergence-dim);
  color: var(--convergence);
  border: 1px solid var(--border-convergence);
}

.badge--difficulty-easy {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.badge--difficulty-medium {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.badge--difficulty-hard {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

/* ============================================
   VIEW MODE TOGGLE
   ============================================ */
.view-toggle {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.view-toggle__btn {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.view-toggle__btn--active {
  background: var(--convergence);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   DUAL-SUBJECT SPLIT LAYOUT
   ============================================ */
.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.split-section__panel {
  position: relative;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.split-section__panel--bio {
  border-top: 3px solid var(--bio-primary);
}

.split-section__panel--ph {
  border-top: 3px solid var(--ph-primary);
}

.split-section__divider {
  display: none;
  /* On mobile, this becomes visible as a horizontal separator */
}

@media (max-width: 768px) {
  .split-section {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-xl) var(--space-xl);
  margin-bottom: var(--space-lg);
  position: relative;
}

.content-block__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.content-block__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.content-block__icon--bio {
  background: var(--bio-dim);
  color: var(--bio-primary);
  border: 1px solid var(--border-bio);
}

.content-block__icon--ph {
  background: var(--ph-dim);
  color: var(--ph-primary);
  border: 1px solid var(--border-ph);
}

.content-block__icon--convergence {
  background: var(--convergence-dim);
  color: var(--convergence);
  border: 1px solid var(--border-convergence);
}

/* Simplified / Complex toggle for content */
.complexity-toggle {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2px;
  margin-bottom: var(--space-md);
}

.complexity-toggle__btn {
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.complexity-toggle__btn--active {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.content-simplified,
.content-complex {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.content-simplified p,
.content-complex p {
  margin-bottom: var(--space-lg);
  text-indent: 1.5em;
}

.content-simplified p:first-child,
.content-complex p:first-child {
  text-indent: 0;
}

.content-simplified p:first-child::first-letter,
.content-complex p:first-child::first-letter {
  font-family: var(--font-heading);
  font-size: 2.4em;
  float: left;
  line-height: 0.85;
  padding-right: 0.08em;
  margin-top: 0.05em;
  color: var(--text-primary);
  font-variation-settings: 'opsz' 72;
}

[data-complexity="complex"] .content-simplified,
[data-complexity="simplified"] .content-complex {
  display: none;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress__fill--bio {
  background: linear-gradient(90deg, var(--bio-secondary), var(--bio-primary));
}

.progress__fill--ph {
  background: linear-gradient(90deg, var(--ph-primary), var(--ph-accent));
}

.progress__fill--convergence {
  background: linear-gradient(90deg, var(--bio-primary), var(--convergence), var(--ph-primary));
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--convergence);
  box-shadow: 0 0 0 3px var(--convergence-dim);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

/* ============================================
   QUIZ / TEST STYLES
   ============================================ */
.quiz-question {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.quiz-question__number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}

.quiz-question__text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-xs);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.quiz-option:hover {
  background: var(--bg-elevated);
  border-color: var(--border-color-strong);
  color: var(--text-primary);
}

.quiz-option--selected {
  background: var(--convergence-dim);
  border-color: var(--convergence);
  color: var(--text-primary);
}

.quiz-option--correct {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.quiz-option--incorrect {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
}

.quiz-explanation {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--convergence);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================
   FLASHCARDS
   ============================================ */
.flashcard {
  perspective: 1000px;
  cursor: pointer;
  min-height: 250px;
}

.flashcard__inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 250px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
}

.flashcard--flipped .flashcard__inner {
  transform: rotateY(180deg);
}

.flashcard__front,
.flashcard__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  text-align: center;
}

.flashcard__front {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.flashcard__back {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color-strong);
  transform: rotateY(180deg);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================
   GLOSSARY
   ============================================ */
.glossary-term {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.glossary-term:hover {
  background: var(--bg-elevated);
}

.glossary-term__word {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

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

.glossary-term__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

/* ============================================
   WEEK NAVIGATION
   ============================================ */
.week-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
}

.week-nav__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-base);
}

.week-nav__item:hover {
  border-color: var(--border-color-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.week-nav__number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.week-nav__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-primary);
}

.week-nav__subjects {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

/* ============================================
   CONCEPT EXPLORER
   ============================================ */
.concept-explorer {
  margin-top: var(--space-xl);
  padding: var(--space-xl);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(239, 230, 213, 0.015), transparent 150px),
    var(--bg-elevated);
}

.concept-explorer--bio {
  border-color: var(--border-bio);
  box-shadow: inset 0 1px 0 rgba(52, 211, 153, 0.06);
}

.concept-explorer--ph {
  border-color: var(--border-ph);
  box-shadow: inset 0 1px 0 rgba(240, 134, 74, 0.06);
}

.concept-explorer--convergence {
  border-color: var(--border-convergence);
  box-shadow: inset 0 1px 0 rgba(177, 148, 246, 0.06);
}

.concept-explorer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.concept-explorer__title {
  font-size: 1.2rem;
  margin-bottom: var(--space-xs);
}

.concept-explorer__subtitle {
  max-width: 56rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  opacity: 0.65;
  line-height: 1.6;
}

.concept-explorer__count {
  flex-shrink: 0;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.concept-explorer__toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.concept-explorer__search {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.concept-explorer__search:focus {
  outline: none;
  border-color: var(--convergence);
  box-shadow: 0 0 0 3px var(--convergence-dim);
}

.concept-explorer__hint {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.concept-explorer__list {
  display: grid;
  gap: var(--space-md);
}

.concept-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.concept-card[open] {
  box-shadow: var(--shadow-md);
}

.concept-card--bio {
  border-color: var(--border-bio);
}

.concept-card--ph {
  border-color: var(--border-ph);
}

.concept-card--convergence {
  border-color: var(--border-convergence);
}

.concept-card__summary {
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg);
  cursor: pointer;
}

.concept-card__summary::-webkit-details-marker {
  display: none;
}

.concept-card__summary-text {
  min-width: 0;
}

.concept-card__title {
  margin-top: var(--space-xs);
  margin-bottom: var(--space-xs);
  font-size: 1.2rem;
}

.concept-card__quick {
  font-size: 0.95rem;
  color: var(--text-primary);
  opacity: 0.78;
  margin-bottom: 0;
  line-height: 1.6;
}

.concept-card__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.concept-card[open] .concept-card__toggle {
  transform: rotate(45deg);
}

.concept-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

@media (min-width: 900px) {
  .concept-card__body {
    padding: var(--space-xl);
  }
}

@media (min-width: 1200px) {
  .concept-card__body {
    padding: var(--space-xl) var(--space-2xl);
  }
}

.concept-card__content {
  min-width: 0;
}

.concept-card__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

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

.concept-facet {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
}

.concept-facet__title {
  margin-bottom: var(--space-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
  opacity: 0.55;
}

.concept-facet__text {
  margin-bottom: 0;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-primary);
  opacity: 0.88;
}

.concept-card__connections {
  margin-top: var(--space-md);
}

.concept-card__connections-title {
  margin-bottom: var(--space-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
  opacity: 0.55;
}

.concept-card__chips,
.term-quicklook__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.concept-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-color-strong);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.concept-chip:hover,
.concept-chip:focus-visible {
  background: var(--convergence-dim);
  border-color: var(--convergence);
  color: var(--text-primary);
  outline: none;
}

.concept-visual {
  align-self: start;
  max-width: 400px;
}

.concept-visual__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.concept-visual__caption {
  margin-top: var(--space-sm);
  margin-bottom: 0;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.concept-bridge {
  margin-top: var(--space-xl);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--convergence-dim), rgba(177, 148, 246, 0.02));
  border: 1px solid var(--border-convergence);
  border-left: 3px solid var(--convergence);
}

.concept-bridge__title {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}

.concept-bridge__text {
  margin-bottom: 0;
  color: var(--text-primary);
  opacity: 0.85;
  line-height: 1.7;
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.glossary-term--interactive {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  cursor: pointer;
}

.glossary-term--interactive:hover,
.glossary-term--interactive:focus-visible {
  border-color: var(--border-color-strong);
  background: var(--bg-surface);
  outline: none;
}

/* ============================================
   QUICKLOOK MODAL
   ============================================ */
.term-quicklook {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: rgba(5, 10, 20, 0.78);
}

.term-quicklook--active {
  display: flex;
}

.term-quicklook__dialog {
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  position: relative;
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  border: 1px solid var(--border-convergence);
  box-shadow: var(--shadow-xl);
}

.term-quicklook__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.25rem;
}

.term-quicklook__header {
  padding-right: 3rem;
  margin-bottom: var(--space-lg);
}

.term-quicklook__eyebrow {
  margin-bottom: var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--convergence);
}

.term-quicklook__title {
  margin-bottom: var(--space-xs);
}

.term-quicklook__pronunciation {
  font-size: 0.9rem;
  color: var(--text-tertiary);
}

.term-quicklook__body {
  display: grid;
  gap: var(--space-md);
}

.term-quicklook__section {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
}

.term-quicklook__section-title {
  margin-bottom: var(--space-xs);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.term-quicklook__text {
  margin-bottom: 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

@media (max-width: 900px) {
  .concept-visual {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .concept-explorer,
  .term-quicklook__dialog {
    padding: var(--space-lg);
  }

  .concept-explorer__header,
  .concept-card__summary {
    flex-direction: column;
  }

  .concept-card__grid {
    grid-template-columns: 1fr;
  }

  .concept-card__body {
    padding: var(--space-md);
  }

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

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  position: relative;
  z-index: 1;
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.site-footer__text {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
}

.site-footer__links {
  display: flex;
  gap: var(--space-md);
}

.site-footer__link {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

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

.text-bio { color: var(--bio-primary); }
.text-ph { color: var(--ph-primary); }
.text-convergence { color: var(--convergence); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-tertiary); }

.bg-bio { background: var(--bio-dim); }
.bg-ph { background: var(--ph-dim); }
.bg-convergence { background: var(--convergence-dim); }

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

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none !important; }

/* Animation utilities */
.fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

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

.stagger-1 { animation-delay: 0.06s; }
.stagger-2 { animation-delay: 0.12s; }
.stagger-3 { animation-delay: 0.18s; }
.stagger-4 { animation-delay: 0.24s; }
.stagger-5 { animation-delay: 0.30s; }
.stagger-6 { animation-delay: 0.36s; }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-surface);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-surface) var(--bg-primary);
}

/* ============================================
   RESPONSIVE — MOBILE-FIRST REFINEMENTS
   ============================================ */

/* --- Small mobile (≤480px) --- */
@media (max-width: 480px) {
  /* Reduce main padding */
  main {
    padding-top: var(--space-md);
    padding-bottom: var(--space-xl);
  }

  /* Content blocks: tighter padding */
  .content-block {
    padding: var(--space-lg) var(--space-md);
    border-radius: var(--radius-md);
  }

  .content-block__header {
    margin-bottom: var(--space-lg);
  }

  /* Concept explorer: tighter padding */
  .concept-explorer {
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }

  .concept-explorer__header {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .concept-explorer__title {
    font-size: 1.05rem;
  }

  /* Concept cards: tighter summary padding */
  .concept-card__summary {
    padding: var(--space-md);
  }

  .concept-card__body {
    padding: var(--space-sm) var(--space-md) var(--space-md);
  }

  .concept-card__title {
    font-size: 1.1rem;
  }

  .concept-card__quick {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .concept-facet {
    padding: var(--space-md);
  }

  .concept-facet__text {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  /* Quiz questions: tighter */
  .quiz-question {
    padding: var(--space-md);
  }

  /* Drop cap smaller on mobile */
  .content-simplified p:first-child::first-letter,
  .content-complex p:first-child::first-letter {
    font-size: 2em;
  }

  /* Diagram section tighter */
  .diagrams-section {
    padding: var(--space-md);
  }

  .diagram-card {
    padding: var(--space-md);
  }

  /* Convergence bridge tighter */
  .concept-bridge {
    padding: var(--space-md);
  }

  /* Terms grid single column */
  .terms-grid {
    grid-template-columns: 1fr;
  }

  /* Footer stacking */
  .site-footer .container {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }

  .site-footer__links {
    justify-content: center;
  }
}

/* --- General mobile (≤768px) --- */
@media (max-width: 768px) {
  /* Reduce main top padding */
  main {
    padding-top: var(--space-lg);
  }

  /* Content blocks */
  .content-block {
    padding: var(--space-lg);
  }

  /* Concept explorer */
  .concept-explorer {
    padding: var(--space-lg);
  }

  /* Quicklook modal */
  .term-quicklook {
    padding: var(--space-md);
  }

  .term-quicklook__dialog {
    padding: var(--space-lg);
  }

  /* Footer stacking */
  .site-footer .container {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }

  .site-footer__links {
    justify-content: center;
  }
}

/* (concept card 2-col grid now handled at base level via min-width: 640px) */

/* ============================================
   PRINT
   ============================================ */
@media print {
  body::before,
  body::after,
  .site-header,
  .site-footer,
  .nav-toggle,
  .view-toggle,
  .complexity-toggle,
  .btn {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .card,
  .content-block,
  .quiz-question {
    border: 1px solid #ccc;
    background: white;
    break-inside: avoid;
  }
}


/* ============================================
   Convergence PDF Links
   ============================================ */
.convergence-pdfs {
  margin-top: var(--space-xl, 2rem);
  padding-top: var(--space-lg, 1.5rem);
  border-top: 1px solid var(--border-color, #2a2a2a);
}

.convergence-pdfs__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--convergence, #b194f6);
  margin-bottom: var(--space-xs, 0.25rem);
}

.convergence-pdfs__subtitle {
  font-size: 0.8rem;
  color: var(--text-tertiary, #888);
  margin-bottom: var(--space-lg, 1.5rem);
}

.convergence-pdfs__group {
  margin-bottom: var(--space-lg, 1.5rem);
}

.convergence-pdfs__group-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm, 0.5rem);
}

.convergence-pdfs__group-title--bio {
  color: var(--bio-primary, #4ade80);
}

.convergence-pdfs__group-title--ph {
  color: var(--ph-primary, #f97316);
}

.convergence-pdfs__list {
  display: grid;
  gap: 0.5rem;
}

.convergence-pdf-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 0.5rem);
  padding: 0.75rem 1rem;
  background: var(--bg-elevated, #1a1a1a);
  border: 1px solid var(--border-color, #2a2a2a);
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  color: var(--text-secondary, #ccc);
  transition: all 0.2s ease;
}

.convergence-pdf-link:hover {
  border-color: var(--convergence, #b194f6);
  background: var(--convergence-dim, #2a2241);
  transform: translateX(4px);
}

.convergence-pdf-link--bio:hover {
  border-color: var(--bio-primary, #4ade80);
  background: var(--bio-dim, #1a3426);
}

.convergence-pdf-link--ph:hover {
  border-color: var(--ph-primary, #f97316);
  background: var(--ph-dim, #3a2618);
}

.convergence-pdf-link__icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.convergence-pdf-link__title {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
}

.convergence-pdf-link__action {
  font-size: 0.75rem;
  color: var(--text-tertiary, #888);
  flex-shrink: 0;
}

/* ── Convergence Diagrams ── */

.diagrams-section {
  margin-top: var(--space-xl);
  padding: var(--space-xl);
  background: var(--surface-dim);
  border-radius: var(--radius-lg);
  border: 1px solid var(--convergence-border);
}

.diagrams-section__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.diagrams-section__title {
  font-size: 1.15rem;
  margin: 0;
  color: var(--text-primary);
  font-variation-settings: 'opsz' 28;
}

.diagrams-section__subtitle {
  font-size: 0.8rem;
  margin: 0;
  color: var(--text-tertiary);
}

.diagrams-section__grid {
  display: grid;
  gap: var(--space-lg);
}

.diagram-card {
  padding: var(--space-lg);
  background: var(--surface-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.diagram-card__title {
  font-size: 1rem;
  margin: 0 0 var(--space-sm);
  color: var(--convergence);
  font-variation-settings: 'opsz' 24;
}

.diagram-card__desc {
  font-size: 0.85rem;
  margin: 0 0 var(--space-md);
  color: var(--text-secondary);
  line-height: 1.6;
}

.diagram-card__render {
  overflow-x: auto;
  padding: var(--space-md);
  background: var(--surface-dim);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  position: relative;
  z-index: 0;
}

.diagram-card__render pre.mermaid {
  margin: 0;
  font-size: 0.85rem;
}

.diagram-card__render svg {
  height: auto;
  min-width: min(600px, 100%);
  max-width: none;
  width: auto;
}

.diagram-card__render svg foreignObject {
  overflow: visible;
}

.diagram-card__render svg foreignObject div {
  overflow: visible !important;
}

/* ── Structured Explanation Elements ── */

.explanation-heading {
  font-size: 1.15rem;
  margin: var(--space-xl) 0 var(--space-sm);
  color: var(--text-primary);
  font-variation-settings: 'opsz' 28;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-xs);
}

.explanation-heading:first-child {
  margin-top: 0;
}

.explanation-subheading {
  font-size: 0.95rem;
  margin: var(--space-lg) 0 var(--space-xs);
  color: var(--text-secondary);
  font-variation-settings: 'opsz' 24;
}

.explanation-callout {
  margin: var(--space-md) 0;
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--convergence);
  background: var(--convergence-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.65;
}

.explanation-tip {
  display: flex;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: var(--bio-dim);
  border: 1px solid var(--border-bio);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.explanation-tip__icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.65;
}

.explanation-warning {
  display: flex;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: var(--ph-dim);
  border: 1px solid var(--border-ph);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.explanation-warning__icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.65;
}

.explanation-checkpoint {
  display: flex;
  gap: var(--space-sm);
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  background: var(--convergence-dim);
  border: 1px dashed var(--convergence);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.explanation-checkpoint__icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.65;
}

.explanation-list {
  margin: var(--space-sm) 0;
  padding-left: var(--space-lg);
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

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

.explanation-list li::marker {
  color: var(--convergence);
}

/* Subject-scoped callout border colours */
.card--bio .explanation-callout {
  border-left-color: var(--bio-primary);
  background: var(--bio-dim);
}

.card--ph .explanation-callout {
  border-left-color: var(--ph-primary);
  background: var(--ph-dim);
}

.card--bio .explanation-list li::marker {
  color: var(--bio-primary);
}

.card--ph .explanation-list li::marker {
  color: var(--ph-primary);
}

.card--bio .explanation-checkpoint {
  border-color: var(--bio-primary);
  background: var(--bio-dim);
}

.card--ph .explanation-checkpoint {
  border-color: var(--ph-primary);
  background: var(--ph-dim);
}
@import url("convergence_overrides.css");
