/* ════════════════════════════════════════════════════════
   DFA Landing Page — Dual-Reality Theme System
   ════════════════════════════════════════════════════════ */

/* ── Shared Design Tokens ─────────────────────────────── */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Outfit", var(--font-sans);
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

/* ═══════════════════════════════════════════════
   THEME 1: PATIENT EMPATHY (warm, calming, soft)
   ═══════════════════════════════════════════════ */
[data-theme="empathy"] {
  --bg-base: #0d1117;
  --bg-gradient: radial-gradient(ellipse at top, #1a1f3a 0%, #0d1117 60%);
  --bg-panel: rgba(25, 30, 55, 0.55);
  --border: rgba(168, 139, 250, 0.12);
  --border-glow: rgba(168, 139, 250, 0.4);
  --text-primary: #f1f5f9;
  --text-secondary: #a5b4c8;
  --text-muted: #6b7a8d;
  --accent: #a78bfa;
  --accent-glow: #c4b5fd;
  --hero-gradient: linear-gradient(
    135deg,
    #a78bfa 0%,
    #f472b6 50%,
    #fbbf24 100%
  );
  --section-glow: rgba(167, 139, 250, 0.04);
  --font-body: var(--font-sans);
  --font-heading: var(--font-display);
  --heading-weight: 700;
  --letter-spacing: -0.01em;
  --hero-title-size: 4.5rem;
}

/* ═══════════════════════════════════════════════
   THEME 2: CLINICAL SUPREMACY (cold, sharp, CAD)
   ═══════════════════════════════════════════════ */
[data-theme="clinical"] {
  --bg-base: #030508;
  --bg-gradient: radial-gradient(ellipse at top, #0a1628 0%, #020304 60%);
  --bg-panel: rgba(8, 16, 32, 0.7);
  --border: rgba(34, 211, 238, 0.12);
  --border-glow: rgba(34, 211, 238, 0.5);
  --text-primary: #e2e8f0;
  --text-secondary: #78909c;
  --text-muted: #546e7a;
  --accent: #22d3ee;
  --accent-glow: #67e8f9;
  --hero-gradient: linear-gradient(
    135deg,
    #22d3ee 0%,
    #06b6d4 50%,
    #0ea5e9 100%
  );
  --section-glow: rgba(34, 211, 238, 0.03);
  --font-body: var(--font-mono);
  --font-heading: var(--font-mono);
  --heading-weight: 600;
  --letter-spacing: 0.02em;
  --hero-title-size: 3.8rem;
}

/* ═══════════════════════════════════════════════
   VIEW TRANSITION MORPH ANIMATION
   ═══════════════════════════════════════════════ */
::view-transition-old(root) {
  animation: morphOut 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
::view-transition-new(root) {
  animation: morphIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes morphOut {
  0% {
    opacity: 1;
    filter: blur(0) saturate(1);
    transform: scale(1);
  }
  100% {
    opacity: 0;
    filter: blur(12px) saturate(0.3);
    transform: scale(0.98);
  }
}
@keyframes morphIn {
  0% {
    opacity: 0;
    filter: blur(12px) saturate(0.3);
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    filter: blur(0) saturate(1);
    transform: scale(1);
  }
}

/* Fallback for browsers without View Transitions */
body {
  transition:
    background-color 0.6s ease,
    color 0.6s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ────────────────────────────────────── */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
}

.center {
  text-align: center;
  margin-inline: auto;
}

/* ── Layout & Utils ────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 8rem 0;
  position: relative;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

/* ── Glassmorphism ─────────────────────────────────── */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  background: var(--accent-glow);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.glow-btn {
  position: relative;
  overflow: hidden;
}
.glow-btn::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.glow-btn:hover::after {
  opacity: 1;
  animation: rotateGlow 3s linear infinite;
}
@keyframes rotateGlow {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ── Navigation ────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.5rem;
  z-index: 100;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  border-radius: 100px;
  gap: 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.1rem;
  font-family: var(--font-display);
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-icon {
  color: var(--accent);
}

/* Reality switch — compact pill */
.reality-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.82rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a.nav-app-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border-glow);
  border-radius: 999px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 18%, transparent);
}

.nav-links a.nav-app-link:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--text-primary);
}

/* Nav CTA button area */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-actions .btn {
  padding: 0.5rem 1.1rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

/* Hamburger button — hidden on desktop */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border: none;
  background: transparent;
  flex-shrink: 0;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Responsive Breakpoints ─────────────────── */

/* Tablet: hide nav links, show hamburger */
@media (max-width: 960px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 80px;
    left: 1rem;
    right: 1rem;
    background: var(--bg-panel);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem;
    gap: 0.5rem;
    z-index: 99;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    font-size: 0.95rem;
    padding: 0.5rem 0;
    width: 100%;
    border-bottom: 1px solid var(--border);
  }
  .nav-links a:last-child {
    border-bottom: none;
  }
  .nav-links a.nav-app-link {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.72rem 1rem;
    border-bottom: 1px solid var(--border-glow);
  }
  .nav-hamburger {
    display: flex;
  }
  .nav-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-hamburger.open span:nth-child(2) {
    opacity: 0;
  }
  .nav-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .reality-label {
    font-size: 0.75rem;
  }
}

/* Small mobile */
@media (max-width: 600px) {
  .navbar {
    padding: 0.75rem 1rem;
  }
  .nav-container {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
  }
  .logo-text {
    display: none;
  }
  .reality-label.reality-active {
    display: none;
  }
  .nav-actions .btn-secondary {
    display: none;
  }
}

/* ── Hero Section ──────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
  mix-blend-mode: screen;
}

.hero-gradient-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    transparent 0%,
    var(--bg-base) 80%
  );
}

.hero-content {
  text-align: center;
  max-width: 800px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-glow);
  margin-bottom: 2rem;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-glow);
  box-shadow: 0 0 8px var(--accent-glow);
}

.pulse-anim {
  animation: pulseOpacity 2s infinite ease-in-out;
}

@keyframes pulseOpacity {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.35rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  max-width: 700px;
}

.hero-cta-group {
  display: flex;
  gap: 1rem;
}

/* ── Problem vs Solution ───────────────────────────── */
.glass-card {
  padding: 3rem;
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  transition:
    transform 0.4s,
    border-color 0.4s;
}

.glass-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-glow);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.problem-card .card-icon {
  color: var(--danger);
  opacity: 0.8;
  filter: grayscale(1);
}
.solution-card .card-icon {
  color: var(--success);
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* ── Bento Grid ────────────────────────────────────── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(280px, auto);
  gap: 1.5rem;
  margin-top: 4rem;
}

.bento-item {
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.4s,
    box-shadow 0.4s;
}

.bento-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.15);
}

.bento-large {
  grid-column: span 2;
  grid-row: span 2;
}
.bento-wide {
  grid-column: span 2;
}
.bento-tall {
  grid-row: span 2;
}

.bento-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.05);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.bento-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.bento-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ── Temporary Visuals inside Bento ────────────────── */
.bento-visual {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  justify-content: center;
  opacity: 0.6;
}

/* ── AI Engine Section ─────────────────────────────── */
.ai-section {
  background: linear-gradient(
    0deg,
    var(--bg-base) 0%,
    rgba(59, 130, 246, 0.03) 50%,
    var(--bg-base) 100%
  );
}

.ai-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 4rem;
  border-radius: var(--radius-lg);
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: inset 0 0 80px rgba(59, 130, 246, 0.05);
}

.ai-badge {
  border-color: var(--success);
  color: var(--success);
  margin-bottom: 1rem;
}
.ai-dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.ai-features {
  list-style: none;
  margin-top: 2rem;
}
.ai-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  color: var(--text-secondary);
}
.check {
  color: var(--success);
  font-weight: bold;
}

.ai-visual {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.neural-core {
  width: 120px;
  height: 120px;
  background: var(--bg-panel);
  border-radius: 50%;
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
}

.core-score {
  font-size: 2.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: pulseOut 3s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  z-index: -1;
}

.pulse-ring.delay-1 {
  animation-delay: 1s;
}
.pulse-ring.delay-2 {
  animation-delay: 2s;
}

@keyframes pulseOut {
  0% {
    transform: scale(1);
    opacity: 0.8;
    border-width: 2px;
  }
  100% {
    transform: scale(3);
    opacity: 0;
    border-width: 1px;
  }
}

/* ── Footer ────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  text-align: center;
}
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* ── Animations (Intersection Observer) ────────────── */
.blur-fade-up {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  filter: blur(10px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.blur-fade-up.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .ai-container {
    grid-template-columns: 1fr;
    padding: 2rem;
  }
  .nav-links {
    display: none;
  }
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .bento-large,
  .bento-wide,
  .bento-tall {
    grid-column: span 1;
    grid-row: span 1;
  }
}

/* ── Dual-Reality Toggle Switch ─────────────────────── */
.reality-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
.reality-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: 100px;
  background: var(--accent);
  box-shadow: 0 2px 12px color-mix(in srgb, var(--accent) 50%, transparent);
  transition:
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.4s;
  z-index: 0;
}
[data-theme="clinical"] .reality-switch::before {
  transform: translateX(100%);
}
.reality-label {
  position: relative;
  z-index: 1;
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.4s;
  white-space: nowrap;
  flex: 1;
  text-align: center;
}
.reality-label.reality-active {
  color: #ffffff;
}
.reality-divider {
  font-size: 0.7rem;
  color: var(--text-muted);
  z-index: 1;
  flex-shrink: 0;
}

/* ── Theme-Adaptive Typography ─────────────────────── */
[data-theme="clinical"] h1,
[data-theme="clinical"] h2,
[data-theme="clinical"] h3,
[data-theme="clinical"] h4 {
  font-family: var(--font-mono);
  letter-spacing: var(--letter-spacing);
  font-weight: var(--heading-weight);
}
[data-theme="clinical"] .hero-title {
  font-size: var(--hero-title-size);
}
[data-theme="clinical"] .section-desc,
[data-theme="clinical"] .hero-subtitle {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}
[data-theme="clinical"] .glass-panel {
  border-color: rgba(34, 211, 238, 0.15);
}
[data-theme="clinical"] .glow-btn {
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.3);
}

/* ── Theme-Adaptive Text Gradient ──────────────────── */
[data-theme="empathy"] .text-gradient {
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="clinical"] .text-gradient {
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Legacy audience-toggle hidden for backward compat */
.audience-toggle {
  display: none !important;
}
.hidden {
  display: none !important;
}

/* ── Triage AI Bot ─────────────────────────────────── */
.triage-section {
  padding-top: 4rem;
}
.triage-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border-color: rgba(16, 185, 129, 0.3);
}
.triage-header {
  background: rgba(16, 185, 129, 0.1);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
}
.triage-avatar {
  font-size: 2rem;
}
.triage-chat {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 400px;
  overflow-y: auto;
}
.chat-msg {
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  max-width: 85%;
  line-height: 1.5;
  animation: slideIn 0.3s ease-out;
}
.bot-msg {
  background: rgba(255, 255, 255, 0.05);
  border-top-left-radius: 4px;
  align-self: flex-start;
  border: 1px solid var(--border);
}
.user-msg {
  background: rgba(59, 130, 246, 0.2);
  border-top-right-radius: 4px;
  align-self: flex-end;
  color: #e0f2fe;
}
.chat-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}
.chat-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent-glow);
  padding: 0.75rem 1rem;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
  font-weight: 500;
}
.chat-btn:hover {
  background: rgba(59, 130, 246, 0.15);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Semantic Grids & EEAT ─────────────────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}
.eeat-box {
  padding: 4rem;
  border-color: rgba(255, 255, 255, 0.15);
}
.eeat-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  align-items: center;
}
.eeat-photo {
  width: 200px;
  height: 200px;
  background: var(--bg-base);
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.2);
}
.dr-avatar {
  font-size: 5rem;
}
.credentials-list {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-secondary);
}
.text-large {
  font-size: 1.15rem;
  color: #cbd5e1;
  margin-top: 1rem;
}
.text-accent {
  color: var(--accent-glow);
}
.text-success {
  color: var(--success);
}
.text-dim {
  color: var(--text-muted);
}
.text-sm {
  font-size: 0.85rem;
}

/* ── Footer Links ──────────────────────────────────── */
.footer-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}
.footer-links a:hover {
  color: var(--accent-glow);
}
.copyright {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Section Header ────────────────────────────────── */
.section-header {
  margin-bottom: 1.5rem;
}

/* ══════════════════════════════════
   STICKY TABLE OF CONTENTS
══════════════════════════════════ */
.toc-sidebar {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  z-index: 90;
  min-width: 180px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.toc-sidebar.toc-visible {
  opacity: 1;
  pointer-events: all;
}
.toc-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.toc-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  padding: 2px 0;
}
.toc-link::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}
.toc-link:hover,
.toc-link.toc-active {
  color: var(--accent-glow);
}
.toc-link.toc-active::before {
  background: var(--accent-glow);
  box-shadow: 0 0 4px var(--accent-glow);
}

/* ══════════════════════════════════
   TMJ SEVERITY QUIZ
══════════════════════════════════ */
.quiz-section {
  padding-top: 5rem;
}
.quiz-card {
  max-width: 700px;
  margin: 4rem auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.quiz-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width 0.4s ease;
  width: 0%;
}
.quiz-step-active {
  padding: 2.5rem;
}
.quiz-question-num {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.quiz-question-text {
  font-size: 1.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 2rem;
  line-height: 1.3;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.quiz-opt-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.quiz-opt-btn:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent);
  transform: translateX(4px);
}

/* Quiz Result */
.quiz-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  padding: 1rem 0;
}
.quiz-score-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--score-color, #3b82f6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px
    color-mix(in srgb, var(--score-color, #3b82f6) 40%, transparent);
}
.quiz-score-num {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-display);
  line-height: 1;
}
.quiz-score-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.quiz-result h3 {
  font-size: 1.6rem;
}
.quiz-result p {
  color: var(--text-secondary);
  max-width: 500px;
}
.quiz-result-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ══════════════════════════════════
   CSS TMJ JOINT VISUALIZER
══════════════════════════════════ */
.visualizer-section {
  padding-top: 5rem;
}
.visualizer-panel {
  padding: 3rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  border-color: rgba(16, 185, 129, 0.2);
}
.joint-visualizer {
  width: 100%;
  max-width: 600px;
}
.joint-scene {
  position: relative;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.joint-fossa {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-bottom: none;
}
.joint-disc {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  transition:
    transform 0.3s ease,
    background 0.3s ease;
  z-index: 2;
}
.joint-condyle {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 80px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 50% 50% 40% 40%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.3s ease;
  z-index: 1;
}
.joint-label {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-secondary);
  z-index: 5;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: 100px;
}
.visualizer-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}
.viz-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.viz-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 100px;
  background: linear-gradient(
    90deg,
    var(--success),
    var(--warning),
    var(--danger)
  );
  cursor: pointer;
}
.viz-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: grab;
}
.viz-description {
  margin-top: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-align: center;
  min-height: 4rem;
  transition: var(--transition);
}
.viz-share {
  text-align: center;
}
.share-btn {
  font-size: 0.9rem;
}

/* ══════════════════════════════════
   STATISTICS / CLICK-TO-SHARE
══════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}
.stat-card {
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition:
    transform 0.4s,
    border-color 0.4s;
}
.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
}
.stat-number {
  font-size: 4rem;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
}
.stat-quote {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  border: none;
  padding: 0;
}
.stat-share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.stat-source {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.share-snippet-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.share-snippet-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}
.trending-card {
  border-color: rgba(251, 191, 36, 0.3);
}
.trending-badge {
  display: inline-flex;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fbbf24;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* ══════════════════════════════════
   FAQ ACCORDION
══════════════════════════════════ */
.faq-list {
  max-width: 780px;
  margin: 3rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.faq-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s;
}
.faq-item:hover {
  border-color: var(--border-glow);
}
.faq-question {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
}
.faq-chevron {
  transition: transform 0.3s;
  color: var(--text-muted);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: 0 1.5rem;
  transition:
    max-height 0.4s ease,
    padding 0.3s ease;
}
.faq-item.faq-open .faq-answer {
  max-height: 200px;
  padding: 0.25rem 1.5rem 1.25rem;
}
.faq-item.faq-open .faq-chevron {
  transform: rotate(180deg);
}

/* ══════════════════════════════════
   ANALOG vs DIGITAL COMPARISON
══════════════════════════════════ */
.comparison-slider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 3rem;
  min-height: 300px;
}
.comp-panel {
  padding: 3rem 2.5rem;
}
.comp-before {
  background: rgba(100, 116, 139, 0.08);
}
.comp-after {
  background: rgba(59, 130, 246, 0.06);
}
.comp-divider {
  width: 60px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  cursor: default;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}
.comp-badge {
  display: inline-flex;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.comp-before-badge {
  background: rgba(100, 116, 139, 0.2);
  border: 1px solid rgba(100, 116, 139, 0.4);
  color: #94a3b8;
}
.comp-after-badge {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--accent-glow);
}
.workflow-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ══════════════════════════════════
   ROI CALCULATOR
══════════════════════════════════ */
.roi-calculator {
  max-width: 820px;
  margin: 3rem auto 0;
  padding: 3rem;
  border-radius: var(--radius-lg);
  border-color: rgba(16, 185, 129, 0.2);
}
.roi-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.roi-field {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.roi-field label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.roi-field input[type="number"] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  transition: border-color 0.3s;
}
.roi-field input[type="number"]:focus {
  border-color: var(--accent);
  outline: none;
}
.roi-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  cursor: pointer;
}
.roi-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.roi-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.roi-result-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  text-align: center;
}
.roi-highlight {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}
.roi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.roi-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-display);
}
.glow-value {
  color: var(--success);
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}
.roi-share {
  text-align: center;
}

/* ══════════════════════════════════
   LEAD MAGNET POPUP
══════════════════════════════════ */
.lead-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
.lead-popup {
  max-width: 480px;
  width: 90%;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  position: relative;
  border-color: rgba(59, 130, 246, 0.3);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}
.popup-close:hover {
  color: white;
}
.popup-badge {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-glow);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
}
.lead-popup h3 {
  font-size: 1.75rem;
}
.lead-popup p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.popup-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.share-linkedin {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

/* ══════════════════════════════════
   RESPONSIVE ADDITIONS
══════════════════════════════════ */
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .roi-inputs {
    grid-template-columns: 1fr;
  }
  .roi-results {
    grid-template-columns: 1fr;
  }
  .comparison-slider {
    grid-template-columns: 1fr;
  }
  .comp-divider {
    height: 50px;
    width: 100%;
  }
  .toc-sidebar {
    display: none;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .eeat-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
@media (max-width: 600px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .section-title {
    font-size: 2rem;
  }
  .hero-cta-group {
    flex-direction: column;
  }
  .quiz-result-actions {
    flex-direction: column;
  }
}

/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
   CREPITUS SPECTROGRAM SECTION
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
.crepitus-section {
  background: var(--bg-gradient);
}
.crepitus-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-radius: var(--radius-lg);
}

/* Status Bar */
.crep-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.crep-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.3s;
}
.crep-dot-live {
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: crepPulse 1.2s infinite;
}
.crep-dot-done {
  background: #10b981;
}
.crep-dot-error {
  background: #f59e0b;
}
@keyframes crepPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Canvas */
.crep-canvas-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #030508;
  border: 1px solid var(--border);
}
#spectrogramCanvas {
  display: block;
  width: 100%;
  height: auto;
}
.crep-freq-labels {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.4);
  font-family: var(--font-mono, monospace);
}

/* Controls */
.crep-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.crep-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.crep-btn-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.crep-btn-live {
  animation: crepBlink 1s step-start infinite;
}
@keyframes crepBlink {
  50% {
    opacity: 0.2;
  }
}
.crep-timer {
  font-family: var(--font-mono, monospace);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent-glow);
  min-width: 60px;
  letter-spacing: 0.05em;
}

/* Result Card */
.crep-result {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: border-color 0.4s;
}
.crep-result-icon {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.crep-result-content {
  flex: 1;
}
.crep-result-label {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.crep-result-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* How-To Steps */
.crep-howto {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.crep-step {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}
.crep-step-n {
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.crep-privacy {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
[data-theme="clinical"] .crep-canvas-wrap {
  border-color: rgba(34, 211, 238, 0.2);
}
[data-theme="clinical"] .crep-freq-labels {
  color: rgba(34, 211, 238, 0.4);
}

@media (max-width: 700px) {
  .crep-howto {
    grid-template-columns: 1fr 1fr;
  }
  .crep-result {
    flex-direction: column;
  }
}

/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
   JAW SCANNER / KINEMATIC MIRROR
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
.scanner-section {
  background: var(--bg-gradient);
}
.scanner-card {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.scanner-state {
  display: flex;
}
.scanner-state.hidden {
  display: none !important;
}

/* Idle / Error state */
.scanner-idle-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.2rem;
  padding: 3rem 2rem;
  margin: auto;
  max-width: 520px;
}
.scanner-idle-icon {
  font-size: 3.5rem;
  line-height: 1;
}
.scanner-idle-content h3 {
  font-size: 1.6rem;
  font-weight: 700;
}
.scanner-idle-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}
.scanner-idle-spec {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.scanner-idle-spec span {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.scanner-consent {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
}

/* Loading state */
.scanner-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 3rem;
  margin: auto;
  min-width: 280px;
}
.scanner-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinnerSpin 0.9s linear infinite;
}
@keyframes spinnerSpin {
  to {
    transform: rotate(360deg);
  }
}
.scanner-progress-bar {
  width: 260px;
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.scanner-progress-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: 100px;
  transition: width 0.4s ease;
  width: 0%;
}

/* Active state — video + canvas stack */
.scanner-state:not(.hidden).scanner-active-state {
  flex-direction: column;
}
#scannerActive {
  flex-direction: column;
}

.scanner-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16/9;
  max-height: 480px;
}
.scanner-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror */
}
.scanner-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(-1); /* mirror to match video */
}

/* AR HUD corners */
.scanner-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hud-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.8;
}
.hud-tl {
  top: 12px;
  left: 12px;
  border-width: 2px 0 0 2px;
}
.hud-tr {
  top: 12px;
  right: 12px;
  border-width: 2px 2px 0 0;
}
.hud-bl {
  bottom: 12px;
  left: 12px;
  border-width: 0 0 2px 2px;
}
.hud-br {
  bottom: 12px;
  right: 12px;
  border-width: 0 2px 2px 0;
}
.hud-label {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: var(--accent-glow);
  font-size: 0.78rem;
  font-family: var(--font-mono, monospace);
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

/* Live risk score badge */
.scanner-score-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  text-align: center;
  min-width: 70px;
}
.ssb-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  line-height: 1;
}
.ssb-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Metrics row */
.scanner-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
}
.scanner-metric {
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  text-align: center;
}
.sm-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.sm-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--text-primary);
}

/* Action row */
.scanner-actions {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  flex-wrap: wrap;
}

/* Result state */
#scannerResult {
  flex-direction: column;
  padding: 2rem;
}
.scanner-result-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 700px) {
  .scanner-result-wrap {
    grid-template-columns: 1fr;
  }
}
.snap-image {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.scanner-result-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.srp-score {
  font-size: 3rem;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  line-height: 1;
}
.srp-label {
  font-size: 1.1rem;
  font-weight: 600;
}
.srp-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.srp-metrics {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.srp-metrics strong {
  color: var(--text-primary);
}
.srp-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Clinical theme adaptation */
[data-theme="clinical"] .hud-corner {
  border-color: rgba(34, 211, 238, 0.9);
}
[data-theme="clinical"] .hud-label {
  color: rgba(34, 211, 238, 0.9);
}
[data-theme="clinical"] .scanner-score-badge {
  border-color: rgba(34, 211, 238, 0.3);
}

@media (max-width: 700px) {
  .scanner-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .scanner-actions {
    flex-direction: column;
  }
}

/* ══════════════════════════════════
   3D JAW ANATOMY SECTION
══════════════════════════════════ */
.anatomy-section {
  background: var(--bg-gradient);
}
.anatomy-card {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

/* Viewport */
.anatomy-viewport {
  position: relative;
  width: 100%;
  min-height: 320px;
  background:
    radial-gradient(
      ellipse at 50% 40%,
      rgba(34, 211, 238, 0.06) 0%,
      transparent 70%
    ),
    linear-gradient(180deg, #070b14 0%, #0b1120 100%);
}
#anatomyCanvas {
  display: block;
  width: 100%;
  cursor: grab;
}
#anatomyCanvas:active {
  cursor: grabbing;
}

/* Mode bar (scrollable for 8 pathology buttons) */
.anatomy-mode-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 80px;
  display: flex;
  gap: 5px;
  z-index: 2;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}
.anatomy-mode-bar::-webkit-scrollbar {
  display: none;
}
.anatomy-mode-btn {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 10px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  scroll-snap-align: start;
}
.anatomy-mode-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.anatomy-mode-active {
  background: rgba(34, 211, 238, 0.15);
  border-color: var(--accent);
  color: var(--accent-glow);
}

/* Speed slider */
.anatomy-speed {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  z-index: 2;
}
.anatomy-speed label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.anatomy-speed input[type="range"] {
  width: 80px;
  height: 4px;
  accent-color: var(--accent);
}

/* Info badge */
.anatomy-info-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  z-index: 2;
}
.anatomy-info-badge strong {
  color: var(--text-primary);
}

/* Legend */
.anatomy-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* Caption */
.anatomy-caption {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.5rem 1rem 1rem;
}

/* Responsive */
@media (max-width: 700px) {
  .anatomy-mode-bar {
    flex-wrap: wrap;
  }
  .anatomy-speed {
    top: auto;
    bottom: 65px;
    right: 12px;
  }
  .anatomy-legend {
    justify-content: center;
  }
}

/* ── GLB Loading spinner ───────────────────────────── */
.anatomy-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 18, 0.85);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  z-index: 10;
  transition: opacity 0.6s ease;
}

.anatomy-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.anatomy-spin {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(167, 139, 250, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinnerRotate 0.9s linear infinite;
}

@keyframes spinnerRotate {
  to {
    transform: rotate(360deg);
  }
}

.anatomy-load-pct {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-glow);
  font-family: var(--font-mono);
}

.anatomy-load-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
