/* ==========================================================================
   CentralCalc.com — shared stylesheet
   One file for the whole site. Mobile-first, no framework.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------ */
:root {
  --navy:        #1e293b;   /* primary / headings */
  --navy-700:    #334155;
  --navy-500:    #64748b;   /* muted text */
  --accent:      #0d9488;   /* single confident accent (teal) */
  --accent-dark: #0f766e;
  --accent-soft: #ccfbf1;
  --bg:          #f8fafc;   /* page background */
  --card:        #ffffff;
  --line:        #e2e8f0;   /* borders */
  --line-strong: #cbd5e1;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --ok:          #15803d;
  --warn-bg:     #fffbeb;
  --warn-line:   #fde68a;
  --warn-text:   #92400e;

  --radius:      18px;
  --radius-sm:   12px;
  --radius-lg:   26px;
  /* Soft, layered, navy-tinted shadows (modern depth, not flat gray) */
  --shadow:      0 1px 2px rgba(15,23,42,.04), 0 10px 30px -12px rgba(15,23,42,.16);
  --shadow-lg:   0 28px 70px -28px rgba(15,23,42,.30);
  --shadow-accent: 0 12px 28px -10px rgba(13,148,136,.55);
  --maxw:        900px;
  --maxw-narrow: 720px;

  /* Gradients for buttons, accents and the result card */
  --grad-accent: linear-gradient(135deg, #0d9488 0%, #0e7490 100%);
  --grad-navy:   linear-gradient(150deg, #1e293b 0%, #0b1220 100%);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Reset / base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  /* Soft, static color glows behind the content — subtle modern depth */
  background-image:
    radial-gradient(48rem 38rem at 108% -6%, rgba(13,148,136,.12), transparent 60%),
    radial-gradient(42rem 34rem at -12% -4%, rgba(37,99,235,.07), transparent 58%);
  background-repeat: no-repeat;
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--navy); line-height: 1.18; font-weight: 800; }
h1 { font-size: clamp(2rem, 6vw, 3rem); margin: .2em 0 .35em; letter-spacing: -.035em; }
h2 { font-size: clamp(1.45rem, 3.6vw, 1.95rem); margin: 1.8em 0 .5em; letter-spacing: -.025em; }
h3 { font-size: 1.18rem; margin: 1.4em 0 .4em; letter-spacing: -.015em; }
p  { margin: 0 0 1em; }

.muted { color: var(--text-muted); }
.center { text-align: center; }

/* ---- Layout helpers ----------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
.container--narrow { max-width: var(--maxw-narrow); }

.section { margin: 2.2rem 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}
@media (min-width: 640px) { .card { padding: 32px; } }

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

/* ---- Header / nav ------------------------------------------------------- */
.site-header {
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(226,232,240,.8);
  position: sticky; top: 0; z-index: 50;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: var(--card); }
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; height: 62px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 1.2rem; color: var(--navy);
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; flex: 0 0 auto; }
.brand__name b { color: var(--accent-dark); }

.nav__links { display: flex; align-items: center; gap: 6px; }
.nav__links a {
  color: var(--navy-700); font-weight: 600; font-size: .98rem;
  padding: 8px 13px; border-radius: 10px;
  transition: background .14s ease, color .14s ease;
}
.nav__links a:hover { background: rgba(13,148,136,.1); text-decoration: none; color: var(--accent-dark); }

.nav__toggle {
  display: none; background: none; border: 1px solid var(--line-strong);
  border-radius: 9px; width: 44px; height: 40px; cursor: pointer;
  align-items: center; justify-content: center; color: var(--navy);
}
.nav__toggle svg { width: 22px; height: 22px; }

@media (max-width: 640px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--card); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); padding: 8px;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 13px 12px; border-radius: 8px; }
}

/* ---- Hero --------------------------------------------------------------- */
.hero { padding: 2.8rem 0 1.1rem; }
.hero p.lede { font-size: 1.22rem; color: var(--navy-700); max-width: 60ch; line-height: 1.55; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: .1em;
  font-size: .74rem; font-weight: 800; color: var(--accent-dark);
  background: rgba(204,251,241,.7); border: 1px solid rgba(13,148,136,.22);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 12px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent); box-shadow: 0 0 0 3px rgba(13,148,136,.18);
}

/* ---- Breadcrumb --------------------------------------------------------- */
.breadcrumb { font-size: .85rem; color: var(--text-muted); padding: 14px 0 0; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-dark); }

/* ---- Calculator form ---------------------------------------------------- */
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 560px) { .calc-grid { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; }
.field label { font-weight: 700; color: var(--navy); margin-bottom: 4px; font-size: .98rem; }
.field .help { font-size: .82rem; color: var(--text-muted); margin: 0 0 7px; line-height: 1.4; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .affix {
  position: absolute; color: var(--text-muted); font-weight: 600; font-size: 1rem;
  pointer-events: none;
}
.input-wrap .affix--prefix { left: 13px; }
.input-wrap .affix--suffix { right: 13px; }

.field input[type="number"],
.field input[type="text"],
.field select {
  width: 100%;
  font: inherit; font-size: 1.05rem;
  padding: 13px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff; color: var(--text);
  -webkit-appearance: none; appearance: none;
  min-height: 50px; /* comfortable phone tap target */
}
.input-wrap.has-prefix input { padding-left: 30px; }
.input-wrap.has-suffix input { padding-right: 34px; }

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 38px; cursor: pointer;
}
.field input, .field select { transition: border-color .15s ease, box-shadow .15s ease; }
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(13,148,136,.16);
}
.field input:hover, .field select:hover { border-color: var(--navy-500); }

.calc-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.btn {
  font: inherit; font-weight: 700; font-size: 1.05rem;
  border: 0; border-radius: var(--radius-sm); cursor: pointer;
  padding: 15px 28px; min-height: 54px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, filter .14s ease;
}
.btn--primary {
  background: var(--grad-accent); color: #fff; box-shadow: var(--shadow-accent);
  letter-spacing: .01em;
}
.btn--primary:hover { text-decoration: none; transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 16px 34px -10px rgba(13,148,136,.6); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost {
  background: #fff; color: var(--navy-700); border: 1.5px solid var(--line-strong);
}
.btn--ghost:hover { background: var(--bg); border-color: var(--navy-500); transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid rgba(13,148,136,.4); outline-offset: 2px; }

/* Error / validation message */
.calc-error {
  display: none; margin-top: 14px;
  background: var(--warn-bg); border: 1px solid var(--warn-line);
  color: var(--warn-text); padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: .92rem; font-weight: 600;
}
.calc-error.is-visible { display: block; }

/* ---- Results ------------------------------------------------------------ */
.result-card {
  position: relative; overflow: hidden;
  background: var(--grad-navy);
  color: #fff; border-radius: var(--radius-lg); padding: 30px 26px;
  text-align: center; box-shadow: var(--shadow-lg);
}
/* Soft teal glow inside the dark result card */
.result-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(28rem 14rem at 90% -20%, rgba(94,234,212,.22), transparent 60%),
    radial-gradient(22rem 12rem at 0% 120%, rgba(37,99,235,.18), transparent 60%);
}
.result-card > * { position: relative; }
.result-card .result-label {
  text-transform: uppercase; letter-spacing: .1em; font-size: .8rem;
  font-weight: 700; color: #99f6e4; margin-bottom: 6px;
}
.result-card .result-value {
  font-size: clamp(2.8rem, 12vw, 4rem); font-weight: 800; line-height: 1.02;
  color: #fff; letter-spacing: -.035em;
}
.result-card .result-value .accent-pulse { color: #5eead4; }
.result-card .result-sub { color: #cbd5e1; font-size: .95rem; margin-top: 8px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
@media (min-width: 620px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent-soft); }
.tile .tile-label { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.tile .tile-value { font-size: 1.34rem; font-weight: 800; color: var(--navy); margin-top: 3px; letter-spacing: -.02em; }

/* ---- Chart -------------------------------------------------------------- */
.chart-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.chart-legend .key { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; font-weight: 600; }
.chart-legend .swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.swatch--principal { background: var(--accent); }
.swatch--interest  { background: #f59e0b; }

/* ---- Tables ------------------------------------------------------------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -2px; }
table.data {
  width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 480px;
}
table.data caption { text-align: left; color: var(--text-muted); font-size: .85rem; padding-bottom: 8px; }
table.data th, table.data td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { color: var(--navy); font-weight: 700; border-bottom: 2px solid var(--line-strong); position: sticky; top: 0; background: var(--card); }
table.data tbody tr.year-row { font-weight: 600; }
table.data tbody tr.month-row td { color: var(--text-muted); font-weight: 400; background: var(--bg); }
table.data tbody tr.month-row td:first-child { padding-left: 26px; }

.table-toggle { margin-top: 14px; }

details.schedule > summary {
  cursor: pointer; font-weight: 700; color: var(--accent-dark);
  list-style: none; padding: 10px 0; user-select: none;
}
details.schedule > summary::-webkit-details-marker { display: none; }
details.schedule > summary::before { content: "▸ "; }
details.schedule[open] > summary::before { content: "▾ "; }

/* ---- FAQ accordion ------------------------------------------------------ */
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 10px; background: var(--card); overflow: hidden;
}
.faq summary {
  cursor: pointer; font-weight: 700; color: var(--navy); padding: 16px 18px;
  list-style: none; position: relative; padding-right: 46px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; color: var(--accent-dark); line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq summary:hover { background: var(--bg); }
.faq .faq-body { padding: 0 18px 16px; color: var(--navy-700); }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---- Glossary ----------------------------------------------------------- */
dl.glossary { margin: 0; }
dl.glossary dt { font-weight: 700; color: var(--navy); margin-top: 14px; }
dl.glossary dd { margin: 2px 0 0; color: var(--navy-700); }

/* ---- Prose / content blocks --------------------------------------------- */
.prose p, .prose li { color: var(--navy-700); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.worked-example {
  background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 16px 18px; margin: 16px 0;
}
.worked-example code, .formula code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em; background: #eef2f7; padding: 2px 6px; border-radius: 5px;
}
.formula {
  background: var(--navy); color: #e2e8f0; border-radius: var(--radius-sm);
  padding: 16px 18px; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem; line-height: 1.7;
}
.formula code { background: rgba(255,255,255,.08); color: #5eead4; }

/* ---- Disclaimer bar ----------------------------------------------------- */
.disclaimer {
  background: var(--warn-bg); border: 1px solid var(--warn-line);
  color: var(--warn-text); border-radius: var(--radius-sm);
  padding: 14px 16px; font-size: .88rem; line-height: 1.55;
}
.disclaimer strong { color: var(--warn-text); }

/* ---- Ad slots ----------------------------------------------------------- */
.ad-slot {
  margin: 26px 0; min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: repeating-linear-gradient(45deg, #fff, #fff 12px, #fcfdfe 12px, #fcfdfe 24px);
  color: transparent; /* nothing visible when empty */
  position: relative;
}
/* The faint "Advertisement" label only appears once a real ad is inserted.
   Note: each empty slot still contains an HTML comment, so `:empty` won't match.
   `:has(*)` matches only when a real ELEMENT (the ad unit) is present —
   comments aren't elements — so empty slots stay unlabeled. `.has-ad` is a
   manual fallback for older browsers without :has() support. */
.ad-slot::before {
  content: "Advertisement"; position: absolute; top: 6px; left: 10px;
  font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); opacity: 0; transition: opacity .2s;
}
.ad-slot:has(*)::before,
.ad-slot.has-ad::before { opacity: .65; }
/* Collapse the dashed placeholder box entirely until a real ad lands, so empty
   slots are invisible and never look broken. */
.ad-slot:not(:has(*)):not(.has-ad) {
  border: 0; min-height: 0; margin: 0; background: none;
}
/* Keep empty slots from looking broken — collapse the dashed box on tiny screens is fine as-is */

/* ---- Card grid (homepage calculator list) ------------------------------- */
.calc-cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 620px) { .calc-cards { grid-template-columns: 1fr 1fr; } }
.calc-cards .calc-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 7px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
/* Accent line that wipes across the top on hover */
.calc-cards .calc-card::after {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: var(--grad-accent); transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.calc-cards .calc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent-soft); text-decoration: none; }
.calc-cards .calc-card:hover::after { transform: scaleX(1); }
.calc-card .calc-card__icon {
  width: 48px; height: 48px; padding: 11px; color: var(--accent-dark);
  background: linear-gradient(135deg, var(--accent-soft), #e0f7f3);
  border: 1px solid rgba(13,148,136,.18); border-radius: 14px; margin-bottom: 2px;
}
.calc-card h3 { margin: 6px 0 0; }
.calc-card p { margin: 0; color: var(--text-muted); font-size: .94rem; }
.calc-card.soon { opacity: .72; cursor: default; }
.calc-card.soon:hover { transform: none; box-shadow: var(--shadow); border-color: var(--line); }
.badge-soon {
  align-self: flex-start; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--navy-500); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; margin-top: 4px;
}

/* ---- Feature strip ------------------------------------------------------ */
.features { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 8px; }
@media (min-width: 620px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { display: flex; gap: 12px; align-items: flex-start; }
.feature svg { width: 26px; height: 26px; color: var(--accent-dark); flex: 0 0 auto; margin-top: 2px; }
.feature h3 { margin: 0 0 2px; font-size: 1rem; }
.feature p { margin: 0; font-size: .9rem; color: var(--text-muted); }

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  margin-top: 3.5rem; background: var(--grad-navy); color: #cbd5e1;
  padding: 40px 0 30px; font-size: .92rem;
  border-top: 1px solid rgba(94,234,212,.18);
}
.site-footer a { color: #e2e8f0; }
.site-footer a:hover { color: #fff; }
.footer-top { display: flex; flex-wrap: wrap; gap: 18px 28px; justify-content: space-between; align-items: flex-start; }
.footer-brand { font-weight: 800; color: #fff; font-size: 1.1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-disclaimer { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--navy-700); color: var(--navy-500); font-size: .82rem; line-height: 1.5; }

/* ---- Articles / guides --------------------------------------------------- */
.article-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  color: var(--text-muted); font-size: .9rem; margin: 4px 0 6px;
}
.article-meta .dot { color: var(--line-strong); }
.article-body { font-size: 1.06rem; }
.article-body h2 { margin-top: 1.9em; }
.article-body h3 { margin-top: 1.5em; }
.article-body p, .article-body li { color: var(--navy-700); }
.article-body ul, .article-body ol { padding-left: 1.25em; }
.article-body li { margin-bottom: .5em; }
.article-body blockquote {
  margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--accent);
  color: var(--navy-700); font-style: italic;
}
.article-body table.data { margin: 1.2em 0; }

/* Key-takeaways box at the top of an article */
.takeaways {
  background: var(--accent-soft); border: 1px solid #99f6e4;
  border-radius: var(--radius); padding: 18px 20px; margin: 1.4rem 0;
}
.takeaways h2 { margin: 0 0 8px; font-size: 1.05rem; color: var(--accent-dark); }
.takeaways ul { margin: 0; padding-left: 1.15em; }
.takeaways li { margin-bottom: .35em; color: var(--navy-700); }

/* Inline "try the calculator" call-to-action box */
.cta-tool {
  position: relative; overflow: hidden;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  justify-content: space-between;
  background: var(--grad-navy); color: #e2e8f0; border-radius: var(--radius-lg);
  padding: 22px 24px; margin: 1.8rem 0; box-shadow: var(--shadow-lg);
}
.cta-tool::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(24rem 12rem at 100% 0%, rgba(94,234,212,.2), transparent 60%);
}
.cta-tool > * { position: relative; }
.cta-tool .cta-text { flex: 1 1 280px; }
.cta-tool h3 { color: #fff; margin: 0 0 3px; }
.cta-tool p { margin: 0; color: #cbd5e1; font-size: .94rem; }
.cta-tool .btn { flex: 0 0 auto; }

/* Related guides at the foot of an article (reuses .calc-cards grid) */
.guide-card .guide-tag {
  align-self: flex-start; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--accent-dark); background: var(--accent-soft);
  border-radius: 999px; padding: 2px 9px;
}
.guide-card .read-time { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }

/* ---- Utility ------------------------------------------------------------ */
.hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.toc-note { font-size: .9rem; color: var(--text-muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Keep in-page anchor targets clear of the sticky glass header */
html { scroll-padding-top: 84px; }

/* Subtle count-up entrance highlight on the headline result */
.result-card .result-value.is-counting { will-change: contents; }

/* ---- Reduced motion: respect the user's preference ---------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ==========================================================================
   Dark mode — automatic via the OS/browser preference.
   We override the design tokens, then patch the few components that hardcode
   light surfaces or use --navy as a background (which flips light in dark).
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --navy:        #f1f5f9;   /* headings/labels — now light */
    --navy-700:    #cbd5e1;
    --navy-500:    #94a3b8;
    --accent:      #14b8a6;
    --accent-dark: #5eead4;   /* links — readable on dark */
    --accent-soft: #122e29;
    --bg:          #0b1120;
    --card:        #141d31;
    --line:        #26324a;
    --line-strong: #3a4866;
    --text:        #e5e9f0;
    --text-muted:  #94a3b8;
    --warn-bg:     #2a2410;
    --warn-line:   #5c4d18;
    --warn-text:   #fcd34d;
    --shadow:      0 1px 2px rgba(0,0,0,.4), 0 12px 30px -12px rgba(0,0,0,.6);
    --shadow-lg:   0 30px 70px -28px rgba(0,0,0,.78);
    --shadow-accent: 0 12px 28px -10px rgba(20,184,166,.5);
    --grad-navy:   linear-gradient(150deg, #1b2740 0%, #0c1424 100%);
  }
  body {
    background-image:
      radial-gradient(48rem 38rem at 108% -6%, rgba(20,184,166,.16), transparent 60%),
      radial-gradient(42rem 34rem at -12% -4%, rgba(37,99,235,.13), transparent 58%);
  }
  .site-header { background: rgba(13,19,33,.72); border-bottom-color: rgba(148,163,184,.14); }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .site-header { background: var(--card); }
  }
  /* Inputs and ghost button hardcode white — give them a dark surface */
  .field input[type="number"], .field input[type="text"], .field select,
  .btn--ghost { background: #0f1827; }
  /* --navy flips light, so these navy-background blocks need an explicit dark bg */
  .formula { background: #0d1626; }
  .skip-link { background: #134e48; }
  .eyebrow { background: rgba(20,184,166,.12); border-color: rgba(45,212,191,.3); color: #5eead4; }
  .calc-card__icon {
    background: linear-gradient(135deg, #10302b, #0c241f);
    border-color: rgba(45,212,191,.22); color: #5eead4;
  }
  .takeaways { background: #0f241f; border-color: rgba(45,212,191,.24); }
  .takeaways h2 { color: #5eead4; }
  .worked-example code { background: rgba(148,163,184,.18); }
  .ad-slot { background: repeating-linear-gradient(45deg, #0f1827, #0f1827 12px, #131d31 12px, #131d31 24px); }
  .badge-soon { background: #0f1827; }
}
