/* ============================================================
   RADIOGRAPHY 101 — Global Design System
   Dark Medical/Tech Theme
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary:    #080c18;
  --bg-secondary:  #0d1225;
  --bg-card:       #121a30;
  --bg-card-hover: #182040;
  --accent-teal:   #00d4ff;
  --accent-cyan:   #00b4d8;
  --accent-green:  #00e5a0;
  --accent-purple: #7c4dff;
  --accent-orange: #ff6b35;
  --accent-gold:   #ffd700;
  --accent-red:    #ff4757;
  --text-primary:  #e8edf6;
  --text-secondary:#8892b0;
  --text-muted:    #4a5568;
  --border:        rgba(0, 212, 255, 0.15);
  --border-hover:  rgba(0, 212, 255, 0.4);
  --glow-teal:     0 0 20px rgba(0, 212, 255, 0.25);
  --glow-strong:   0 0 40px rgba(0, 212, 255, 0.4);
  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main:     'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;
}

/* Modality accent colors */
.mod-xray       { --mod-color: #00d4ff; --mod-glow: rgba(0,212,255,0.3); }
.mod-ultrasound { --mod-color: #00e5a0; --mod-glow: rgba(0,229,160,0.3); }
.mod-mri        { --mod-color: #7c4dff; --mod-glow: rgba(124,77,255,0.3); }
.mod-ct         { --mod-color: #ff6b35; --mod-glow: rgba(255,107,53,0.3); }
.mod-nuclear    { --mod-color: #ffd700; --mod-glow: rgba(255,215,0,0.3); }
.mod-radiotherapy { --mod-color: #ff4757; --mod-glow: rgba(255,71,87,0.3); }
.mod-history    { --mod-color: #a0c4ff; --mod-glow: rgba(160,196,255,0.3); }

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent-teal); text-decoration: none; transition: var(--transition); }
a:hover { color: #fff; }

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

body.r101-presentation-active {
  overflow: hidden;
}

.r101-present-trigger,
.r101-present-nav button {
  font-family: var(--font-main);
}

.r101-present-trigger {
  position: fixed;
  right: 24px;
  bottom: 106px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  background: rgba(8, 12, 24, 0.88);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42), 0 0 24px var(--mod-glow, rgba(0, 212, 255, 0.22));
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: var(--transition);
}

.r101-present-trigger:hover,
.r101-present-trigger:focus-visible {
  transform: translateY(-2px);
  border-color: var(--mod-color, var(--accent-teal));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5), 0 0 32px var(--mod-glow, rgba(0, 212, 255, 0.32));
}

.r101-present-trigger__icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--mod-color, var(--accent-teal)), var(--accent-purple));
  color: #06101c;
  font-size: 0.74rem;
  line-height: 1;
}

.r101-present-trigger[hidden],
.r101-present-nav[hidden],
.r101-present-progress[hidden] {
  display: none !important;
}

.r101-presentation-active .navbar,
.r101-presentation-active .site-footer,
.r101-presentation-active .r101-support-btn,
.r101-presentation-active .r101-present-trigger,
.r101-presentation-active .r101-amazon-section {
  display: none !important;
}

.r101-present-slide-source {
  scroll-margin-top: 84px;
}

.r101-presentation-active .r101-present-slide-source {
  display: none !important;
}

.r101-presentation-active .r101-present-slide-source.r101-present-current {
  position: fixed !important;
  inset: 0;
  z-index: 10000;
  display: block !important;
  min-height: 100vh;
  width: 100vw;
  padding: clamp(56px, 6vh, 80px) clamp(96px, 10vw, 148px) clamp(42px, 5vh, 72px) clamp(18px, 5vw, 72px);
  overflow-y: auto;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--mod-glow, rgba(0, 212, 255, 0.16)) 0%, transparent 62%),
    radial-gradient(ellipse 55% 45% at 88% 82%, rgba(124, 77, 255, 0.14) 0%, transparent 62%),
    linear-gradient(135deg, #070b16 0%, #0c1326 55%, #070b16 100%);
  border: 0;
  transform-origin: center;
  animation: r101-slide-forward 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-present-direction="backward"] .r101-present-slide-source.r101-present-current {
  animation-name: r101-slide-backward;
}

.r101-presentation-active .r101-present-slide-source.r101-present-current::after {
  content: '';
  position: fixed;
  inset: 22px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.08), 0 24px 90px rgba(0, 0, 0, 0.45);
}

.r101-presentation-active .r101-present-slide-source.r101-present-current > .container {
  max-width: min(1180px, 100%);
  min-height: calc(100vh - 128px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.r101-presentation-active .r101-present-slide-source.r101-present-current .page-hero-bg {
  display: none;
}

.r101-presentation-active .tab-panel.r101-present-current {
  max-width: min(1180px, 100vw);
  margin: 0 auto;
}

.r101-presentation-active .r101-present-slide-source.r101-present-current .section-title,
.r101-presentation-active .r101-present-slide-source.r101-present-current h1 {
  font-size: clamp(2rem, 5vw, 4.4rem);
}

.r101-presentation-active .r101-present-slide-source.r101-present-current .section-subtitle,
.r101-presentation-active .r101-present-slide-source.r101-present-current .page-hero p {
  font-size: clamp(1rem, 1.7vw, 1.24rem);
}

.r101-presentation-active .r101-present-slide-source.r101-present-current h1,
.r101-presentation-active .r101-present-slide-source.r101-present-current .section-title,
.r101-presentation-active .r101-present-slide-source.r101-present-current .page-hero-label,
.r101-presentation-active .r101-present-slide-source.r101-present-current .section-label,
.r101-presentation-active .r101-present-slide-source.r101-present-current .section-subtitle,
.r101-presentation-active .r101-present-slide-source.r101-present-current .topic-grid,
.r101-presentation-active .r101-present-slide-source.r101-present-current .stats-row,
.r101-presentation-active .r101-present-slide-source.r101-present-current .card,
.r101-presentation-active .r101-present-slide-source.r101-present-current .diagram-box {
  animation: r101-content-lift 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.r101-presentation-active .r101-present-slide-source.r101-present-current .section-title,
.r101-presentation-active .r101-present-slide-source.r101-present-current h1 {
  animation-delay: 50ms;
}

.r101-presentation-active .r101-present-slide-source.r101-present-current .section-subtitle,
.r101-presentation-active .r101-present-slide-source.r101-present-current .page-hero p,
.r101-presentation-active .r101-present-slide-source.r101-present-current .topic-grid,
.r101-presentation-active .r101-present-slide-source.r101-present-current .stats-row {
  animation-delay: 110ms;
}

.r101-presentation-active .r101-present-slide-source.r101-present-current .card,
.r101-presentation-active .r101-present-slide-source.r101-present-current .diagram-box {
  animation-delay: 160ms;
}

.r101-presentation-active .reveal {
  opacity: 1 !important;
  transform: none !important;
}

.r101-present-progress {
  --present-progress: 0%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10030;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.r101-present-progress span {
  display: block;
  width: var(--present-progress);
  height: 100%;
  background: linear-gradient(90deg, var(--mod-color, var(--accent-teal)), var(--accent-purple));
  box-shadow: 0 0 18px var(--mod-glow, rgba(0, 212, 255, 0.35));
  transition: width 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.r101-present-nav {
  position: fixed;
  right: 24px;
  top: 50%;
  z-index: 10020;
  width: 62px;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(8, 12, 24, 0.86);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
}

.r101-present-nav button {
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.r101-present-nav button:hover,
.r101-present-nav button:focus-visible {
  border-color: var(--mod-color, var(--accent-teal));
  background: rgba(0, 212, 255, 0.12);
}

.r101-present-counter {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  writing-mode: horizontal-tb;
  text-align: center;
}

.r101-present-dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.r101-present-dot {
  width: 8px;
  height: 8px;
  min-width: 8px !important;
  padding: 0;
  border: 0 !important;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24) !important;
}

.r101-present-dot.is-active {
  height: 28px;
  background: var(--mod-color, var(--accent-teal)) !important;
  box-shadow: 0 0 16px var(--mod-glow, rgba(0, 212, 255, 0.34));
}

@keyframes r101-slide-forward {
  from {
    opacity: 0;
    transform: translateX(42px) scale(0.985);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

@keyframes r101-slide-backward {
  from {
    opacity: 0;
    transform: translateX(-42px) scale(0.985);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

@keyframes r101-content-lift {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(8, 12, 24, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-purple));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  box-shadow: var(--glow-teal);
}

.nav-logo span { color: var(--accent-teal); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1.5;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.1);
}

.nav-links a.active {
  color: var(--accent-teal);
  border: 1px solid var(--border);
}

.nav-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mod-color, var(--accent-teal));
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--mod-color, var(--accent-teal));
  margin-top: 0;
}

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.page-wrapper {
  padding-top: 64px;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 5rem 0;
}

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

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 2rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0,212,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(124,77,255,0.08) 0%, transparent 50%),
    var(--bg-primary);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 1rem;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-teal);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-badge::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent-teal);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-teal);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

/* Page hero (inner pages) */
.page-hero {
  position: relative;
  padding: 5rem 2rem 3rem;
  overflow: hidden;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 10% 50%, var(--mod-glow, rgba(0,212,255,0.1)) 0%, transparent 60%);
}

.page-hero .container { position: relative; z-index: 2; }

.page-hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mod-color, var(--accent-teal));
  margin-bottom: 1rem;
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.page-hero h1 span {
  color: var(--mod-color, var(--accent-teal));
}

.page-hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.8;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  color: var(--bg-primary);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.45);
  color: var(--bg-primary);
}

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

.btn-outline:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.modality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.modality-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.3s ease,
    box-shadow 0.4s ease,
    background 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.modality-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--mod-color), transparent);
}

.modality-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 0% 0%, var(--mod-glow) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition);
}

.modality-card:hover {
  border-color: var(--mod-color);
  transform: translateY(-4px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5), 0 0 30px var(--mod-glow);
  color: inherit;
}

.modality-card:hover::after { opacity: 1; }

.mod-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 20px var(--mod-glow);
}

.modality-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.modality-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.mod-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 1rem;
  padding: 0.25rem 0.75rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--mod-color);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mod-color);
  position: relative;
  z-index: 1;
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mod-color, var(--accent-teal));
  margin-bottom: 0.75rem;
}

.section-label::before {
  content: '';
  width: 16px; height: 2px;
  background: var(--mod-color, var(--accent-teal));
  border-radius: 2px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.75;
  margin-bottom: 3rem;
}

/* ============================================================
   TOPIC SECTIONS (inner pages)
   ============================================================ */
.topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

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

@media (max-width: 720px) {
  .r101-present-trigger {
    right: 16px;
    bottom: 74px;
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.72rem;
  }

  .r101-present-trigger__icon {
    width: 20px;
    height: 20px;
  }

  .r101-presentation-active .r101-present-slide-source.r101-present-current {
    inset: 0 0 calc(112px + env(safe-area-inset-bottom, 0px)) 0;
    min-height: auto;
    padding: 52px 16px 24px;
  }

  .r101-presentation-active .r101-present-slide-source.r101-present-current::after {
    inset: 10px 10px calc(122px + env(safe-area-inset-bottom, 0px)) 10px;
    border-radius: 12px;
  }

  .r101-presentation-active .r101-present-slide-source.r101-present-current > .container {
    min-height: calc(100dvh - 188px - env(safe-area-inset-bottom, 0px));
    padding: 0;
  }

  .r101-present-nav {
    right: auto;
    top: auto;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: min(760px, calc(100vw - 28px));
    transform: translateX(-50%);
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-rows: auto;
    gap: 8px;
    padding: 8px;
    border-radius: 22px;
  }

  .r101-present-prev { grid-column: 1; grid-row: 1; }
  .r101-present-counter { grid-column: 2; grid-row: 1; }
  .r101-present-next { grid-column: 3; grid-row: 1; }
  .r101-present-close { grid-column: 4; grid-row: 1; }

  .r101-present-fullscreen {
    display: none;
  }

  .r101-present-counter {
    flex-direction: row;
    gap: 7px;
    font-size: 0.68rem;
  }

  .r101-present-dots {
    flex-direction: row;
    max-width: 150px;
    overflow: hidden;
  }

  .r101-present-dot.is-active {
    width: 28px;
    height: 8px;
  }

  .r101-presentation-active .r101-present-slide-source.r101-present-current {
    animation-duration: 300ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .r101-presentation-active .r101-present-slide-source.r101-present-current,
  .r101-presentation-active .r101-present-slide-source.r101-present-current h1,
  .r101-presentation-active .r101-present-slide-source.r101-present-current .section-title,
  .r101-presentation-active .r101-present-slide-source.r101-present-current .page-hero-label,
  .r101-presentation-active .r101-present-slide-source.r101-present-current .section-label,
  .r101-presentation-active .r101-present-slide-source.r101-present-current .section-subtitle,
  .r101-presentation-active .r101-present-slide-source.r101-present-current .topic-grid,
  .r101-presentation-active .r101-present-slide-source.r101-present-current .stats-row,
  .r101-presentation-active .r101-present-slide-source.r101-present-current .card,
  .r101-presentation-active .r101-present-slide-source.r101-present-current .diagram-box {
    animation: none !important;
    filter: none !important;
    transform: none !important;
  }

  .r101-present-progress span,
  .r101-present-dot,
  .r101-present-trigger,
  .r101-present-nav button {
    transition: none !important;
  }
}

.topic-text h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.topic-text h2 span { color: var(--mod-color, var(--accent-teal)); }

.topic-text p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.key-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.key-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.key-points li::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--mod-color, var(--accent-teal));
  box-shadow: 0 0 8px var(--mod-color, var(--accent-teal));
  flex-shrink: 0;
  margin-top: 7px;
}

/* ============================================================
   INTERACTIVE DIAGRAM CONTAINER
   ============================================================ */
.diagram-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.diagram-box svg {
  width: 100%;
  height: auto;
  display: block;
}

.radiation-mechanism-panel {
  padding: 1rem;
}

.radiation-mechanism-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: calc(var(--radius-lg) - 4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.radiobiology-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.radiobiology-card {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  overflow: hidden;
}

.radiobiology-card-image {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: #02050a;
  border-bottom: 1px solid var(--border);
}

.radiobiology-card-body {
  padding: 1.25rem;
}

.radiobiology-card-kicker {
  margin-bottom: 0.35rem;
  color: var(--mod-color);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.radiobiology-card h3 {
  margin-bottom: 0.65rem;
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.3;
}

.radiobiology-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.65;
}

.radiobiology-card-takeaway {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary) !important;
  font-weight: 650;
}

.linac-components-panel {
  padding: 1rem;
}

.linac-layout {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  max-width: 1120px;
  margin: 0 auto;
}

.linac-image-card {
  width: 100%;
  padding: 1.25rem;
  text-align: center;
}

.linac-image-card .diagram-title {
  justify-content: center;
  margin-bottom: 0.55rem;
}

.linac-image-card p {
  max-width: 720px;
  margin: 0 auto 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.linac-image-scroll {
  overflow-x: auto;
  border-radius: calc(var(--radius-lg) - 4px);
  scrollbar-color: var(--mod-color) rgba(255, 255, 255, 0.08);
}

.linac-components-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: calc(var(--radius-lg) - 4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.linac-info-card {
  width: 100%;
  max-width: 900px;
  text-align: left;
}

.linac-info-card h2 {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
}

.linac-info-card h2 span {
  color: var(--mod-color);
}

.linac-info-intro {
  max-width: 760px;
  margin: 0 auto 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
  text-align: center;
}

body[data-active-rt-tab="linac"] .r101-present-trigger,
body[data-active-rt-tab="linac"] .r101-support-btn {
  opacity: 0.22;
}

body[data-active-rt-tab="linac"] .r101-present-trigger:hover,
body[data-active-rt-tab="linac"] .r101-present-trigger:focus-visible,
body[data-active-rt-tab="linac"] .r101-support-btn:hover,
body[data-active-rt-tab="linac"] .r101-support-btn:focus-visible {
  opacity: 1;
}

.diagram-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.diagram-title::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--mod-color, var(--accent-teal));
  box-shadow: 0 0 10px var(--mod-color, var(--accent-teal));
}

/* Tooltip for diagrams */
.svg-tooltip {
  position: absolute;
  background: var(--bg-primary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
  max-width: 200px;
  line-height: 1.5;
  box-shadow: var(--glow-teal);
}

.svg-tooltip.visible { opacity: 1; }

/* ============================================================
   STAT / FACT CARDS
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--mod-color, var(--accent-teal));
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 0.6rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font-main);
}

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

.tab-btn.active {
  color: var(--mod-color, var(--accent-teal));
  border-bottom-color: var(--mod-color, var(--accent-teal));
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   INFO CALLOUTS
   ============================================================ */
.callout {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-teal);
  background: rgba(0, 212, 255, 0.05);
  margin: 1.5rem 0;
}

.callout-icon { font-size: 1.25rem; flex-shrink: 0; }

.callout p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.callout.warning {
  border-left-color: var(--accent-gold);
  background: rgba(255, 215, 0, 0.05);
}

.callout.danger {
  border-left-color: var(--accent-red);
  background: rgba(255, 71, 87, 0.05);
}

.callout.success {
  border-left-color: var(--accent-green);
  background: rgba(0, 229, 160, 0.05);
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

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

.breadcrumb a:hover { color: var(--accent-teal); }

.breadcrumb-sep { color: var(--text-muted); opacity: 0.4; }

.article-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  margin: 0 0 1.25rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 212, 255, 0.06);
  color: var(--accent-teal);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.article-back-link:hover,
.article-back-link:focus-visible {
  border-color: var(--border-hover);
  background: rgba(0, 212, 255, 0.12);
  color: #fff;
  transform: translateY(-1px);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  margin-top: 6rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.footer-logo span { color: var(--accent-teal); }

.footer-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
}

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

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

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

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px var(--mod-glow, rgba(0,212,255,0.2)); }
  50%       { box-shadow: 0 0 40px var(--mod-glow, rgba(0,212,255,0.4)); }
}

@keyframes scan-line {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

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

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes beam-travel {
  0%   { stroke-dashoffset: 200; opacity: 0.3; }
  50%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0.3; }
}

@keyframes wave-pulse {
  0%,100% { r: 0; opacity: 1; }
  100%    { r: 40; opacity: 0; }
}

.animate-in {
  animation: fade-in-up 0.6s ease forwards;
}

/* Stagger delays */
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }

/* ============================================================
   SCROLL OBSERVER — fade in on scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.text-teal    { color: var(--accent-teal); }
.text-green   { color: var(--accent-green); }
.text-purple  { color: var(--accent-purple); }
.text-orange  { color: var(--accent-orange); }
.text-gold    { color: var(--accent-gold); }
.text-red     { color: var(--accent-red); }
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.text-sm  { font-size: 0.875rem; }
.text-xs  { font-size: 0.78rem; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }

/* ============================================================
   COMPARISON TABLE
   ============================================================ */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.compare-table th,
.compare-table td {
  padding: 0.9rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.compare-table th {
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-card);
}

.compare-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

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

.compare-table tr:hover td {
  background: rgba(0, 212, 255, 0.03);
}

/* ===== Anime.js Animation Helpers ===== */
.anim-hidden {
  opacity: 0;
  transform: translateY(30px);
}

.anim-hidden-left {
  opacity: 0;
  transform: translateX(-30px);
}

.anim-hidden-right {
  opacity: 0;
  transform: translateX(30px);
}

.anim-hidden-scale {
  opacity: 0;
  transform: scale(0.9);
}

.hero .animate-in {
  opacity: 0;
  transform: translateY(40px);
  animation: none;
}

.navbar.nav-scrolled {
  backdrop-filter: blur(16px);
  background: rgba(8, 12, 24, 0.92);
  box-shadow: 0 1px 0 var(--border);
}

/* ============================================================
   NAV DROPDOWN
   ============================================================ */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-main);
  line-height: 1.5;
  text-decoration: none;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle.active {
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.1);
}

.nav-dropdown-icon {
  font-size: 0.55rem;
  transition: transform 0.2s ease;
  display: inline-block;
  margin-top: 1px;
}

.nav-dropdown.open .nav-dropdown-icon {
  transform: rotate(180deg);
}

/* Hover support for desktop dropdown */
@media (hover: hover) and (pointer: fine) {
  .nav-dropdown:hover .nav-dropdown-menu {
    display: block;
  }
  .nav-dropdown:hover .nav-dropdown-icon {
    transform: rotate(180deg);
  }
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: rgba(12, 18, 34, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  display: none;
  z-index: 1001;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.5;
}

.nav-dropdown-menu a:hover {
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.1);
}

.nav-dropdown-menu .nav-dot {
  flex-shrink: 0;
}

/* ============================================================
   NAV ARTICLE HIGHLIGHT
   ============================================================ */
.nav-article-link a {
  background: rgba(0, 212, 255, 0.12) !important;
  border: 1px solid rgba(0, 212, 255, 0.3) !important;
  color: var(--accent-teal) !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm) !important;
}

.nav-article-link a:hover {
  background: rgba(0, 212, 255, 0.2) !important;
  border-color: var(--accent-teal) !important;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.12) !important;
}

/* ============================================================
   HOME PAGE ARTICLES SECTION
   ============================================================ */
.home-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.home-article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.home-article-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-purple));
  opacity: 0.5;
  transition: var(--transition);
}

.home-article-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
}

.home-article-card:hover::before {
  opacity: 1;
  height: 3px;
}

.home-article-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-teal);
  margin-bottom: 0.5rem;
}

.home-article-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.35;
  color: var(--text-primary);
}

.home-article-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

.home-article-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-weight: 500;
}

.home-articles-cta {
  text-align: center;
  padding: 1.5rem 0;
}

.home-articles-cta .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav-links {
    display: none !important;
  }
  .nav-links.open {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 64px; left: 0; right: 0;
    bottom: auto;
    background: rgba(8, 12, 24, 0.98);
    backdrop-filter: blur(20px);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0.25rem;
    z-index: 999;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .nav-links.open li {
    width: 100%;
  }

  .nav-links.open li > a,
  .nav-links.open .nav-dropdown-toggle {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-dropdown {
    width: 100%;
    position: static;
  }

  .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
  }

  .nav-dropdown-menu {
    position: static !important;
    display: none !important;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 0 1rem;
    border-radius: 0;
    min-width: unset;
    z-index: auto;
  }

  .nav-links:not(.open) .nav-dropdown-menu {
    display: none !important;
    visibility: hidden !important;
  }

  .nav-dropdown.open .nav-dropdown-menu {
    display: block !important;
  }

  .nav-dropdown-menu a {
    display: flex !important;
    padding: 0.5rem 0.75rem;
    width: 100%;
  }

  .nav-toggle {
    display: flex !important;
    z-index: 1001;
  }

  .modality-grid { grid-template-columns: 1fr; }
  .radiobiology-card-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .container { padding: 0 1rem; }
  .section { padding: 3rem 0; }
  .hero { padding: 0 1rem; }
  .hero h1 { font-size: 2rem; }
  .page-hero { padding: 4rem 1rem 2rem; }
  .radiobiology-card-body { padding: 1rem; }
  .radiobiology-card-image { aspect-ratio: 4 / 3; }
  .linac-components-image {
    min-width: 720px;
  }
}
