:root {
  --bg: #0b0f1a;
  --bg-2: #0f1424;
  --surface: #141a2c;
  --surface-2: #1a2238;
  --border: #232c44;
  --border-light: #2c3754;
  --text: #eef1f8;
  --text-dim: #a4adc4;
  --text-faint: #6b7592;
  --brand: #5b8cff;
  --brand-2: #7c4dff;
  --green: #2fd07f;
  --amber: #ffb02e;
  --red: #ff5d6c;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --glow-1: rgba(124,77,255,0.16);
  --glow-2: rgba(91,140,255,0.14);
  color-scheme: dark;
}

/* Light theme — set by the header toggle via data-theme="light" on <html> */
:root[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-2: #eef2fa;
  --surface: #ffffff;
  --surface-2: #f2f5fb;
  --border: #e0e6f2;
  --border-light: #cfd8ea;
  --text: #121826;
  --text-dim: #465066;
  --text-faint: #6a7488;
  --brand: #3457d5;
  --brand-2: #6a35e0;
  --green: #12905a;
  --amber: #a76a00;
  --red: #d13544;
  --glow-1: rgba(124,77,255,0.10);
  --glow-2: rgba(91,140,255,0.10);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(800px 500px at 80% -10%, var(--glow-1), transparent 60%),
    radial-gradient(700px 500px at 5% 0%, var(--glow-2), transparent 55%);
  background-attachment: fixed;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11,15,26,0.72);
  border-bottom: 1px solid var(--border);
}
:root[data-theme="light"] .site-header { background: rgba(246,248,252,0.82); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.06rem; }
.brand-accent { color: var(--brand); }
.header-nav { display: flex; align-items: center; gap: 28px; font-size: 0.92rem; font-weight: 500; }
.header-nav a { color: var(--text-dim); transition: color 0.15s; }
.header-nav a:hover { color: var(--text); }
.header-cta {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff !important; padding: 8px 16px; border-radius: 999px; font-weight: 600;
}
.header-cta:hover { filter: brightness(1.08); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: 1px solid transparent; transition: transform 0.12s, filter 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 24px -8px rgba(91,140,255,0.6); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-light); }
.btn-ghost:hover { background: var(--surface-2); }

/* Hero */
.hero { padding: 84px 0 56px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.74rem; font-weight: 700;
  color: var(--brand); margin: 0 0 18px;
}
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 800; }
.grad { background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 640px; color: var(--text-dim); font-size: 1.1rem; margin: 22px 0 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 44px; margin-top: 48px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--mono); font-size: 1.7rem; font-weight: 600; }
.hero-stats span { color: var(--text-faint); font-size: 0.85rem; }

/* Tools */
.tools { padding: 40px 0 64px; }
.tools-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); }
.tools-head p { color: var(--text-dim); max-width: 620px; margin: 12px 0 36px; }

.tools-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }

.tool-tabs { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 84px; }
.tab {
  text-align: left; background: transparent; border: 1px solid transparent; color: var(--text-dim);
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600; padding: 12px 16px;
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; width: 100%;
}
.tab:hover { background: var(--surface); color: var(--text); }
.tab.active { background: var(--surface-2); color: var(--text); border-color: var(--border-light); box-shadow: inset 3px 0 0 var(--brand); }

.calc-card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
}
.calc-card.hidden { display: none; }
.calc-head h3 { font-size: 1.4rem; }
.calc-head p { color: var(--text-dim); margin: 8px 0 0; font-size: 0.96rem; }

.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 24px; }

.inputs { display: flex; flex-direction: column; gap: 16px; }
.inputs label { display: flex; flex-direction: column; gap: 7px; font-size: 0.85rem; font-weight: 600; color: var(--text-dim); }
.field {
  display: flex; align-items: center; background: var(--bg); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s;
}
.field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91,140,255,0.18); }
.field .prefix, .field .suffix { padding: 0 12px; color: var(--text-faint); font-family: var(--mono); font-size: 0.95rem; }
.field input {
  flex: 1; min-width: 0; background: transparent; border: none; color: var(--text);
  font-family: var(--mono); font-size: 1rem; font-weight: 500; padding: 11px 12px; width: 100%;
}
.field input:focus { outline: none; }
.field input::-webkit-outer-spin-button, .field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.variant-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.variant-row h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 12px; }
.variant-row label { margin-bottom: 12px; }

/* Results */
.results { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 22px; }
.result-hero { margin-bottom: 18px; }
.result-hero .rh-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); }
.result-hero .rh-value { font-family: var(--mono); font-size: 2.4rem; font-weight: 600; line-height: 1.1; margin-top: 4px; }
.result-rows { display: flex; flex-direction: column; gap: 1px; background: var(--border); border-radius: 8px; overflow: hidden; }
.result-rows .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; background: var(--surface); padding: 11px 14px; }
.result-rows .row .label { color: var(--text-dim); font-size: 0.88rem; }
.result-rows .row .val { font-family: var(--mono); font-weight: 600; font-size: 1rem; }

.verdict { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; margin-top: 16px; }
.verdict::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.verdict.green { color: var(--green); background: rgba(47,208,127,0.12); }
.verdict.amber { color: var(--amber); background: rgba(255,176,46,0.12); }
.verdict.red { color: var(--red); background: rgba(255,93,108,0.12); }

.interp { margin-top: 16px; font-size: 0.9rem; color: var(--text-dim); line-height: 1.55; }
.interp strong { color: var(--text); }

/* Funnel bars */
.funnel-vis { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.fbar { background: var(--surface); border-radius: 8px; padding: 10px 12px; }
.fbar .fbar-top { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-dim); margin-bottom: 6px; }
.fbar .fbar-top .fcount { font-family: var(--mono); color: var(--text); font-weight: 600; }
.fbar .track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.fbar .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width 0.4s ease; }

/* Why */
.why { padding: 56px 0; border-top: 1px solid var(--border); }
.why h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); }
.why-sub { color: var(--text-dim); max-width: 640px; margin: 12px 0 36px; }
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.why-grid article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.why-grid h3 { font-size: 1.05rem; margin-bottom: 8px; }
.why-grid p { color: var(--text-dim); font-size: 0.92rem; margin: 0; }

/* Explainer */
.explainer { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; }
.explainer summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--text-dim); list-style: none; display: flex; align-items: center; gap: 8px; }
.explainer summary::before { content: "+"; font-family: var(--mono); color: var(--brand); font-weight: 700; }
.explainer[open] summary::before { content: "–"; }
.explainer summary::-webkit-details-marker { display: none; }
.explainer ul { margin: 14px 0 0; padding-left: 20px; color: var(--text-dim); font-size: 0.9rem; }
.explainer li { margin-bottom: 7px; }
.explainer strong { color: var(--text); }

/* Acquire */
.acquire { padding: 20px 0 72px; }
.acquire-inner {
  background: linear-gradient(135deg, rgba(91,140,255,0.1), rgba(124,77,255,0.1));
  border: 1px solid var(--border-light); border-radius: 20px; padding: 44px; text-align: center;
}
.acquire-badge { display: inline-block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; color: var(--brand); margin-bottom: 14px; }
.acquire h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.acquire p { color: var(--text-dim); max-width: 560px; margin: 14px auto 26px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; }
.footer-inner { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; }
.footer-note { color: var(--text-faint); font-size: 0.82rem; max-width: 560px; margin: 0; }
.footer-copy { color: var(--text-faint); font-size: 0.85rem; margin: 0; }
.footer-copy a { color: var(--text-dim); }
.footer-copy a:hover { color: var(--brand); }

@media (max-width: 880px) {
  .tools-layout { grid-template-columns: 1fr; }
  .tool-tabs { position: static; flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .tab { white-space: nowrap; flex-shrink: 0; }
  .tab.active { box-shadow: inset 0 -3px 0 var(--brand); }
  .calc-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .header-nav { gap: 14px; font-size: 0.85rem; }
  .brand { font-size: 0.98rem; }
  .brand-mark { flex-shrink: 0; }
  .header-nav .nav-hide-sm { display: none; }
  .hero { padding: 56px 0 40px; }
  .hero-stats { gap: 28px; }
  .why-grid { grid-template-columns: 1fr; }
  .variant-row { grid-template-columns: 1fr; }
  .acquire-inner { padding: 30px 22px; }
  .calc-card { padding: 20px; }
}

/* ============================================================
   Theme toggle button
   ============================================================ */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-light);
  color: var(--text); cursor: pointer; font-size: 1.05rem; line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}
.theme-toggle:hover { background: var(--surface-2); border-color: var(--brand); }
.theme-icon { pointer-events: none; }

/* ============================================================
   Disclaimer / liability banner + freshness stamp
   ============================================================ */
.disclaimer {
  background: linear-gradient(135deg, rgba(91,140,255,0.08), rgba(124,77,255,0.08));
  border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 14px 18px; color: var(--text-dim); font-size: 0.88rem; line-height: 1.5;
  display: flex; gap: 12px; align-items: flex-start;
}
.disclaimer strong { color: var(--text); }
.disclaimer .disc-icon { flex-shrink: 0; font-size: 1rem; line-height: 1.5; }
.reviewed {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--text-faint); font-family: var(--mono);
}
.reviewed::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* ============================================================
   Guides section (homepage) + related guides (articles)
   ============================================================ */
.guides { padding: 56px 0; border-top: 1px solid var(--border); }
.guides h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); }
.guides-sub { color: var(--text-dim); max-width: 640px; margin: 12px 0 32px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.guide-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; transition: border-color 0.15s, transform 0.12s;
}
.guide-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.guide-card h3 { font-size: 1.05rem; }
.guide-card p { color: var(--text-dim); font-size: 0.9rem; margin: 0; }
.guide-card .guide-more { color: var(--brand); font-weight: 600; font-size: 0.85rem; margin-top: auto; }

/* ============================================================
   Email capture (Netlify form)
   ============================================================ */
.capture { padding: 20px 0 64px; }
.capture-inner {
  background: linear-gradient(135deg, rgba(91,140,255,0.10), rgba(124,77,255,0.10));
  border: 1px solid var(--border-light); border-radius: 20px; padding: 40px; text-align: center;
}
.capture h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.capture p.capture-sub { color: var(--text-dim); max-width: 560px; margin: 12px auto 24px; }
.capture-form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; flex-wrap: wrap; }
.capture-form .field { flex: 1; min-width: 200px; }
.capture-form input[type="email"] {
  flex: 1; min-width: 0; width: 100%; background: transparent; border: none; color: var(--text);
  font-family: var(--sans); font-size: 1rem; padding: 13px 14px;
}
.capture-form input[type="email"]:focus { outline: none; }
.capture-form button { flex-shrink: 0; }
.form-status { margin: 16px auto 0; max-width: 460px; color: var(--green); font-weight: 600; font-size: 0.92rem; }
.form-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.capture-fine { color: var(--text-faint); font-size: 0.78rem; margin: 16px auto 0; max-width: 460px; }

/* ============================================================
   Affiliate slots (config-driven, hidden while empty)
   ============================================================ */
.aff-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 18px 20px; margin: 18px 0;
}
.aff-tag {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
  color: var(--text-faint); border: 1px solid var(--border-light); border-radius: 6px; padding: 3px 8px;
}
.aff-body { flex: 1; min-width: 200px; }
.aff-label { font-weight: 700; margin: 0; color: var(--text); }
.aff-blurb { color: var(--text-dim); font-size: 0.9rem; margin: 4px 0 0; }
.aff-cta { color: var(--brand); font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.aff-cta:hover { text-decoration: underline; }

/* Reserved ad slot (no ad script; container only) */
.ad-slot { margin: 28px 0; min-height: 0; }

/* ============================================================
   Article pages
   ============================================================ */
.breadcrumbs { font-size: 0.82rem; color: var(--text-faint); padding: 22px 0 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.breadcrumbs li { display: flex; gap: 8px; align-items: center; }
.breadcrumbs li:not(:last-child)::after { content: "/"; color: var(--border-light); }
.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs [aria-current="page"] { color: var(--text-dim); }

.article { padding: 8px 0 40px; }
.article-wrap { max-width: 760px; margin: 0 auto; }
.article-head { margin: 8px 0 28px; }
.article-head .eyebrow { margin-bottom: 14px; }
.article h1 { font-size: clamp(2rem, 4.6vw, 3rem); font-weight: 800; margin-bottom: 16px; }
.article .lede { font-size: 1.15rem; color: var(--text-dim); margin: 0 0 20px; }
.article-meta { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

.prose { color: var(--text); }
.prose h2 { font-size: 1.5rem; margin: 40px 0 14px; }
.prose h3 { font-size: 1.18rem; margin: 28px 0 10px; }
.prose p { color: var(--text-dim); margin: 0 0 16px; }
.prose ul, .prose ol { color: var(--text-dim); margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--text); }
.prose a { color: var(--brand); font-weight: 500; }
.prose a:hover { text-decoration: underline; }
.prose code {
  font-family: var(--mono); font-size: 0.9em; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; color: var(--text);
}
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 0.92rem; }
.prose table th, .prose table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.prose table th { color: var(--text); font-weight: 700; background: var(--surface-2); }
.prose table td { color: var(--text-dim); }
.table-scroll { overflow-x: auto; }

.callout {
  background: var(--surface); border: 1px solid var(--border-light); border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm); padding: 16px 18px; margin: 22px 0; color: var(--text-dim); font-size: 0.94rem;
}
.callout strong { color: var(--text); }

.tool-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(135deg, rgba(91,140,255,0.10), rgba(124,77,255,0.10));
  border: 1px solid var(--border-light); border-radius: var(--radius); padding: 22px 24px; margin: 28px 0;
}
.tool-cta div { min-width: 220px; }
.tool-cta h3 { font-size: 1.1rem; margin-bottom: 4px; }
.tool-cta p { color: var(--text-dim); font-size: 0.9rem; margin: 0; }

/* Data / sources block */
.data-block {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin: 28px 0;
}
.data-block h2 { margin-top: 0; font-size: 1.2rem; }
.data-block ul { margin: 12px 0 0; padding-left: 20px; }
.data-block li { font-size: 0.88rem; }

/* FAQ */
.faq { margin: 40px 0 0; }
.faq h2 { font-size: 1.5rem; margin-bottom: 14px; }
.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 18px; margin-bottom: 10px; background: var(--surface);
}
.faq summary {
  cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none;
  display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--brand); font-weight: 700; flex-shrink: 0; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--text-dim); margin: 0 0 14px; }

/* Related guides */
.related { margin: 44px 0 0; padding-top: 32px; border-top: 1px solid var(--border); }
.related h2 { font-size: 1.3rem; margin-bottom: 18px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

@media (max-width: 880px) {
  .guide-grid { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .guide-grid { grid-template-columns: 1fr; }
  .capture-inner { padding: 28px 20px; }
  .tool-cta { flex-direction: column; align-items: flex-start; }
}
