/* ============================================
   CYSTIC FIBROSIS - MEDICAL WEBSITE
   Color Theme: CF Awareness Purple + Medical Teal
   ============================================ */

/* --- CSS Variables --- */
:root {
  --purple-50: #faf5ff;
  --purple-100: #f3e8ff;
  --purple-200: #e9d5ff;
  --purple-300: #d8b4fe;
  --purple-400: #c084fc;
  --purple-500: #a855f7;
  --purple-600: #9333ea;
  --purple-700: #7e22ce;
  --purple-800: #6b21a8;
  --purple-900: #581c87;

  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --teal-900: #134e4a;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --primary: var(--purple-700);
  --primary-light: var(--purple-100);
  --primary-dark: var(--purple-900);
  --accent: var(--teal-600);
  --accent-light: var(--teal-50);
  --bg: #fefefe;
  --bg-alt: var(--slate-50);
  --text: var(--slate-800);
  --text-light: var(--slate-500);
  --text-white: #ffffff;
  --border: var(--slate-200);
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 50px -12px rgba(0,0,0,.12);
  --transition: .3s cubic-bezier(.4,0,.2,1);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', var(--font);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--slate-900);
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--purple-500); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

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

/* --- Utility --- */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-tag .tag-line {
  width: 32px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 640px;
  line-height: 1.8;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header .section-desc {
  margin: 0 auto;
}

/* --- Animated Background Particles (Lung cells) --- */
.bg-particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-particles .particle {
  position: absolute;
  border-radius: 50%;
  opacity: .04;
  animation: floatParticle 20s infinite ease-in-out;
}

@keyframes floatParticle {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-30px) translateX(15px); }
  50% { transform: translateY(-10px) translateX(-20px); }
  75% { transform: translateY(-40px) translateX(10px); }
}

/* ==================== NAVBAR ==================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
  padding: 0;
}

.navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
}

.nav-logo .logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--purple-600), var(--teal-500));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--slate-600);
  transition: var(--transition);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: var(--purple-50);
}

.nav-cta {
  background: var(--primary) !important;
  color: white !important;
  padding: 10px 20px !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  margin-left: 8px;
}

.nav-cta:hover {
  background: var(--purple-800) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(126,34,206,.3);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--slate-700);
  border-radius: 2px;
  transition: var(--transition);
}

/* ==================== HERO ==================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(160deg, var(--purple-50) 0%, var(--bg) 40%, var(--teal-50) 100%);
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,85,247,.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -150px; left: -100px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20,184,166,.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding-top: 100px;
  padding-bottom: 60px;
}

.hero-content {
  max-width: 580px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  background: var(--purple-100);
  color: var(--purple-700);
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid var(--purple-200);
}

.hero-badge .pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--purple-500);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.3); }
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--purple-900) 0%, var(--purple-600) 50%, var(--teal-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: var(--font);
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-700));
  color: white;
  box-shadow: 0 4px 15px rgba(126,34,206,.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(126,34,206,.35);
  color: white;
}

.btn-outline {
  background: white;
  color: var(--primary);
  border: 2px solid var(--purple-200);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: var(--purple-50);
}

/* Hero Visual - Lung SVG illustration */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lung-illustration {
  width: 100%;
  max-width: 480px;
  position: relative;
}

.lung-illustration svg {
  width: 100%;
  filter: drop-shadow(0 20px 40px rgba(126,34,206,.12));
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.stat-item {
  text-align: center;
  padding: 16px;
  border-radius: var(--radius);
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple-700), var(--teal-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: .78rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* ==================== SECTIONS ==================== */
section {
  position: relative;
  z-index: 1;
  padding: 96px 0;
}

section:nth-child(even) {
  background: var(--bg-alt);
}

/* --- About Section --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-text p {
  margin-bottom: 16px;
  color: var(--slate-600);
  line-height: 1.8;
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}

.about-feature {
  padding: 20px;
  border-radius: var(--radius);
  background: white;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.about-feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--purple-200);
}

.about-feature .icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.about-feature:nth-child(1) .icon { background: var(--purple-100); color: var(--purple-600); }
.about-feature:nth-child(2) .icon { background: var(--teal-100); color: var(--teal-700); }
.about-feature:nth-child(3) .icon { background: #fef3c7; color: #d97706; }
.about-feature:nth-child(4) .icon { background: #fce7f3; color: #db2777; }

.about-feature h4 {
  font-size: .92rem;
  margin-bottom: 4px;
}

.about-feature p {
  font-size: .82rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* Timeline */
.timeline {
  position: relative;
  padding: 32px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--purple-300), var(--teal-300));
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 32px;
  position: relative;
}

.timeline-item:nth-child(odd) {
  flex-direction: row;
  padding-right: calc(50% + 32px);
  text-align: right;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
  padding-left: calc(50% + 32px);
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 8px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--primary);
  transform: translateX(-50%);
  z-index: 2;
}

.timeline-card {
  padding: 20px 24px;
  border-radius: var(--radius);
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.timeline-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.timeline-year {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
}

.timeline-card h4 {
  font-size: .92rem;
  margin: 4px 0;
}

.timeline-card p {
  font-size: .82rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* --- Cards Grid --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 32px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--purple-200);
}

.card:hover::before { opacity: 1; }

.card-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--purple-50), var(--teal-50));
  color: var(--primary);
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.card p {
  font-size: .9rem;
  color: var(--text-light);
  line-height: 1.7;
}

.card-list {
  list-style: none;
  margin-top: 16px;
}

.card-list li {
  padding: 8px 0;
  font-size: .88rem;
  color: var(--slate-600);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid var(--slate-100);
}

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

.card-list li::before {
  content: '';
  width: 6px; height: 6px;
  min-width: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 8px;
}

/* --- Symptoms Tabs --- */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 40px;
  justify-content: center;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 24px;
  border-radius: 100px;
  border: 2px solid var(--border);
  background: white;
  font-family: var(--font);
  font-weight: 600;
  font-size: .88rem;
  color: var(--slate-600);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover { border-color: var(--purple-300); color: var(--primary); }

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

.tab-content { display: none; animation: fadeIn .4s ease; }
.tab-content.active { display: block; }

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

/* --- Stats Section --- */
.stats-section {
  background: linear-gradient(135deg, var(--purple-800) 0%, var(--purple-900) 50%, var(--teal-800) 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.stats-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  position: relative;
  z-index: 1;
}

.stats-card {
  text-align: center;
  padding: 32px 16px;
}

.stats-card .number {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: white;
  line-height: 1;
}

.stats-card .label {
  font-size: .9rem;
  color: rgba(255,255,255,.7);
  margin-top: 8px;
  line-height: 1.4;
}

.stats-card .sub {
  font-size: .75rem;
  color: rgba(255,255,255,.45);
  margin-top: 4px;
}

/* --- Treatment Section --- */
.treatment-tabs {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.treatment-sidebar {
  background: var(--slate-50);
  padding: 8px;
  border-right: 1px solid var(--border);
}

.treatment-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 500;
  color: var(--slate-600);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.treatment-btn:hover { background: white; color: var(--primary); }

.treatment-btn.active {
  background: white;
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.treatment-btn .t-icon {
  width: 36px; height: 36px;
  min-width: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--purple-100);
  color: var(--purple-600);
}

.treatment-btn.active .t-icon {
  background: linear-gradient(135deg, var(--purple-600), var(--teal-500));
  color: white;
}

.treatment-panel {
  padding: 40px;
  display: none;
  animation: fadeIn .3s ease;
}

.treatment-panel.active { display: block; }

.treatment-panel h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.treatment-panel .subtitle {
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: .95rem;
}

.treatment-panel .med-list {
  margin-top: 20px;
}

.med-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  transition: var(--transition);
}

.med-item:hover {
  border-color: var(--purple-200);
  box-shadow: var(--shadow-sm);
}

.med-year {
  min-width: 56px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--purple-100);
  color: var(--purple-700);
  font-size: .75rem;
  font-weight: 700;
}

.med-info h4 { font-size: .95rem; }
.med-info p { font-size: .82rem; color: var(--text-light); margin-top: 2px; }

/* --- FAQ Accordion --- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: white;
  overflow: hidden;
  transition: var(--transition);
}

.faq-item:hover { border-color: var(--purple-200); }

.faq-item.open {
  border-color: var(--purple-300);
  box-shadow: var(--shadow);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  color: var(--slate-700);
  transition: var(--transition);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.faq-question:hover { color: var(--primary); }

.faq-question .arrow {
  font-size: 1.2rem;
  transition: var(--transition);
  color: var(--slate-400);
}

.faq-item.open .faq-question .arrow { transform: rotate(180deg); color: var(--primary); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, padding .3s ease;
}

.faq-item.open .faq-answer {
  max-height: 500px;
  padding: 0 24px 20px;
}

.faq-answer p {
  font-size: .9rem;
  color: var(--slate-600);
  line-height: 1.8;
}

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--purple-700), var(--purple-800));
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
}

.cta-section h2 {
  color: white;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 16px;
}

.cta-section p {
  color: rgba(255,255,255,.75);
  font-size: 1.05rem;
  margin-bottom: 32px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.btn-white {
  background: white;
  color: var(--primary);
  font-weight: 700;
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,.2);
  color: var(--primary);
}

/* ==================== FOOTER ==================== */
.footer {
  background: var(--slate-900);
  color: rgba(255,255,255,.6);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand .logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: white;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-brand p {
  font-size: .88rem;
  line-height: 1.7;
  max-width: 320px;
}

.footer h4 {
  color: white;
  font-size: .92rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-links li { margin-bottom: 8px; }

.footer-links a {
  color: rgba(255,255,255,.5);
  font-size: .88rem;
  transition: var(--transition);
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
}

/* --- Scroll to Top --- */
.scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  border: none;
  box-shadow: 0 4px 15px rgba(126,34,206,.3);
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--purple-800);
  transform: translateY(-3px);
}

/* --- Loading / Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}

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

/* --- Counter Animation --- */
.count-up {
  display: inline-block;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-content { max-width: 100%; }
  .hero-buttons { justify-content: center; }
  .hero-visual { display: none; }
  .hero-stats { max-width: 500px; margin-left: auto; margin-right: auto; }
  .about-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .treatment-tabs { grid-template-columns: 1fr; }
  .treatment-sidebar {
    display: flex;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px;
    gap: 4px;
  }
  .treatment-btn { white-space: nowrap; min-width: max-content; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .timeline::before { left: 24px; }
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    flex-direction: row;
    padding-left: 56px;
    padding-right: 0;
    text-align: left;
  }
  .timeline-item::after { left: 24px; }
}

@media (max-width: 768px) {
  html { font-size: 15px; }
  section { padding: 64px 0; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: white;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    gap: 4px;
  }
  .nav-links.open a { width: 100%; text-align: center; }
  .nav-cta { margin-left: 0 !important; }
  .hero { min-height: auto; padding: 120px 0 60px; }
  .hero-stats { grid-template-columns: 1fr; gap: 12px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .cards-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .treatment-panel { padding: 24px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 1.8rem; }
  .btn { padding: 12px 20px; font-size: .88rem; }
  .hero-buttons { flex-direction: column; }
  .tabs { gap: 6px; }
  .tab-btn { padding: 8px 16px; font-size: .8rem; }
}

/* ==================== INNER PAGES ==================== */

/* Page Hero (smaller) */
.page-hero {
  padding: 140px 0 60px;
  background: linear-gradient(160deg, var(--purple-50) 0%, var(--bg) 40%, var(--teal-50) 100%);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,85,247,.06) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.page-hero .breadcrumb a { color: var(--primary); }
.page-hero .breadcrumb span { color: var(--slate-400); }

.page-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--purple-900), var(--purple-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-hero .lead {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 700px;
  line-height: 1.8;
}

/* Article Layout */
.article-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  padding: 64px 0;
}

/* Sidebar Nav */
.sidebar-nav {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 16px;
}

.sidebar-nav h4 {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  margin-bottom: 12px;
  padding-left: 12px;
}

.sidebar-nav ul { list-style: none; }

.sidebar-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .86rem;
  color: var(--slate-600);
  border-left: 2px solid transparent;
  transition: var(--transition);
  line-height: 1.4;
  margin-bottom: 2px;
}

.sidebar-nav a:hover {
  color: var(--primary);
  background: var(--purple-50);
  border-left-color: var(--purple-300);
}

.sidebar-nav a.active {
  color: var(--primary);
  background: var(--purple-50);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* Article Content */
.article-content {
  min-width: 0;
}

.article-content h2 {
  font-size: 1.6rem;
  margin: 48px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--purple-100);
  color: var(--slate-900);
}

.article-content h2:first-child { margin-top: 0; }

.article-content h3 {
  font-size: 1.2rem;
  margin: 32px 0 12px;
  color: var(--slate-800);
}

.article-content h4 {
  font-size: 1rem;
  margin: 24px 0 8px;
  color: var(--slate-700);
}

.article-content p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--slate-600);
}

.article-content strong { color: var(--slate-800); }

.article-content ul,
.article-content ol {
  margin: 12px 0 20px 20px;
  color: var(--slate-600);
}

.article-content li {
  margin-bottom: 8px;
  line-height: 1.7;
  list-style: disc;
}

.article-content ol li { list-style: decimal; }

/* Info Boxes */
.info-box {
  padding: 20px 24px;
  border-radius: var(--radius);
  margin: 24px 0;
  border-left: 4px solid;
}

.info-box.purple {
  background: var(--purple-50);
  border-color: var(--purple-500);
}

.info-box.teal {
  background: var(--teal-50);
  border-color: var(--teal-500);
}

.info-box.warning {
  background: #fef3c7;
  border-color: #f59e0b;
}

.info-box.danger {
  background: #fef2f2;
  border-color: #ef4444;
}

.info-box h4 {
  margin: 0 0 8px;
  font-size: .95rem;
  color: var(--slate-800);
}

.info-box p {
  margin: 0;
  font-size: .9rem;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.article-content thead {
  background: linear-gradient(135deg, var(--purple-50), var(--teal-50));
}

.article-content th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--slate-700);
  border-bottom: 2px solid var(--purple-200);
  white-space: nowrap;
}

.article-content td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-600);
}

.article-content tbody tr:hover { background: var(--slate-50); }

/* Code / Schema blocks */
.schema-block {
  background: var(--slate-900);
  color: #e2e8f0;
  padding: 24px;
  border-radius: var(--radius);
  margin: 20px 0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .82rem;
  line-height: 1.8;
  overflow-x: auto;
  white-space: pre;
}

/* Page Navigation (prev/next) */
.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 2px solid var(--border);
}

.page-nav a {
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
  color: var(--slate-700);
}

.page-nav a:hover {
  border-color: var(--purple-300);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.page-nav a:last-child { text-align: right; }

.page-nav .nav-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 4px;
}

.page-nav .nav-title {
  font-weight: 600;
  font-size: .95rem;
}

/* Badge/Tag */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 600;
}

.badge-purple { background: var(--purple-100); color: var(--purple-700); }
.badge-teal { background: var(--teal-100); color: var(--teal-700); }
.badge-red { background: #fef2f2; color: #dc2626; }
.badge-yellow { background: #fef3c7; color: #d97706; }
.badge-green { background: #f0fdf4; color: #16a34a; }

/* Sources list */
.sources {
  margin-top: 48px;
  padding: 24px;
  background: var(--slate-50);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.sources h3 {
  font-size: 1rem;
  margin: 0 0 12px;
}

.sources ul { margin: 0; padding: 0; }

.sources li {
  list-style: none !important;
  margin-bottom: 6px;
  font-size: .85rem;
}

.sources a {
  color: var(--primary);
  word-break: break-all;
}

/* Pages Navigation Cards (index) */
.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.page-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  color: var(--slate-700);
}

.page-card:hover {
  border-color: var(--purple-300);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  color: var(--primary);
}

.page-card .pc-num {
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--purple-100), var(--teal-50));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .9rem;
}

.page-card h3 { font-size: .95rem; margin-bottom: 4px; }
.page-card p { font-size: .8rem; color: var(--text-light); margin: 0; line-height: 1.4; }

/* Responsive inner pages */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .sidebar-nav {
    position: relative;
    top: 0;
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    max-height: none;
  }
  .sidebar-nav h4 { display: none; }
  .sidebar-nav ul { display: flex; gap: 4px; }
  .sidebar-nav a {
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 8px 14px;
    font-size: .82rem;
  }
  .sidebar-nav a:hover,
  .sidebar-nav a.active {
    border-left: none;
    border-bottom-color: var(--primary);
  }
}

@media (max-width: 768px) {
  .page-hero { padding: 110px 0 40px; }
  .page-nav { grid-template-columns: 1fr; }
  .article-content h2 { font-size: 1.3rem; }
}

/* --- Print --- */
@media print {
  .navbar, .scroll-top, .bg-particles, .cta-section, .sidebar-nav { display: none; }
  section, .article-layout { padding: 24px 0; }
  .article-layout { grid-template-columns: 1fr; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .page-hero { padding: 40px 0 20px; }
}
