/* ===== DESIGN TOKENS — Light Theme ===== */
:root {
  --bg: #fbfaf7;
  --bg-soft: #f3f1ec;
  --surface: #ffffff;
  --surface-secondary: #f8f6f1;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #767676;
  --border: #e8e4dc;
  --border-strong: #d8d2c5;
  --brand: #0f766e;
  --brand-soft: #ccfbf1;
  --brand-deep: #134e4a;
  --accent: #b45309;
  --accent-soft: #fef3c7;
  --green-pill: #16a34a;
  --green-pill-bg: #dcfce7;
  --red-pill: #dc2626;
  --red-pill-bg: #fee2e2;
  --amber-star: #f59e0b;
  --shadow-sm: 0 1px 2px rgba(20,20,20,.04), 0 2px 8px rgba(20,20,20,.04);
  --shadow-default: 0 4px 24px rgba(20,20,20,.06);
  --shadow-lg: 0 12px 40px rgba(20,20,20,.08);
  --radius-sm: 8px;
  --radius-default: 14px;
  --radius-lg: 22px;
  --radius-pill: 9999px;
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
  --font-ui:  -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display:-apple-system, sans-serif;
  --font-editorial: Georgia, serif;
  --max-site: 1240px;
  --max-article: 720px;
  --z-dropdown: 100;
  --z-sticky-bar: 200;
  --z-mobile-menu: 300;
  --z-modal: 400;
  --z-toast: 500;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
}

/* ===== DARK THEME TOKENS ===== */
[data-theme="dark"] {
  --bg: #14181b;
  --bg-soft: #1a1f23;
  --surface: #1c2226;
  --surface-secondary: #20262a;
  --text-primary: #f1f1ef;
  --text-secondary: #c4c4c2;
  --text-muted: #8f9396;
  --border: #2a3136;
  --border-strong: #3a4247;
  --brand: #2dd4bf;
  --brand-soft: #0f2e2b;
  --brand-deep: #5eead4;
  --accent: #f59e0b;
  --accent-soft: #422006;
  --green-pill: #4ade80;
  --green-pill-bg: #052e16;
  --red-pill: #f87171;
  --red-pill-bg: #450a0a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.15), 0 2px 8px rgba(0,0,0,.15);
  --shadow-default: 0 4px 24px rgba(0,0,0,.2);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.3);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}
::selection { background: var(--brand-soft); color: var(--brand-deep); }
*:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--radius-sm); }
img { display: block; max-width: 100%; height: auto; }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes stickyBarIn { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

.fade-in { opacity: 0; animation: fadeInUp 0.6s var(--transition) forwards; }
.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }

/* ===== CONTAINER ===== */
.container { max-width: var(--max-article); margin: 0 auto; padding: 0 var(--space-5); }
.container-wide { max-width: var(--max-site); margin: 0 auto; padding: 0 var(--space-5); }

/* ===== NAVIGATION ===== */
.nav {
  position: sticky; top: 0; z-index: var(--z-dropdown);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-site); margin: 0 auto;
  padding: var(--space-4) var(--space-5);
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 800;
  color: var(--text-primary); text-decoration: none; letter-spacing: -0.02em;
}
.nav-logo span { color: var(--brand); }
.nav-actions { display: flex; align-items: center; gap: var(--space-2); }
.nav-links { display: none; gap: var(--space-6); list-style: none; }
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-links a {
  color: var(--text-muted); text-decoration: none; font-size: 0.875rem;
  font-weight: 500; transition: color var(--transition);
}
.nav-links a:hover { color: var(--brand); }
.nav-mobile-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text-primary); cursor: pointer; transition: all var(--transition);
}
@media (min-width: 768px) { .nav-mobile-btn { display: none; } }
.nav-mobile-btn:hover { border-color: var(--border-strong); background: var(--surface-secondary); }

/* Theme Toggle Button */
.theme-toggle {
  width: 40px; height: 40px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text-primary); cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--border-strong); background: var(--surface-secondary); }

/* Mobile Menu */
.mobile-menu {
  display: none; position: fixed; inset: 0; z-index: var(--z-mobile-menu);
  background: var(--bg); padding: var(--space-6) var(--space-5);
}
.mobile-menu.open { display: flex; flex-direction: column; }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-7); }
.mobile-menu-close {
  width: 40px; height: 40px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text-primary); cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: all var(--transition);
}
.mobile-menu-close:hover { border-color: var(--border-strong); }
.mobile-menu-links { list-style: none; display: flex; flex-direction: column; gap: var(--space-4); }
.mobile-menu-links a {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 600;
  color: var(--text-primary); text-decoration: none; padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border); transition: color var(--transition);
}
.mobile-menu-links a:hover { color: var(--brand); }

/* ===== BREADCRUMBS ===== */
.breadcrumbs { padding: var(--space-4) 0 0; }
.breadcrumbs-list { display: flex; align-items: center; gap: var(--space-2); list-style: none; flex-wrap: wrap; font-size: 0.8125rem; }
.breadcrumbs-sep { color: var(--text-muted); font-size: 0.75rem; }
.breadcrumbs-list a { color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.breadcrumbs-list a:hover { color: var(--brand); }
.breadcrumbs-list .current { color: var(--text-secondary); font-weight: 500; }

/* ===== HERO ===== */
.hero { padding: var(--space-7) 0 var(--space-6); }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); align-items: center; }
@media (min-width: 768px) { .hero-grid { grid-template-columns: 1fr 1fr; gap: var(--space-7); } }
.hero-badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface-secondary);
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: var(--space-4);
}
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.hero h1 {
  font-family: var(--font-display); font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800; line-height: 1.15; letter-spacing: -0.03em;
  margin-bottom: var(--space-4); color: var(--text-primary);
}
.hero-sub {
  font-size: 1.0625rem; color: var(--text-secondary); line-height: 1.65;
  margin-bottom: var(--space-5);
}
.hero-meta {
  display: flex; align-items: center; gap: var(--space-5);
  flex-wrap: wrap; font-size: 0.8125rem; color: var(--text-muted);
}
.hero-meta-item { display: flex; align-items: center; gap: var(--space-2); }

/* ===== DISCLOSURE BOXES ===== */
.disclosure-box {
  background: var(--surface-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-default); padding: var(--space-5);
  margin-bottom: var(--space-6); font-size: 0.8125rem;
  color: var(--text-muted); line-height: 1.75;
}
.disclosure-box p + p { margin-top: var(--space-2); }
.disclosure-box strong { color: var(--text-secondary); font-weight: 600; }

/* ===== SECTION STYLING ===== */
.section { margin-bottom: var(--space-7); }
.section h2 {
  font-family: var(--font-display); font-size: 1.375rem; font-weight: 700;
  letter-spacing: -0.02em; margin-bottom: var(--space-5);
  padding-bottom: var(--space-4); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--space-3);
}
.h2-icon {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--brand-soft); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; color: var(--brand);
}
.section h3 {
  font-family: var(--font-display); font-size: 1.0625rem; font-weight: 700;
  letter-spacing: -0.01em; margin-bottom: var(--space-3);
  margin-top: var(--space-6); color: var(--text-primary);
}
.article-body p {
  font-family: var(--font-editorial); color: var(--text-secondary);
  margin-bottom: var(--space-4); font-size: 0.975rem; line-height: 1.8;
}
.article-body ul {
  list-style: none; margin-bottom: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.article-body ul li {
  font-family: var(--font-editorial); color: var(--text-secondary);
  font-size: 0.975rem; padding-left: var(--space-4); position: relative; line-height: 1.7;
}
.article-body ul li::before {
  content: ''; position: absolute; left: 0; top: 0.6em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--brand);
}
.article-body ol {
  list-style: none; margin-bottom: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2);
  counter-reset: item;
}
.article-body ol li {
  font-family: var(--font-editorial); color: var(--text-secondary);
  font-size: 0.975rem; padding-left: var(--space-5); position: relative; line-height: 1.7;
  counter-increment: item;
}
.article-body ol li::before {
  content: counter(item); position: absolute; left: 0; top: 0;
  width: 20px; height: 20px; background: var(--brand-soft); color: var(--brand);
  border-radius: 50%; text-align: center; line-height: 20px; font-size: 0.75rem; font-weight: 700;
  font-family: var(--font-ui);
}

/* ===== CALLOUT BOXES ===== */
.callout {
  border-radius: var(--radius-default); padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0; font-size: 0.875rem; color: var(--text-secondary);
  display: flex; align-items: flex-start; gap: var(--space-3);
  font-family: var(--font-ui); line-height: 1.65;
}
.callout-icon { flex-shrink: 0; margin-top: 2px; }
.callout-green { background: var(--brand-soft); border: 1px solid var(--brand); }
.callout-green .callout-icon { color: var(--brand); }
.callout-amber { background: var(--accent-soft); border: 1px solid var(--border-strong); }
.callout-amber .callout-icon { color: var(--accent); }
.callout-blue { background: #eff6ff; border: 1px solid #93c5fd; }
[data-theme="dark"] .callout-blue { background: #172554; border-color: #1e40af; }
.callout-blue .callout-icon { color: #3b82f6; }

/* ===== COMPARISON TABLE ===== */
.table-wrap {
  overflow-x: auto; margin-bottom: var(--space-4);
  border-radius: var(--radius-default); border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}
.comp-table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: 0.8125rem; }
.comp-table thead { background: var(--surface-secondary); }
.comp-table th {
  padding: var(--space-3) var(--space-4); text-align: left;
  font-weight: 600; font-size: 0.75rem; color: var(--text-muted);
  border-bottom: 1px solid var(--border); white-space: nowrap; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.comp-table td {
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.comp-table tbody tr:hover { background: var(--surface-secondary); }
.comp-table tbody tr:last-child td { border-bottom: none; }
.comp-table .feat { font-weight: 600; color: var(--text-primary); white-space: nowrap; }

/* ===== FAQ ACCORDION ===== */
.faq-section { margin-bottom: var(--space-7); }
.faq-section > h2 { margin-bottom: var(--space-5); }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-default); margin-bottom: var(--space-2);
  overflow: hidden; transition: all var(--transition);
}
.faq-item.active { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); padding: var(--space-4) var(--space-5);
  background: transparent; border: none; color: var(--text-primary);
  font-family: var(--font-display); font-size: 0.9375rem; font-weight: 600;
  text-align: left; cursor: pointer; transition: color var(--transition); line-height: 1.4;
}
.faq-question:hover { color: var(--brand); }
.faq-chevron {
  flex-shrink: 0; width: 20px; height: 20px; color: var(--text-muted);
  transition: transform var(--transition), color var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.faq-item.active .faq-chevron { transform: rotate(180deg); color: var(--brand); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s var(--transition); }
.faq-answer-inner {
  padding: 0 var(--space-5) var(--space-5); color: var(--text-secondary);
  font-family: var(--font-editorial); font-size: 0.875rem; line-height: 1.75;
}

/* ===== SOURCES ===== */
.sources-list { list-style: none; display: grid; grid-template-columns: 1fr; gap: var(--space-2); }
@media (min-width: 640px) { .sources-list { grid-template-columns: 1fr 1fr; } }
.sources-list li {
  font-size: 0.8125rem; color: var(--text-muted); padding-left: var(--space-4);
  position: relative; line-height: 1.5;
}
.sources-list li::before { content: '—'; position: absolute; left: 0; color: var(--text-muted); opacity: 0.5; }

/* ===== EDITORIAL NOTE ===== */
.editorial-note {
  background: var(--surface-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-default); padding: var(--space-5);
  margin-bottom: var(--space-7); font-size: 0.8125rem;
  color: var(--text-muted); line-height: 1.75;
}
.editorial-note strong {
  color: var(--text-secondary); font-weight: 600; display: block;
  margin-bottom: var(--space-2); font-size: 0.875rem;
}

/* ===== FOOTER ===== */
.footer { border-top: 1px solid var(--border); padding: var(--space-7) 0; margin-top: var(--space-7); }
.footer-inner { max-width: var(--max-site); margin: 0 auto; padding: 0 var(--space-5); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-7); margin-bottom: var(--space-7); }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand p { font-size: 0.8125rem; color: var(--text-muted); margin-top: var(--space-3); line-height: 1.6; max-width: 320px; }
.footer-heading {
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }
.footer-links a {
  font-size: 0.8125rem; color: var(--text-secondary); text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--brand); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: var(--space-5);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-3); font-size: 0.75rem; color: var(--text-muted);
}
.footer-bottom a { color: var(--text-muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--brand); }

/* ===== SCROLL REVEAL ===== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--transition), transform 0.6s var(--transition); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== SCROLL OFFSET ===== */
[id] { scroll-margin-top: 80px; }

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed; bottom: var(--space-5); right: var(--space-5);
  z-index: var(--z-dropdown); width: 44px; height: 44px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
  opacity: 0; pointer-events: none; transform: translateY(8px);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { border-color: var(--brand); color: var(--brand); box-shadow: var(--shadow-default); }
