/* ============================================================
   跃动生命：人体循环系统沉浸式探究平台
   Human Circulatory System Interactive Exploration — Stylesheet
   Premium Dark Medical Theme
   ============================================================ */

/* ----------------------------------------------------------
   0. IMPORTS & FONTS
   ---------------------------------------------------------- */
/* ----------------------------------------------------------
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ---------------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-elevated: #1e293b;

  /* Typography */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Accent — Arterial / Venous / Organ */
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.3);
  --accent-red-deep: #dc2626;
  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.3);
  --accent-blue-deep: #2563eb;
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.3);
  --accent-pink: #ec4899;
  --accent-pink-glow: rgba(236, 72, 153, 0.3);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.3);
  --accent-yellow: #f59e0b;
  --accent-yellow-glow: rgba(245, 158, 11, 0.3);

  /* Medical diagram palette */
  --medical-artery: #ef4444;
  --medical-vein: #0ea5e9;
  --medical-capillary: #a78bfa;
  --medical-panel: #e8f7ff;
  --medical-panel-edge: #7dd3fc;

  /* Gradients */
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-hero: linear-gradient(135deg, #0a0e1a 0%, #1a1040 50%, #0a0e1a 100%);
  --gradient-nav: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-hover: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --glass-shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.4);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index layers */
  --z-base: 1;
  --z-nav: 100;
  --z-overlay: 500;
  --z-modal: 1000;
  --z-loading: 9999;
}

/* ----------------------------------------------------------
   2. RESET & BASE
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Animated background gradient */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(239, 68, 68, 0.04) 0%, transparent 50%);
  animation: gradientShift 20s ease infinite;
  pointer-events: none;
  z-index: 0;
}

/* Selection */
::selection {
  background: rgba(139, 92, 246, 0.4);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.5);
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ----------------------------------------------------------
   3. UTILITY CLASSES
   ---------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-gradient {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-warm {
  background: var(--gradient-2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ----------------------------------------------------------
   4. GLASS CARD COMPONENT
   ---------------------------------------------------------- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition:
    background var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-spring);
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-4px);
}

/* ----------------------------------------------------------
   5. KEYFRAME ANIMATIONS
   ---------------------------------------------------------- */

/* Heartbeat — realistic double-pulse */
@keyframes heartbeat {
  0%   { transform: scale(1);    filter: drop-shadow(0 0 8px var(--accent-red-glow)); }
  14%  { transform: scale(1.06); filter: drop-shadow(0 0 20px var(--accent-red-glow)); }
  28%  { transform: scale(1);    filter: drop-shadow(0 0 8px var(--accent-red-glow)); }
  42%  { transform: scale(1.03); filter: drop-shadow(0 0 14px var(--accent-red-glow)); }
  56%  { transform: scale(1);    filter: drop-shadow(0 0 8px var(--accent-red-glow)); }
  100% { transform: scale(1);    filter: drop-shadow(0 0 8px var(--accent-red-glow)); }
}

/* Pulsing glow ring */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px var(--accent-red-glow), 0 0 30px rgba(239, 68, 68, 0.1); }
  50%      { box-shadow: 0 0 30px var(--accent-red-glow), 0 0 60px rgba(239, 68, 68, 0.2); }
}

/* Gentle floating */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Fade out */
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Slide from right */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Slide from bottom */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Slide from left */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Blood flow dash animation */
@keyframes bloodFlow {
  to { stroke-dashoffset: -100; }
}

/* Blood flow reverse */
@keyframes bloodFlowReverse {
  to { stroke-dashoffset: 100; }
}

/* Test tube fill from bottom */
@keyframes fillUp {
  from { height: 0%; }
  to   { height: var(--fill-height, 100%); }
}

/* Background gradient shift */
@keyframes gradientShift {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

/* Particle floating */
@keyframes particle-float {
  0%   { transform: translate(0, 0) scale(1);   opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { transform: translate(var(--dx, 80px), var(--dy, -200px)) scale(0.3); opacity: 0; }
}

/* Rotate subtle */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Scale in */
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* Progress bar fill */
@keyframes progressFill {
  from { width: 0%; }
}

/* Celebration confetti bounce */
@keyframes celebrate {
  0%   { transform: scale(0.5) rotate(-5deg); opacity: 0; }
  50%  { transform: scale(1.15) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Dash march for circulation arrows */
@keyframes dashMarch {
  to { stroke-dashoffset: -20; }
}

/* ----------------------------------------------------------
   6. LOADING SCREEN (#loading-screen)
   ---------------------------------------------------------- */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-loading);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#loading-screen .heart-icon {
  font-size: 64px;
  animation: heartbeat 1.2s ease-in-out infinite;
  margin-bottom: var(--space-lg);
  filter: drop-shadow(0 0 20px var(--accent-red-glow));
}

#loading-screen .loading-text {
  max-width: min(760px, calc(100vw - 48px));
  font-size: clamp(18px, 2.6vw, 25px);
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 0;
  line-height: 1.35;
  text-align: center;
}

#loading-screen .loading-bar {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  margin-top: var(--space-md);
  overflow: hidden;
  position: relative;
}

#loading-screen .loading-bar::after {
  content: '';
  position: absolute;
  height: 100%;
  width: 40%;
  background: var(--gradient-2);
  border-radius: var(--radius-pill);
  animation: loadingSlide 1.4s ease-in-out infinite;
}

@keyframes loadingSlide {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* ----------------------------------------------------------
   7. WELCOME SCREEN (#welcome-screen)
   ---------------------------------------------------------- */
#welcome-screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  overflow: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#welcome-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Animated background particles */
#welcome-screen .particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

#welcome-screen .particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-purple);
  opacity: 0;
  animation: particle-float var(--duration, 8s) var(--delay, 0s) infinite;
}

#welcome-screen .welcome-content {
  text-align: center;
  z-index: 2;
  animation: fadeIn 1s ease 0.3s both;
  max-width: 700px;
  padding: var(--space-xl);
}

#welcome-screen .welcome-icon {
  font-size: 80px;
  margin-bottom: var(--space-lg);
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 30px var(--accent-red-glow));
}

#welcome-screen .welcome-title {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, #e2e8f0, #a78bfa, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

#welcome-screen .welcome-title .title-emphasis,
#welcome-screen .welcome-title .title-main {
  display: block;
}

#welcome-screen .welcome-title .title-emphasis {
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.08;
}

#welcome-screen .welcome-title .title-main {
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.18;
  margin-top: 6px;
}

#welcome-screen .welcome-subtitle {
  font-size: clamp(14px, 2vw, 18px);
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  line-height: 1.8;
}

#welcome-screen .welcome-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 40px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-nav);
  border-radius: var(--radius-pill);
  box-shadow:
    0 4px 20px rgba(99, 102, 241, 0.4),
    0 0 40px rgba(99, 102, 241, 0.15);
  transition:
    transform var(--transition-spring),
    box-shadow var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

#welcome-screen .welcome-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

#welcome-screen .welcome-btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow:
    0 8px 30px rgba(99, 102, 241, 0.5),
    0 0 60px rgba(99, 102, 241, 0.2);
}

#welcome-screen .welcome-btn:hover::before {
  opacity: 1;
}

#welcome-screen .welcome-btn:active {
  transform: scale(0.98);
}

/* ----------------------------------------------------------
   8. NAVIGATION BAR (#nav-bar)
   ---------------------------------------------------------- */
#nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding: var(--space-sm) var(--space-lg);
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  overflow-x: visible;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  transition: transform var(--transition-base);
}

#nav-bar::-webkit-scrollbar {
  display: none;
}

#nav-bar .nav-brand {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  margin-right: var(--space-md);
  background: var(--gradient-2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

#nav-bar .brand-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(94, 234, 212, 0.12);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.24);
  flex-shrink: 0;
}

#nav-bar .brand-copy {
  display: inline;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
  white-space: nowrap;
}

#nav-bar .nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition:
    color 0.25s ease,
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

#nav-bar .nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,0.08) 40%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.08) 60%, transparent 80%);
  background-size: 250% 100%;
  background-position: 100% 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
}

#nav-bar .nav-btn:hover::before {
  opacity: 1;
  animation: nav-btn-shimmer 1.5s ease infinite;
}

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

#nav-bar .nav-btn .nav-icon {
  font-size: 18px;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#nav-bar .nav-btn:hover .nav-icon {
  transform: scale(1.2) rotate(-5deg);
}

#nav-bar .nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(125, 211, 252, 0.28);
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 8px 20px rgba(14, 165, 233, 0.15),
    0 0 12px rgba(139, 92, 246, 0.1);
}

#nav-bar .nav-btn:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.1s;
}

#nav-bar .nav-btn.active {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.96), rgba(139, 92, 246, 0.88) 54%, rgba(244, 63, 94, 0.9));
  border-color: transparent;
  box-shadow:
    0 4px 18px rgba(99, 102, 241, 0.45),
    0 0 24px rgba(99, 102, 241, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-weight: 600;
  animation: nav-active-glow 2.5s ease-in-out infinite;
}

#nav-bar .nav-btn.active::before {
  opacity: 1;
  animation: nav-btn-shimmer 3s ease infinite;
}

@keyframes nav-active-glow {
  0%, 100% {
    box-shadow:
      0 4px 18px rgba(99, 102, 241, 0.45),
      0 0 24px rgba(99, 102, 241, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow:
      0 6px 28px rgba(99, 102, 241, 0.6),
      0 0 36px rgba(244, 63, 94, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}

/* ----------------------------------------------------------
   9. MAIN CONTENT AREA (#content-area)
   ---------------------------------------------------------- */
#content-area {
  padding-top: 70px; /* offset for fixed nav */
  min-height: 100vh;
  position: relative;
  z-index: var(--z-base);
}

/* Section base */
.section {
  display: none;
  padding: var(--space-2xl) var(--space-xl);
  max-width: 1400px;
  margin: 0 auto;
  animation: fadeIn 0.5s ease both;
}

.section.active {
  display: block;
}

/* Section titles */
.section-title {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  text-align: center;
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, var(--text-primary), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: var(--space-2xl);
}

/* ----------------------------------------------------------
   10. OVERVIEW SECTION (#section-overview)
   ---------------------------------------------------------- */
#section-overview .overview-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 1100px) {
  #section-overview .overview-layout {
    grid-template-columns: 1fr;
  }

  #section-overview .body-svg-container {
    min-height: 680px;
  }

  #section-overview .circulation-stage {
    width: min(100%, 620px);
    aspect-ratio: 1148 / 1068;
    height: auto;
    min-height: 0;
  }
}

#section-overview .body-svg-container {
  position: relative;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.68));
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  min-height: 500px;
  overflow: hidden;
  isolation: isolate;
}

#section-overview .body-svg-container::before {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: calc(var(--radius-xl) - 8px);
  background:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 72%);
  opacity: 0.65;
  pointer-events: none;
  z-index: 0;
}

#section-overview .body-svg-container svg {
  width: 100%;
  height: min(68vh, 620px);
  min-height: 500px;
  max-height: 620px;
  position: relative;
  z-index: 1;
}

#section-overview .circulation-stage {
  --stage-core: rgba(14, 165, 233, 0.28);
  --stage-vein: rgba(56, 189, 248, 0.24);
  --stage-artery: rgba(248, 113, 113, 0.16);
  --stage-base-start: #0b2741;
  --stage-base-end: #123c5b;
  --stage-border: rgba(125, 211, 252, 0.56);
  --stage-shadow: rgba(14, 165, 233, 0.2);
  --map-wash: rgba(14, 116, 144, 0.08);
  --map-wash-opacity: 0.32;
  position: relative;
  width: min(100%, 640px);
  aspect-ratio: 1148 / 1068;
  height: auto;
  min-height: 0;
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(145deg, var(--stage-base-start) 0%, var(--stage-base-end) 100%);
  border: 1px solid var(--stage-border);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    inset 0 -40px 90px var(--stage-core),
    0 24px 60px rgba(2, 6, 23, 0.36),
    0 0 34px var(--stage-shadow);
  z-index: 1;
  transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

#section-overview .circulation-stage[data-overview-step="pulmonary"] {
  --stage-core: rgba(56, 189, 248, 0.34);
  --stage-vein: rgba(14, 165, 233, 0.36);
  --stage-artery: rgba(125, 211, 252, 0.18);
  --stage-base-start: #082f49;
  --stage-base-end: #0c4a6e;
  --stage-border: rgba(125, 211, 252, 0.68);
  --stage-shadow: rgba(56, 189, 248, 0.26);
  --map-wash: rgba(14, 165, 233, 0.1);
  --map-wash-opacity: 0.36;
}

#section-overview .circulation-stage[data-overview-step="systemic"] {
  --stage-core: rgba(248, 113, 113, 0.22);
  --stage-vein: rgba(56, 189, 248, 0.2);
  --stage-artery: rgba(239, 68, 68, 0.3);
  --stage-base-start: #14213a;
  --stage-base-end: #3f1725;
  --stage-border: rgba(248, 113, 113, 0.54);
  --stage-shadow: rgba(239, 68, 68, 0.2);
  --map-wash: rgba(239, 68, 68, 0.08);
  --map-wash-opacity: 0.3;
}

#section-overview .circulation-stage[data-overview-step="exchange"] {
  --stage-core: rgba(168, 85, 247, 0.26);
  --stage-vein: rgba(56, 189, 248, 0.2);
  --stage-artery: rgba(236, 72, 153, 0.2);
  --stage-base-start: #151b3f;
  --stage-base-end: #31205f;
  --stage-border: rgba(196, 181, 253, 0.62);
  --stage-shadow: rgba(168, 85, 247, 0.24);
  --map-wash: rgba(124, 58, 237, 0.08);
  --map-wash-opacity: 0.34;
}

#section-overview .circulation-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(14, 116, 144, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 116, 144, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 48%, transparent 48%, rgba(8, 47, 73, 0.08) 100%);
  background-size: 30px 30px, 30px 30px, 100% 100%;
  mask-image: radial-gradient(circle at 50% 48%, #000 0%, transparent 78%);
  opacity: 0.7;
  pointer-events: none;
  z-index: 1;
}

#section-overview .body-svg-container .arrow-flow-map {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  z-index: 3;
  pointer-events: none;
}

#section-overview .arrow-flow-map .af-base-map {
  pointer-events: none;
  filter: saturate(1.04) contrast(1.03) drop-shadow(0 8px 18px rgba(15, 23, 42, 0.12));
}

#section-overview .af-mode-wash {
  fill: transparent;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: normal;
  transition: opacity var(--transition-base);
}

#section-overview .circulation-stage[data-particles="hidden"] .af-flow-particles,
#section-overview .circulation-stage.is-paused .af-flow-particles {
  animation-play-state: paused;
}

#section-overview .circulation-stage[data-particles="hidden"] .af-flow-particles {
  opacity: 0;
}

#section-overview .af-flow-particles {
  filter: url(#af-glow);
}

#section-overview .af-flow-particles use {
  opacity: 0.96;
}

#section-overview .red-flow use {
  filter: drop-shadow(0 0 3px rgba(248, 113, 113, 0.62));
}

#section-overview .blue-flow use {
  filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.62));
}

#section-overview .af-exchange-labels {
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

#section-overview .circulation-stage[data-overview-step="exchange"] .af-exchange-labels {
  opacity: 1;
}

#section-overview .circulation-stage[data-labels="hidden"] .af-exchange-labels {
  display: none;
}

#section-overview .af-exchange-label {
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.22));
}

#section-overview .af-exchange-label.gas .af-exchange-pin {
  fill: #38bdf8;
  stroke: #f8fafc;
}

#section-overview .af-exchange-label.tissue .af-exchange-pin {
  fill: #a78bfa;
  stroke: #f8fafc;
}

#section-overview .af-exchange-pin {
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  animation: af-exchange-pin-pulse 1.6s ease-in-out infinite;
}

#section-overview .circulation-stage.is-paused .af-exchange-pin {
  animation-play-state: paused;
}

#section-overview .af-exchange-chip {
  fill: rgba(15, 23, 42, 0.84);
  stroke: rgba(216, 180, 254, 0.72);
  stroke-width: 1.4;
}

#section-overview .af-exchange-label.gas .af-exchange-chip {
  stroke: rgba(125, 211, 252, 0.82);
}

#section-overview .af-exchange-text {
  fill: #f8fafc;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: rgba(2, 6, 23, 0.75);
  stroke-width: 3px;
  stroke-linejoin: round;
}

@keyframes af-exchange-pin-pulse {
  0%, 100% {
    opacity: 0.78;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

/* SVG overview controls and particle focus replace the retired legacy visual layers. */
#section-overview .organ-hotspot {
  position: absolute;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  color: transparent;
  font-size: 0;
  line-height: 0;
  z-index: 7;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#section-overview .organ-hotspot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid rgba(14, 165, 233, 0.72);
  box-shadow:
    0 0 0 5px rgba(14, 165, 233, 0.11),
    0 0 18px rgba(14, 165, 233, 0.46);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.82);
  transition: opacity var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
  pointer-events: none;
}

#section-overview .organ-hotspot:hover::after,
#section-overview .organ-hotspot:focus-visible::after {
  opacity: 1;
  border-color: rgba(244, 63, 94, 0.92);
  box-shadow:
    0 0 0 7px rgba(244, 63, 94, 0.14),
    0 0 22px rgba(244, 63, 94, 0.52);
  transform: translate(-50%, -50%) scale(1);
}

#section-overview .organ-hotspot:hover,
#section-overview .organ-hotspot:focus,
#section-overview .organ-hotspot:active,
#section-overview .organ-hotspot.active {
  background: transparent !important;
  border-color: rgba(14, 165, 233, 0.16);
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.16);
  transform: none;
  filter: none;
  outline: none;
}

#section-overview .hotspot-heart {
  left: 42.8%;
  top: 31.2%;
  width: 12.5%;
  height: 17%;
  z-index: 14;
}

#section-overview .hotspot-lungs {
  left: 40.5%;
  top: 14%;
  width: 20.5%;
  height: 14.5%;
  z-index: 12;
}

#section-overview .hotspot-pulmonary-artery {
  left: 37.2%;
  top: 21.2%;
  width: 12.8%;
  height: 18.5%;
  z-index: 10;
}

#section-overview .hotspot-pulmonary-vein {
  left: 56.2%;
  top: 22%;
  width: 17.2%;
  height: 16.4%;
  z-index: 10;
}

#section-overview .hotspot-aorta-up {
  left: 55.2%;
  top: 3.6%;
  width: 12.5%;
  height: 28.8%;
  z-index: 9;
}

#section-overview .hotspot-aorta-main {
  left: 50.8%;
  top: 30%;
  width: 9.4%;
  height: 24.5%;
  z-index: 9;
}

#section-overview .hotspot-aorta-lower {
  left: 55.5%;
  top: 50.8%;
  width: 18.5%;
  height: 42%;
  z-index: 9;
}

#section-overview .hotspot-vena-cava-up {
  left: 27.5%;
  top: 4.8%;
  width: 19.4%;
  height: 38%;
  z-index: 9;
}

#section-overview .hotspot-vena-cava-lower {
  left: 18.2%;
  top: 40.5%;
  width: 30.5%;
  height: 51.8%;
  z-index: 9;
}

#section-overview .hotspot-portal-vein {
  left: 47.2%;
  top: 52%;
  width: 8.4%;
  height: 17%;
  z-index: 10;
}

#section-overview .hotspot-cap-brain {
  left: 42%;
  top: 1.7%;
  width: 17%;
  height: 10.5%;
  z-index: 13;
}

#section-overview .hotspot-cap-liver {
  left: 27.8%;
  top: 49.2%;
  width: 18.4%;
  height: 10.8%;
  z-index: 13;
}

#section-overview .hotspot-cap-gut {
  left: 52%;
  top: 57.6%;
  width: 19.5%;
  height: 12.4%;
  z-index: 13;
}

#section-overview .hotspot-cap-kidney {
  left: 42.5%;
  top: 74.3%;
  width: 18.7%;
  height: 10.8%;
  z-index: 13;
}

#section-overview .hotspot-cap-leg {
  left: 41.2%;
  top: 86.2%;
  width: 19.2%;
  height: 11.4%;
  z-index: 13;
}

#section-overview .overview-teaching-panel {
  width: min(100%, 640px);
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(2, 6, 23, 0.36);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#section-overview .overview-stepper,
#section-overview .overview-control-row,
#section-overview .overview-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

#section-overview .overview-step-btn,
#section-overview .overview-tool-btn,
#section-overview .overview-speed-control {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

#section-overview .overview-step-btn:hover,
#section-overview .overview-tool-btn:hover,
#section-overview .overview-speed-control:hover {
  border-color: rgba(125, 211, 252, 0.48);
  background: rgba(15, 23, 42, 0.92);
  transform: translateY(-1px);
}

#section-overview .overview-step-btn.active,
#section-overview .overview-tool-btn[aria-pressed="true"] {
  border-color: rgba(14, 165, 233, 0.72);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.88), rgba(124, 58, 237, 0.76));
  color: #fff;
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.22);
}

#section-overview .circulation-stage[data-overview-step="pulmonary"] + .overview-teaching-panel .overview-step-btn.active {
  border-color: rgba(125, 211, 252, 0.78);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.92), rgba(6, 182, 212, 0.76));
  box-shadow: 0 10px 24px rgba(56, 189, 248, 0.24);
}

#section-overview .circulation-stage[data-overview-step="systemic"] + .overview-teaching-panel .overview-step-btn.active {
  border-color: rgba(248, 113, 113, 0.74);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(37, 99, 235, 0.72));
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.2);
}

#section-overview .circulation-stage[data-overview-step="exchange"] + .overview-teaching-panel .overview-step-btn.active {
  border-color: rgba(196, 181, 253, 0.78);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(14, 165, 233, 0.7));
  box-shadow: 0 10px 24px rgba(168, 85, 247, 0.24);
}

#section-overview .overview-step-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.52);
  border: 1px dashed rgba(125, 211, 252, 0.24);
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.65;
  text-align: center;
}

#section-overview .overview-speed-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#section-overview .overview-speed-control select {
  color: #e0f2fe;
  background: rgba(2, 6, 23, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  font: inherit;
}

#section-overview .overview-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.66);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #dbeafe;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(2, 6, 23, 0.25);
}

#section-overview .legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 12px currentColor;
}

#section-overview .legend-dot.red { color: #ef4444; background: #ef4444; }
#section-overview .legend-dot.blue { color: #38bdf8; background: #38bdf8; }
#section-overview .legend-dot.purple { color: #a78bfa; background: #a78bfa; }

#section-overview .circulation-stage[data-labels="hidden"] + .overview-teaching-panel .overview-legend {
  display: none;
}

/* Info panel */
#section-overview .info-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: var(--space-xl);
  animation: slideInRight 0.5s ease both;
}

#section-overview .info-panel h3 {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

#section-overview .info-panel p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

#section-overview .info-clicked-target {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin: -4px 0 var(--space-sm);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.24);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

#section-overview .info-learning-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: var(--space-lg);
}

#section-overview .info-learning-card {
  min-height: 92px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.46);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

#section-overview .info-learning-card strong,
#section-overview .info-learning-card span {
  display: block;
}

#section-overview .info-learning-card strong {
  margin-bottom: 5px;
  color: #e0f2fe;
  font-size: 13px;
}

#section-overview .info-learning-card span {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.65;
}

/* === Circulation Overview v2 (co-*) === */
/* All new co-namespaced rules introduced by system-overview-animation-upgrade live here. */

/* ----------------------------------------------------------
   11. CLICKABLE ORGANS (SVG interactive elements)
   ---------------------------------------------------------- */
.organ-clickable {
  cursor: pointer;
  transition:
    filter var(--transition-base),
    transform var(--transition-base),
    opacity var(--transition-base);
  transform-origin: center;
}

.organ-clickable:hover {
  filter: drop-shadow(0 0 12px var(--accent-pink-glow)) brightness(1.2);
  transform: scale(1.03);
}

.organ-clickable.active {
  filter: drop-shadow(0 0 18px var(--accent-pink-glow)) brightness(1.3);
}

/* Organ tooltip labels */
.organ-label {
  position: absolute;
  padding: 6px 14px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  pointer-events: none;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
  z-index: 10;
}

.organ-clickable:hover + .organ-label,
.organ-label.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ----------------------------------------------------------
   12. HEART SECTION (#section-heart)
   ---------------------------------------------------------- */
#section-heart .heart-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

#section-heart .heart-svg-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: var(--space-xl);
  min-height: 520px;
  overflow: hidden;
}

#section-heart .heart-photo-stage {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
  background:
    /* Soft light backlights behind the left/right text labels in the transparent video */
    radial-gradient(circle at 10% 58%, rgba(255, 255, 255, 0.28) 0%, transparent 40%),
    radial-gradient(circle at 90% 54%, rgba(255, 255, 255, 0.28) 0%, transparent 40%),
    radial-gradient(circle at 40% 45%, rgba(239, 68, 68, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 60% 35%, rgba(59, 130, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(17, 24, 39, 0.9) 40%, #0a0e1a 100%);
  border: 2px solid rgba(239, 68, 68, 0.3);
  outline: 2px solid rgba(59, 130, 246, 0.15);
  outline-offset: 3px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.15),
    0 28px 70px rgba(2, 6, 23, 0.5),
    0 0 50px rgba(239, 68, 68, 0.1),
    0 0 80px rgba(59, 130, 246, 0.06);
  transform-origin: 50% 58%;
  animation: heartPhotoBeat 1.22s ease-in-out infinite;
}

#section-heart .heart-photo-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.12), transparent 25%, transparent 75%, rgba(15, 23, 42, 0.08)),
    radial-gradient(circle at 50% 60%, transparent 45%, rgba(127, 29, 29, 0.08) 100%);
  pointer-events: none;
  z-index: 3;
}

#section-heart .heart-photo-glow {
  position: absolute;
  left: 42%;
  top: 57%;
  width: 36%;
  height: 36%;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.22);
  filter: blur(22px);
  transform: translate(-50%, -50%);
  animation: heartGlowPulse 1.22s ease-in-out infinite;
  z-index: 1;
}

#section-heart .heart-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  z-index: 2;
  filter: saturate(1.08) contrast(1.05) drop-shadow(0 10px 18px rgba(127, 29, 29, 0.16));
}

#section-heart .heart-video {
  background: transparent;
}


#section-heart .heart-photo-stage.heart-paused .heart-photo-glow {
  animation: none;
  opacity: 0.34;
}

/* Heart chamber clickable parts */
#section-heart .heart-part {
  position: absolute;
  cursor: pointer;
  z-index: 4;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  padding: 0;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    filter var(--transition-base);
}

#section-heart .heart-hotspot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(239, 68, 68, 0.85);
  box-shadow:
    0 0 0 5px rgba(239, 68, 68, 0.15),
    0 0 22px rgba(239, 68, 68, 0.5);
  transform: translate(-50%, -50%) scale(0.82);
  opacity: 0.75;
  transition: opacity var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
  animation: heart-dot-pulse 2s ease-in-out infinite;
}

@keyframes heart-dot-pulse {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12), 0 0 16px rgba(239, 68, 68, 0.35); }
  50% { opacity: 0.9; box-shadow: 0 0 0 7px rgba(239, 68, 68, 0.2), 0 0 28px rgba(239, 68, 68, 0.6); }
}

#section-heart .heart-hotspot span {
  position: absolute;
  left: 50%;
  top: calc(50% + 18px);
  transform: translateX(-50%) translateY(0);
  min-width: max-content;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(8, 13, 27, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
  z-index: 10;
}

#section-heart .heart-part:hover,
#section-heart .heart-part:focus-visible,
#section-heart .heart-part.active {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.22);
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.34));
  transform: scale(1.03);
}

#section-heart .heart-part:hover::after,
#section-heart .heart-part:focus-visible::after,
#section-heart .heart-part.active::after {
  opacity: 1;
  border-color: rgba(14, 165, 233, 0.88);
  box-shadow:
    0 0 0 7px rgba(14, 165, 233, 0.14),
    0 0 24px rgba(14, 165, 233, 0.55);
  transform: translate(-50%, -50%) scale(1);
}

#section-heart .heart-part:hover span,
#section-heart .heart-part:focus-visible span,
#section-heart .heart-part.active span {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
  border-color: rgba(14, 165, 233, 0.65);
  background: rgba(8, 13, 27, 0.94);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25);
}

#section-heart .hp-right-atrium { left: 28%; top: 40%; width: 18%; height: 18%; }
#section-heart .hp-right-ventricle { left: 33%; top: 58%; width: 22%; height: 24%; }
#section-heart .hp-left-atrium { left: 63%; top: 39%; width: 14%; height: 16%; }
#section-heart .hp-left-ventricle { left: 62%; top: 58%; width: 17%; height: 27%; }
#section-heart .hp-valves { left: 43%; top: 42%; width: 25%; height: 23%; }
#section-heart .hp-left-wall { left: 69%; top: 58%; width: 11%; height: 29%; }
#section-heart .hp-right-wall { left: 30%; top: 55%; width: 13%; height: 28%; }
#section-heart .hp-aorta { left: 51%; top: 10%; width: 23%; height: 26%; }
#section-heart .hp-pulmonary-artery { left: 58%; top: 27%; width: 29%; height: 17%; }
#section-heart .hp-pulmonary-vein { left: 17%; top: 36%; width: 71%; height: 13%; }
#section-heart .hp-vena-cava { left: 32%; top: 24%; width: 14%; height: 62%; }

#section-heart .hp-right-atrium,
#section-heart .hp-right-ventricle,
#section-heart .hp-left-atrium,
#section-heart .hp-left-ventricle {
  z-index: 8;
}

#section-heart .hp-valves,
#section-heart .hp-left-wall,
#section-heart .hp-right-wall {
  z-index: 9;
}

#section-heart .hp-pulmonary-vein,
#section-heart .hp-vena-cava {
  z-index: 5;
}

@keyframes heartPhotoBeat {
  0%, 30%, 64%, 100% { transform: scale(1); }
  12% { transform: scale(1.035); }
  20% { transform: scale(0.992); }
  45% { transform: scale(1.018); }
}

@keyframes heartGlowPulse {
  0%, 30%, 64%, 100% { opacity: 0.44; transform: translate(-50%, -50%) scale(1); }
  12% { opacity: 0.78; transform: translate(-50%, -50%) scale(1.14); }
  45% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.07); }
}

/* Heart info panel */
#section-heart .heart-info {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3vw, 34px);
  background:
    radial-gradient(circle at 12% 0%, rgba(239, 68, 68, 0.16), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(59, 130, 246, 0.12), transparent 38%),
    linear-gradient(145deg, rgba(17, 24, 39, 0.92), rgba(15, 23, 42, 0.78));
  border-color: rgba(148, 163, 184, 0.24);
  animation: slideInRight 0.5s ease both;
}

#section-heart .heart-info::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 74%);
  pointer-events: none;
}

#section-heart .heart-info > * {
  position: relative;
  z-index: 1;
}

#section-heart .heart-info-header {
  display: grid;
  gap: 10px;
  padding: 0 0 var(--space-lg);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

#section-heart .heart-info .badge {
  width: max-content;
  min-height: 28px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  letter-spacing: 0;
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.14);
}

#section-heart .heart-info h3 {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: 0;
  margin: 0;
  color: #f8fafc;
  text-wrap: balance;
}

#section-heart .heart-info h3::after {
  content: '';
  display: block;
  width: 72px;
  height: 3px;
  margin-top: 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent-red), var(--accent-blue));
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.28);
}

#section-heart #heart-info-desc {
  max-width: 72ch;
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(2, 6, 23, 0.34);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.85;
  text-wrap: pretty;
}

/* Heart facts grid */
#section-heart .facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: var(--space-lg);
}

#section-heart .fact-card {
  position: relative;
  min-height: 128px;
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 14px;
  align-items: start;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.64));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  border-top: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 38px rgba(2, 6, 23, 0.18);
  transition:
    transform var(--transition-spring),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

#section-heart .fact-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  background: var(--accent-red);
}

#section-heart .fact-card:nth-child(2)::before { background: var(--accent-blue); }
#section-heart .fact-card:nth-child(3)::before { background: var(--accent-purple); }
#section-heart .fact-card:nth-child(4)::before { background: var(--accent-pink); }

#section-heart .fact-card:hover {
  transform: translateY(-4px);
  border-color: rgba(226, 232, 240, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 22px 48px rgba(2, 6, 23, 0.28);
}

#section-heart .fact-card .fact-icon {
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 24px;
  margin: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#section-heart .fact-card .fact-title {
  align-self: end;
  font-weight: 900;
  font-size: 15px;
  line-height: 1.35;
  color: #f8fafc;
  margin: 0 0 4px;
}

#section-heart .fact-card .fact-value {
  grid-column: 2;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.7;
  margin: 0;
}

/* ----------------------------------------------------------
   13. VESSELS SECTION (#section-vessels)
   ---------------------------------------------------------- */
#section-vessels .vessels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

#section-vessels .vessel-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: var(--space-xl);
  text-align: center;
  transition:
    transform var(--transition-spring),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

/* Color-coded top borders */
#section-vessels .vessel-card.artery {
  border-top: 4px solid var(--accent-red);
}

#section-vessels .vessel-card.vein {
  border-top: 4px solid var(--accent-blue);
}

#section-vessels .vessel-card.capillary {
  border-top: 4px solid var(--accent-purple);
}

#section-vessels .vessel-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--glass-shadow-hover);
}

#section-vessels .vessel-card.artery:hover { border-top-color: var(--accent-red-deep); }
#section-vessels .vessel-card.vein:hover   { border-top-color: var(--accent-blue-deep); }

#section-vessels .vessel-card .vessel-icon {
  font-size: 40px;
  margin-bottom: var(--space-md);
}

#section-vessels .vessel-card h3 {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

#section-vessels .vessel-card .vessel-svg {
  width: 140px;
  height: 140px;
  margin: var(--space-md) auto;
}

#section-vessels .vessel-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

/* Comparison table */
#section-vessels .comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
}

#section-vessels .comparison-table th {
  background: rgba(139, 92, 246, 0.15);
  padding: 14px 20px;
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

#section-vessels .comparison-table td {
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#section-vessels .comparison-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

#section-vessels .comparison-table tr:last-child td {
  border-bottom: none;
}

#section-vessels .comparison-table tr:hover td {
  background: rgba(139, 92, 246, 0.05);
}

/* ----------------------------------------------------------
   14. BLOOD SECTION (#section-blood)
   ---------------------------------------------------------- */
#section-blood .blood-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

/* Test tube visualization */
#section-blood .test-tube-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#section-blood .test-tube {
  width: 80px;
  height: 280px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 0 0 40px 40px;
  border-top: none;
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

#section-blood .test-tube .layer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  animation: fillUp 1.5s ease-out both;
}

#section-blood .test-tube .layer-plasma {
  --fill-height: 55%;
  background: linear-gradient(to top, #fbbf24, #fde68a);
  height: var(--fill-height);
  opacity: 0.85;
  animation-delay: 0.6s;
}

#section-blood .test-tube .layer-wbc {
  --fill-height: 57%;
  background: rgba(255, 255, 255, 0.5);
  height: var(--fill-height);
  animation-delay: 0.4s;
}

#section-blood .test-tube .layer-rbc {
  --fill-height: 45%;
  background: linear-gradient(to top, #991b1b, #dc2626);
  height: var(--fill-height);
  animation-delay: 0.2s;
}

/* Blood info cards */
#section-blood .blood-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

#section-blood .blood-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border-left: 4px solid;
  transition:
    transform var(--transition-spring),
    box-shadow var(--transition-base);
  animation: slideInUp 0.5s ease both;
}

#section-blood .blood-card:nth-child(1) {
  border-left-color: var(--accent-yellow);
  animation-delay: 0.1s;
}

#section-blood .blood-card:nth-child(2) {
  border-left-color: var(--accent-red);
  animation-delay: 0.2s;
}

#section-blood .blood-card:nth-child(3) {
  border-left-color: #e2e8f0;
  animation-delay: 0.3s;
}

#section-blood .blood-card:nth-child(4) {
  border-left-color: var(--accent-purple);
  animation-delay: 0.4s;
}

#section-blood .blood-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-shadow-hover);
}

#section-blood .blood-card .card-icon {
  font-size: 28px;
  margin-bottom: var(--space-sm);
}

#section-blood .blood-card h4 {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

#section-blood .blood-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ----------------------------------------------------------
   15. CIRCULATION SECTION (#section-circulation)
   ---------------------------------------------------------- */
#section-circulation .circulation-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-xl);
}

#section-circulation .pathway {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: var(--space-xl);
  position: relative;
}

#section-circulation .pathway h3 {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-lg);
}

#section-circulation .pathway.systemic h3 {
  color: var(--accent-red);
  text-shadow: 0 0 20px var(--accent-red-glow);
}

#section-circulation .pathway.pulmonary h3 {
  color: var(--accent-blue);
  text-shadow: 0 0 20px var(--accent-blue-glow);
}

/* Flow nodes */
#section-circulation .flow-nodes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

#section-circulation .flow-node {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  border: 2px solid;
  background: var(--bg-card);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

#section-circulation .flow-node:hover {
  transform: scale(1.08);
}

#section-circulation .flow-node.node-red {
  border-color: var(--accent-red);
  color: var(--accent-red);
  box-shadow: 0 0 15px var(--accent-red-glow);
}

#section-circulation .flow-node.node-blue {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: 0 0 15px var(--accent-blue-glow);
}

#section-circulation .flow-node.node-purple {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  box-shadow: 0 0 15px var(--accent-purple-glow);
}

/* Flow arrows */
#section-circulation .flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-muted);
  position: relative;
  height: 30px;
}

#section-circulation .flow-arrow::before {
  content: '';
  position: absolute;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent-red), var(--accent-blue));
  opacity: 0.4;
}

/* Animated connecting lines (SVG overlay) */
#section-circulation .flow-line {
  stroke-dasharray: 8 4;
  animation: dashMarch 0.8s linear infinite;
}

#section-circulation .flow-line.artery {
  stroke: var(--accent-red);
  stroke-width: 2;
}

#section-circulation .flow-line.vein {
  stroke: var(--accent-blue);
  stroke-width: 2;
}

/* Key concept box */
#section-circulation .key-concept {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-xl);
}

#section-circulation .key-concept h4 {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 700;
  color: var(--accent-purple);
  margin-bottom: var(--space-sm);
  font-size: 16px;
}

#section-circulation .key-concept p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

/* ----------------------------------------------------------
   16. QUIZ SECTION (#section-quiz)
   ---------------------------------------------------------- */
#section-quiz {
  max-width: 800px;
}

/* Progress bar */
#section-quiz .quiz-progress {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-xl);
  overflow: hidden;
}

#section-quiz .quiz-progress-fill {
  height: 100%;
  background: var(--gradient-nav);
  border-radius: var(--radius-pill);
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* Question counter */
#section-quiz .quiz-counter {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Question text */
#section-quiz .quiz-question {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-2xl);
  line-height: 1.6;
  color: var(--text-primary);
}

/* Options */
#section-quiz .quiz-options {
  display: grid;
  gap: var(--space-md);
}

#section-quiz .quiz-option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--text-primary);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-spring);
}

#section-quiz .quiz-option .option-letter {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-base);
}

#section-quiz .quiz-option:hover {
  background: var(--glass-bg-hover);
  border-color: var(--accent-purple);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
  transform: translateX(4px);
}

#section-quiz .quiz-option:hover .option-letter {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: #fff;
}

/* Correct */
#section-quiz .quiz-option.correct {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 0 20px var(--accent-green-glow);
}

#section-quiz .quiz-option.correct .option-letter {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

#section-quiz .quiz-option.correct::after {
  content: '✓';
  margin-left: auto;
  font-size: 20px;
  font-weight: bold;
  color: var(--accent-green);
}

/* Wrong */
#section-quiz .quiz-option.wrong {
  border-color: var(--accent-red);
  background: rgba(239, 68, 68, 0.1);
  box-shadow: 0 0 20px var(--accent-red-glow);
}

#section-quiz .quiz-option.wrong .option-letter {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

#section-quiz .quiz-option.wrong::after {
  content: '✗';
  margin-left: auto;
  font-size: 20px;
  font-weight: bold;
  color: var(--accent-red);
}

/* Disabled state after answer */
#section-quiz .quiz-option.disabled {
  pointer-events: none;
  opacity: 0.5;
}

#section-quiz .quiz-option.disabled.correct,
#section-quiz .quiz-option.disabled.wrong {
  opacity: 1;
}

/* Result display */
#section-quiz .quiz-result {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  animation: scaleIn 0.6s ease both;
}

#section-quiz .quiz-result .result-icon {
  font-size: 72px;
  margin-bottom: var(--space-lg);
  animation: celebrate 0.8s ease both;
}

#section-quiz .quiz-result .result-score {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-md);
}

#section-quiz .quiz-result .result-text {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

#section-quiz .quiz-remediation {
  max-width: 720px;
  margin: 0 auto var(--space-xl);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(125, 211, 252, 0.18);
  background: rgba(15, 23, 42, 0.48);
  text-align: left;
}

#section-quiz .quiz-remediation h4 {
  margin-bottom: 6px;
  color: #e0f2fe;
  font-size: 16px;
}

#section-quiz .quiz-remediation p {
  margin: 0 0 var(--space-md);
  color: var(--text-secondary);
  font-size: 13px;
}

#section-quiz .quiz-remediation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#section-quiz .quiz-review-btn {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(125, 211, 252, 0.26);
  background: rgba(14, 165, 233, 0.12);
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

#section-quiz .quiz-review-btn:hover {
  transform: translateY(-1px);
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(125, 211, 252, 0.5);
}

#section-quiz .quiz-result .result-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-nav);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
  transition: transform var(--transition-spring), box-shadow var(--transition-base);
}

#section-quiz .quiz-result .result-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

/* ----------------------------------------------------------
   17. SVG BLOOD FLOW ANIMATIONS
   ---------------------------------------------------------- */
.artery-path {
  stroke: var(--accent-red);
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 12 6;
  animation: bloodFlow 2s linear infinite;
}

.vein-path {
  stroke: var(--accent-blue);
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 12 6;
  animation: bloodFlow 3s linear infinite;
}

.capillary-path {
  stroke: var(--accent-purple);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 4 4;
  animation: bloodFlow 2.5s linear infinite;
}

/* Arrow markers */
.arrow-marker-red { fill: var(--accent-red); }
.arrow-marker-blue { fill: var(--accent-blue); }
.arrow-marker-purple { fill: var(--accent-purple); }

/* ----------------------------------------------------------
   18. COMMON CARD & BUTTON STYLES
   ---------------------------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-nav);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  transition:
    transform var(--transition-spring),
    box-shadow var(--transition-base);
  cursor: pointer;
}

.btn-primary:hover {
  transform: scale(1.04) translateY(-1px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  transition:
    background var(--transition-fast),
    border-color var(--transition-base);
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}

/* Badge / pill */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  letter-spacing: 0.5px;
}

.badge.red    { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.badge.blue   { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.badge.green  { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.badge.yellow { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }

/* ----------------------------------------------------------
   18B. COMPETITION VISUAL POLISH LAYER
   ---------------------------------------------------------- */
:root {
  --premium-ink: #050915;
  --premium-panel: rgba(9, 18, 34, 0.72);
  --premium-panel-strong: rgba(12, 23, 43, 0.86);
  --premium-line: rgba(158, 196, 255, 0.18);
  --premium-line-bright: rgba(186, 230, 253, 0.44);
  --premium-cyan: #5eead4;
  --premium-blue: #38bdf8;
  --premium-red: #fb7185;
  --premium-gold: #f8d07a;
  --premium-shadow: 0 24px 80px rgba(2, 6, 23, 0.52);
  --premium-inner: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(2, 6, 23, 0.4);
}

body {
  background:
    linear-gradient(135deg, rgba(94, 234, 212, 0.045) 0%, transparent 28%),
    linear-gradient(220deg, rgba(251, 113, 133, 0.04) 0%, transparent 32%),
    linear-gradient(180deg, #060a16 0%, #0b1020 45%, #050813 100%);
}

body::before {
  background:
    linear-gradient(115deg, transparent 0%, rgba(125, 211, 252, 0.075) 48%, transparent 56%),
    linear-gradient(245deg, transparent 0%, rgba(248, 113, 113, 0.06) 46%, transparent 56%),
    linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.36) 100%);
  animation: premiumAmbientSweep 22s ease-in-out infinite;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 78%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 78%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

@keyframes premiumAmbientSweep {
  0%, 100% { opacity: 0.82; transform: translate3d(0, 0, 0); }
  50% { opacity: 1; transform: translate3d(0, -12px, 0); }
}

#welcome-screen {
  background:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(14, 165, 233, 0.08), transparent 34%),
    linear-gradient(225deg, rgba(244, 63, 94, 0.06), transparent 34%),
    #050915;
  background-size: 46px 46px, 46px 46px, 100% 100%, 100% 100%, 100% 100%;
}

#welcome-screen::before {
  content: none;
}

#welcome-screen .welcome-content {
  position: relative;
  max-width: 920px;
}

#welcome-screen .welcome-content::before,
#welcome-screen .welcome-content::after {
  content: '';
  position: absolute;
  left: 50%;
  width: min(520px, 72vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(94, 234, 212, 0.48), rgba(248, 208, 122, 0.42), transparent);
  pointer-events: none;
}

#welcome-screen .welcome-content::before { top: 4px; }
#welcome-screen .welcome-content::after { bottom: 4px; }

#welcome-screen .welcome-icon {
  filter:
    drop-shadow(0 0 24px rgba(251, 113, 133, 0.4))
    drop-shadow(0 0 42px rgba(56, 189, 248, 0.12));
}

#welcome-screen .welcome-title {
  background: linear-gradient(110deg, #ffffff, #bff7ff 32%, #d7c8ff 64%, #ffd0da);
  -webkit-background-clip: text;
  background-clip: text;
}

#welcome-screen .welcome-subtitle {
  color: #b7c8dd;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

#welcome-screen .welcome-btn {
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.98), rgba(139, 92, 246, 0.9) 58%, rgba(244, 63, 94, 0.92));
  box-shadow:
    0 18px 42px rgba(14, 165, 233, 0.24),
    0 0 32px rgba(244, 63, 94, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

#nav-bar {
  min-height: 58px;
  padding: 9px clamp(16px, 2.4vw, 34px);
  background:
    linear-gradient(180deg, rgba(6, 10, 22, 0.92), rgba(8, 13, 27, 0.72));
  border-bottom: 1px solid rgba(125, 211, 252, 0.18);
  box-shadow:
    0 18px 48px rgba(2, 6, 23, 0.46),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

#nav-bar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(94, 234, 212, 0.7) 15%, rgba(56, 189, 248, 0.6) 30%, rgba(139, 92, 246, 0.6) 50%, rgba(244, 63, 94, 0.7) 70%, rgba(251, 191, 36, 0.5) 85%, transparent 100%);
  background-size: 200% 100%;
  animation: nav-line-shimmer 4s linear infinite;
  pointer-events: none;
}

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

#nav-bar .nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  min-width: min(360px, 44vw);
  padding-right: 18px;
  font-size: 16px;
  letter-spacing: 0;
  background: none;
  -webkit-text-fill-color: initial;
  filter: drop-shadow(0 0 14px rgba(94, 234, 212, 0.16));
  white-space: nowrap;
}

#nav-bar .brand-mark {
  color: #dffcff;
  -webkit-text-fill-color: currentColor;
}

#nav-bar .brand-copy {
  display: inline;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0.5px;
  line-height: 1;
  white-space: nowrap;
  background: linear-gradient(110deg, #f8fafc 0%, var(--premium-cyan) 30%, #d7c8ff 55%, var(--premium-red) 80%, #f8fafc 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: brand-text-shimmer 6s ease-in-out infinite;
}

@keyframes brand-text-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

#nav-bar .nav-brand::after {
  content: '';
  position: absolute;
  right: 0;
  top: 22%;
  width: 1px;
  height: 56%;
  background: linear-gradient(to bottom, transparent, rgba(148, 163, 184, 0.42), transparent);
}

#nav-bar .nav-btn {
  min-height: 42px;
  padding: 10px 22px;
  font-size: 15px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#nav-bar .nav-btn:hover {
  background: rgba(15, 23, 42, 0.68);
  border-color: rgba(125, 211, 252, 0.34);
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 28px rgba(14, 165, 233, 0.18),
    0 0 16px rgba(139, 92, 246, 0.12);
}

#nav-bar .nav-btn.active {
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.96), rgba(139, 92, 246, 0.88) 54%, rgba(244, 63, 94, 0.9));
  box-shadow:
    0 12px 28px rgba(14, 165, 233, 0.26),
    0 0 26px rgba(244, 63, 94, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  animation: nav-active-glow 2.5s ease-in-out infinite;
}

#content-area {
  padding-top: clamp(84px, 5vw, 96px);
}

.section {
  position: relative;
  padding-top: clamp(24px, 3.6vw, 50px);
}

.section::before {
  content: '';
  display: block;
  width: min(260px, 54vw);
  height: 34px;
  margin: 0 auto 14px;
  background:
    radial-gradient(circle at 50% 50%, rgba(248, 208, 122, 0.95) 0 5px, rgba(248, 208, 122, 0.24) 6px 11px, transparent 12px),
    radial-gradient(circle at 18% 50%, rgba(94, 234, 212, 0.5) 0 3px, transparent 4px),
    radial-gradient(circle at 82% 50%, rgba(251, 113, 133, 0.5) 0 3px, transparent 4px),
    linear-gradient(90deg, transparent 0%, transparent 38%, rgba(255, 255, 255, 0.18) 44%, rgba(248, 208, 122, 1) 50%, rgba(251, 113, 133, 0.92) 56%, transparent 64%, transparent 100%),
    linear-gradient(90deg, transparent 0%, rgba(94, 234, 212, 0.42) 18%, rgba(56, 189, 248, 0.38) 37%, rgba(248, 208, 122, 0.48) 50%, rgba(251, 113, 133, 0.42) 64%, transparent 100%);
  background-size:
    100% 100%,
    100% 100%,
    100% 100%,
    240% 100%,
    100% 100%;
  background-position:
    50% 50%,
    18% 50%,
    82% 50%,
    145% 50%,
    50% 50%;
  -webkit-mask:
    url("data:image/svg+xml,%3Csvg width='260' height='34' viewBox='0 0 260 34' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 18H72L82 18L91 6L102 28L113 18H145L154 18L162 10L171 24L181 18H252' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat,
    radial-gradient(circle at 50% 50%, #000 0 9px, transparent 10px);
  mask:
    url("data:image/svg+xml,%3Csvg width='260' height='34' viewBox='0 0 260 34' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 18H72L82 18L91 6L102 28L113 18H145L154 18L162 10L171 24L181 18H252' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat,
    radial-gradient(circle at 50% 50%, #000 0 9px, transparent 10px);
  -webkit-mask-composite: source-over;
  mask-composite: add;
  filter: drop-shadow(0 0 12px rgba(94, 234, 212, 0.36)) drop-shadow(0 0 18px rgba(251, 113, 133, 0.22));
  animation: section-ecg-pulse 2.35s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  will-change: background-position, opacity, transform;
}

.section::after {
  content: '';
  position: absolute;
  top: calc(clamp(24px, 3.6vw, 50px) + 12px);
  left: 50%;
  z-index: 1;
  display: block;
  width: 10px;
  height: 10px;
  margin: 0;
  border-radius: 50%;
  background: #f8d07a;
  box-shadow:
    0 0 0 5px rgba(248, 208, 122, 0.13),
    0 0 22px rgba(248, 208, 122, 0.58),
    0 0 34px rgba(251, 113, 133, 0.28);
  animation: section-heart-kernel 1.45s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
  will-change: transform, opacity, box-shadow;
}

@keyframes section-ecg-pulse {
  0% {
    background-position: 50% 50%, 18% 50%, 82% 50%, 145% 50%, 50% 50%;
    opacity: 0.62;
    transform: translateY(0) scaleX(0.98);
  }
  24% {
    opacity: 1;
    transform: translateY(-1px) scaleX(1.02);
  }
  52% {
    background-position: 50% 50%, 21% 50%, 79% 50%, 18% 50%, 50% 50%;
    opacity: 1;
  }
  78% {
    opacity: 0.86;
    transform: translateY(0) scaleX(1);
  }
  100% {
    background-position: 50% 50%, 18% 50%, 82% 50%, -120% 50%, 50% 50%;
    opacity: 0.62;
    transform: translateY(0) scaleX(0.98);
  }
}

@keyframes section-heart-kernel {
  0%, 36%, 72%, 100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.78;
    box-shadow:
      0 0 0 5px rgba(248, 208, 122, 0.13),
      0 0 22px rgba(248, 208, 122, 0.58),
      0 0 34px rgba(251, 113, 133, 0.28);
  }
  12% {
    transform: translateX(-50%) scale(1.85);
    opacity: 1;
    box-shadow:
      0 0 0 10px rgba(248, 208, 122, 0.16),
      0 0 28px rgba(248, 208, 122, 0.86),
      0 0 44px rgba(251, 113, 133, 0.46);
  }
  48% {
    transform: translateX(-50%) scale(1.38);
    opacity: 0.95;
    box-shadow:
      0 0 0 8px rgba(94, 234, 212, 0.13),
      0 0 24px rgba(94, 234, 212, 0.62),
      0 0 38px rgba(248, 208, 122, 0.32);
  }
}

.section-title {
  font-size: clamp(28px, 3.6vw, 42px);
  letter-spacing: 0;
  background: linear-gradient(110deg, #ffffff 0%, #c7f9ff 20%, #a78bfa 40%, #d7c8ff 55%, #ffd0da 70%, #fbbf24 85%, #ffffff 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  animation: title-text-shimmer 5s ease-in-out infinite;
  position: relative;
}

@keyframes title-text-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.section-subtitle {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  color: #b8c7dc;
  line-height: 1.9;
}

.glass-card,
#section-vessels .vessel-card,
#section-blood .blood-card,
#section-circulation .pathway,
#section-quiz .quiz-option,
#section-overview .overview-teaching-panel,
#section-vessels .comparison-table {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025) 38%, rgba(14, 165, 233, 0.045)),
    var(--premium-panel);
  border-color: var(--premium-line);
  box-shadow:
    var(--premium-shadow),
    var(--premium-inner);
}

.glass-card:hover,
#section-vessels .vessel-card:hover,
#section-blood .blood-card:hover,
#section-circulation .pathway:hover {
  border-color: rgba(125, 211, 252, 0.34);
  box-shadow:
    0 30px 88px rgba(2, 6, 23, 0.62),
    0 0 34px rgba(56, 189, 248, 0.12),
    var(--premium-inner);
}

#section-overview .body-svg-container,
#section-heart .heart-svg-container {
  border-color: rgba(125, 211, 252, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), transparent 30%, rgba(94, 234, 212, 0.045) 100%),
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(145deg, rgba(8, 13, 27, 0.94), rgba(7, 17, 32, 0.9));
  background-size: 100% 100%, 38px 38px, 38px 38px, 100% 100%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -80px 120px rgba(2, 6, 23, 0.34),
    0 28px 90px rgba(2, 6, 23, 0.58),
    0 0 42px rgba(14, 165, 233, 0.1);
}

#section-overview .circulation-stage,
#section-heart .heart-photo-stage {
  border-radius: 20px;
  border-color: rgba(186, 230, 253, 0.34);
  outline: 1px solid rgba(255, 255, 255, 0.24);
  outline-offset: -8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 -58px 118px rgba(8, 47, 73, 0.24),
    0 28px 76px rgba(2, 6, 23, 0.56),
    0 0 0 10px rgba(2, 6, 23, 0.22),
    0 0 46px rgba(94, 234, 212, 0.16);
}

#section-overview .circulation-stage::before,
#section-heart .heart-photo-stage::before {
  opacity: 0.48;
  border-radius: 20px;
}

#section-overview .circulation-stage::after,
#section-heart .heart-photo-stage::after {
  opacity: 0.44;
}

#section-overview .af-mode-wash {
  fill: transparent;
  opacity: 0;
}

#section-overview .overview-teaching-panel {
  border-radius: 16px;
  padding: 18px;
}

#section-overview .overview-step-btn,
#section-overview .overview-tool-btn,
#section-overview .overview-speed-control,
.btn-secondary,
#section-quiz .quiz-review-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(15, 23, 42, 0.64);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#section-overview .overview-step-btn.active,
#section-overview .overview-tool-btn[aria-pressed="true"],
.btn-primary,
#section-quiz .quiz-result .result-btn {
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.96), rgba(139, 92, 246, 0.88) 58%, rgba(244, 63, 94, 0.9));
  box-shadow:
    0 14px 32px rgba(14, 165, 233, 0.24),
    0 0 30px rgba(244, 63, 94, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#section-overview .info-panel,
#section-heart .heart-info,
#section-quiz #quiz-container,
#section-quiz .quiz-result {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025) 40%, rgba(248, 113, 113, 0.04)),
    rgba(11, 18, 34, 0.82);
  border-color: rgba(186, 230, 253, 0.22);
}

#section-overview .info-panel::after,
#section-heart .heart-info::after,
#section-quiz #quiz-container::after,
#section-quiz .quiz-result::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94, 234, 212, 0.62), rgba(251, 113, 133, 0.44), transparent);
  pointer-events: none;
}

#section-overview .info-learning-card,
#section-heart .fact-card,
#section-blood .blood-card,
#section-vessels .vessel-card {
  border-radius: 16px;
}

#section-heart .fact-card,
#section-overview .info-learning-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(15, 23, 42, 0.48);
  border-color: rgba(148, 163, 184, 0.18);
}

#section-vessels .vessel-card {
  position: relative;
  overflow: hidden;
}

#section-vessels .vessel-card::before,
#section-blood .blood-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.12), transparent 30%, transparent 72%, rgba(94, 234, 212, 0.06));
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

#section-vessels .vessel-card:hover::before,
#section-blood .blood-card:hover::before {
  opacity: 1;
}

#section-vessels .comparison-table {
  box-shadow: var(--premium-shadow);
}

#section-vessels .comparison-table th {
  background: rgba(14, 165, 233, 0.12);
  color: #eaf6ff;
}

#section-blood .test-tube-container {
  border-color: rgba(248, 208, 122, 0.2);
}

#section-blood .test-tube {
  border-color: rgba(226, 232, 240, 0.34);
  box-shadow:
    inset 0 0 24px rgba(255, 255, 255, 0.08),
    0 0 32px rgba(248, 208, 122, 0.12);
}

#section-circulation .pathway {
  border-radius: 18px;
  border-top-width: 3px;
}

#section-circulation .flow-node {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 14px 30px rgba(2, 6, 23, 0.38);
}

#section-circulation .key-concept {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(15, 23, 42, 0.46);
  border-color: rgba(94, 234, 212, 0.18);
}

#section-quiz #quiz-container {
  box-shadow:
    0 30px 90px rgba(2, 6, 23, 0.58),
    0 0 38px rgba(139, 92, 246, 0.12),
    var(--premium-inner);
}

#section-quiz .quiz-progress {
  background: rgba(148, 163, 184, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#section-quiz .quiz-progress-fill {
  background: linear-gradient(90deg, var(--premium-cyan), var(--premium-blue), var(--premium-red));
}

#section-quiz .quiz-option:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 234, 212, 0.42);
  box-shadow:
    0 16px 32px rgba(2, 6, 23, 0.34),
    0 0 22px rgba(94, 234, 212, 0.1);
}

/* ----------------------------------------------------------
   18C. TARGETED OPENING & TITLE RAIL REFINEMENT
   ---------------------------------------------------------- */
#loading-screen {
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(94, 234, 212, 0.1) 0%, transparent 34%),
    radial-gradient(ellipse at 50% 60%, rgba(251, 113, 133, 0.08) 0%, transparent 28%),
    linear-gradient(180deg, #070d1a 0%, #050914 54%, #030611 100%);
}

#loading-screen::before,
#loading-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

#loading-screen::before {
  background:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(110deg, transparent 0%, transparent 36%, rgba(94, 234, 212, 0.11) 47%, rgba(248, 208, 122, 0.06) 52%, transparent 64%, transparent 100%);
  background-size: 46px 46px, 46px 46px, 230% 100%;
  background-position: 0 0, 0 0, -80% 50%;
  opacity: 0.9;
  animation: openingQuietSweep 8s ease-in-out infinite;
}

#loading-screen::after {
  background:
    radial-gradient(circle at 50% 45%, transparent 0 118px, rgba(94, 234, 212, 0.18) 119px, transparent 121px),
    radial-gradient(circle at 50% 45%, transparent 0 158px, rgba(251, 113, 133, 0.12) 159px, transparent 161px);
  opacity: 0.52;
  animation: openingRingBreath 3.8s ease-in-out infinite;
}

#loading-screen > * {
  position: relative;
  z-index: 1;
}

#loading-screen .heart-icon {
  display: grid;
  place-items: center;
  position: relative;
  width: 112px;
  height: 112px;
  margin-bottom: 28px;
  border-radius: 30px;
  border: 1px solid rgba(186, 230, 253, 0.32);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035)),
    linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(251, 113, 133, 0.18));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -26px 48px rgba(2, 6, 23, 0.26),
    0 24px 72px rgba(2, 6, 23, 0.58),
    0 0 34px rgba(251, 113, 133, 0.22),
    0 0 44px rgba(94, 234, 212, 0.1);
  font-size: 58px;
  line-height: 1;
  filter: none;
  animation: openingHeartBeat 1.35s ease-in-out infinite;
}

#loading-screen .heart-icon::before {
  content: '';
  position: absolute;
  inset: -18px;
  border-radius: 38px;
  border: 1px solid rgba(94, 234, 212, 0.18);
  box-shadow:
    inset 0 0 22px rgba(94, 234, 212, 0.05),
    0 0 28px rgba(94, 234, 212, 0.12);
  animation: openingFramePulse 2.8s ease-in-out infinite;
}

#loading-screen .heart-icon::after {
  content: '';
  position: absolute;
  inset: -32px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 52deg, rgba(94, 234, 212, 0.42) 72deg, transparent 96deg, transparent 210deg, rgba(251, 113, 133, 0.34) 238deg, transparent 268deg, transparent 360deg);
  mask-image: radial-gradient(circle, transparent 0 62%, #000 64%, #000 67%, transparent 69%);
  -webkit-mask-image: radial-gradient(circle, transparent 0 62%, #000 64%, #000 67%, transparent 69%);
  animation: openingRingRotate 6.4s linear infinite;
}

#loading-screen .loading-text {
  color: #f8fbff;
  font-size: 24px;
  font-weight: 850;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  background: linear-gradient(110deg, #ffffff 0%, #c7f9ff 38%, #d9d5ff 64%, #ffd1da 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 14px 34px rgba(2, 6, 23, 0.42));
}

#loading-screen .loading-subtitle {
  margin-top: 10px !important;
  color: #c2d0e2 !important;
  font-size: 15px !important;
}

#loading-screen .loading-bar {
  width: min(280px, 56vw);
  height: 4px;
  margin-top: 28px;
  border: 1px solid rgba(186, 230, 253, 0.16);
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 20px rgba(94, 234, 212, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#loading-screen .loading-bar::after {
  width: 48%;
  background: linear-gradient(90deg, transparent 0%, #5eead4 22%, #f8d07a 52%, #fb7185 82%, transparent 100%);
  box-shadow:
    0 0 18px rgba(94, 234, 212, 0.48),
    0 0 18px rgba(251, 113, 133, 0.28);
  animation: loadingSlide 1.25s ease-in-out infinite;
}

@keyframes openingQuietSweep {
  0%, 100% {
    background-position: 0 0, 0 0, -80% 50%;
  }
  50% {
    background-position: 23px 23px, 23px 23px, 180% 50%;
  }
}

@keyframes openingRingBreath {
  0%, 100% {
    opacity: 0.42;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.68;
    transform: scale(1.02);
  }
}

@keyframes openingHeartBeat {
  0%, 100% { transform: translateY(0) scale(1); }
  18% { transform: translateY(-2px) scale(1.055); }
  34% { transform: translateY(0) scale(1); }
  52% { transform: translateY(-1px) scale(1.025); }
  68% { transform: translateY(0) scale(1); }
}

@keyframes openingFramePulse {
  0%, 100% {
    opacity: 0.64;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1.025);
  }
}

@keyframes openingRingRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  #loading-screen .heart-icon {
    width: 96px;
    height: 96px;
    font-size: 50px;
  }

  #loading-screen .loading-text {
    font-size: 22px;
  }
}

/* ----------------------------------------------------------
   19. TOOLTIPS
   ---------------------------------------------------------- */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 50;
}

.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ----------------------------------------------------------
   20. RESPONSIVE DESIGN
   ---------------------------------------------------------- */

/* Tablet: < 1024px */
@media (max-width: 1024px) {
  #content-area {
    padding-top: 126px;
  }

  #nav-bar .nav-brand {
    flex-basis: 100%;
    min-width: 0;
    margin-right: 0;
    padding-right: 0;
    white-space: nowrap;
  }

  #nav-bar .brand-copy {
    font-size: 14px;
  }

  #nav-bar .nav-brand::after {
    content: none;
  }

  .section {
    padding: var(--space-xl) var(--space-lg);
  }

  #section-overview .overview-layout {
    grid-template-columns: 1fr;
  }

  #section-heart .heart-layout {
    grid-template-columns: 1fr;
  }

  #section-heart .heart-info {
    padding: var(--space-xl);
  }

  #section-heart .facts-grid {
    grid-template-columns: 1fr 1fr;
  }

  #section-vessels .vessels-grid {
    grid-template-columns: 1fr 1fr;
  }

  #section-vessels .vessels-grid .vessel-card:last-child {
    grid-column: span 2;
    max-width: 50%;
    justify-self: center;
  }

  #section-circulation .circulation-layout {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }

  #section-blood .blood-layout {
    grid-template-columns: auto 1fr;
  }
}

/* Mobile: < 768px */
@media (max-width: 768px) {
  :root {
    font-size: 15px;
  }

  #nav-bar {
    padding: var(--space-sm) var(--space-md);
  }

  #nav-bar .nav-brand {
    display: flex;
    white-space: nowrap;
  }

  #nav-bar .brand-copy {
    font-size: 12px;
  }


  #content-area {
    padding-top: 128px;
  }

  .section {
    padding: var(--space-lg) var(--space-md);
  }

  #section-overview .overview-layout {
    grid-template-columns: 1fr;
  }

  #section-overview .body-svg-container {
    min-height: 350px;
  }

  #section-overview .body-svg-container svg {
    height: 520px;
    min-height: 420px;
  }

  #section-overview .circulation-stage {
    width: 100%;
    aspect-ratio: 1148 / 1068;
    height: auto;
    min-height: 0;
  }

  #section-overview .overview-teaching-panel {
    padding: 12px;
  }

  #section-overview .overview-stepper,
  #section-overview .overview-control-row,
  #section-overview .overview-legend {
    justify-content: flex-start;
  }

  #section-heart .heart-layout {
    grid-template-columns: 1fr;
  }

  #section-heart .heart-info {
    padding: var(--space-lg);
  }

  #section-heart .facts-grid {
    grid-template-columns: 1fr;
  }

  #section-vessels .vessels-grid {
    grid-template-columns: 1fr;
  }

  #section-vessels .vessels-grid .vessel-card:last-child {
    grid-column: auto;
    max-width: none;
  }

  #section-blood .blood-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  #section-blood .blood-cards {
    grid-template-columns: 1fr;
  }

  #section-circulation .circulation-layout {
    grid-template-columns: 1fr;
  }

  #section-circulation .flow-node {
    width: 90px;
    height: 90px;
    font-size: 12px;
  }

  #section-quiz .quiz-option {
    padding: var(--space-md) var(--space-lg);
    font-size: 14px;
  }
}

/* Small mobile: < 480px */
@media (max-width: 480px) {
  #welcome-screen .welcome-content {
    padding: var(--space-md);
  }

  #welcome-screen .welcome-icon {
    font-size: 56px;
  }

  #welcome-screen .welcome-btn {
    padding: 12px 28px;
    font-size: 15px;
  }

  .section-title {
    font-size: 22px;
  }

  #nav-bar .nav-btn {
    padding: 6px 14px;
    font-size: 13px;
  }
}

/* ----------------------------------------------------------
   21. PRINT STYLES (hidden interactive chrome)
   ---------------------------------------------------------- */
@media print {
  #loading-screen,
  #welcome-screen,
  #nav-bar {
    display: none !important;
  }

  body {
    background: #fff;
    color: #222;
  }

  .glass-card,
  .section {
    backdrop-filter: none;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: none;
    color: #222;
  }
}

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