/* ==========================================================================
   TheWealthCalc — Design tokens (matches thesalarycalc.com / thetimecalc.com)
   ========================================================================== */

:root {
  --paper: #f7f7f6;
  --paper-raised: #fff;
  --ink: #1c1e20;
  --ink-soft: #55585c;
  --line: #e3e3e1;
  --line-strong: #c9c9c6;
  --accent: #3d6b94;
  --accent-deep: #1f3a54;
  --accent-tint: #eaf0f5;
  --teal: #0f6e56;
  --teal-tint: #e7f3ef;
  --warn: #8c3b2e;
  --warn-tint: #f7ece9;
  --radius: 3px;
  --max-w: 1120px;
  --step-0: clamp(1rem, .95rem + .2vw, 1.0625rem);
  --step-1: clamp(1.25rem, 1.15rem + .5vw, 1.5rem);
  --step-2: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
  --step-3: clamp(2.25rem, 1.85rem + 1.8vw, 3.25rem);
  --step-4: clamp(2.75rem, 2.1rem + 2.8vw, 4.25rem);
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "system-ui", sans-serif;
}

*, :before, :after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  margin: 0;
  line-height: 1.5;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

@media (prefers-reduced-motion: reduce) {
  *, :before, :after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  position: absolute; overflow: hidden;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
@media (width <= 640px) { .container { padding: 0 16px; } }

.skip-link {
  background: var(--ink); color: var(--paper); z-index: 100;
  border-radius: var(--radius); padding: 12px 20px;
  position: absolute; top: 0; left: -9999px;
}
.skip-link:focus { top: 16px; left: 16px; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header { border-bottom: 1px solid var(--line); background: var(--paper-raised); position: sticky; top: 0; z-index: 40; }
.site-header__inner { justify-content: space-between; align-items: center; padding-block: 20px; display: flex; gap: 16px; }
.site-header__logo { letter-spacing: -.01em; font-size: 1.25rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.site-header__dot { color: var(--accent); }

.site-header__nav { gap: 32px; display: flex; align-items: center; }
.site-header__nav a { color: var(--ink-soft); font-size: .9375rem; font-weight: 500; text-decoration: none; transition: color .15s; }
.site-header__nav a:hover, .site-header__nav a[aria-current="page"] { color: var(--ink); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-strong);
  border-radius: var(--radius); width: 40px; height: 40px;
  align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (width <= 720px) {
  .site-header__nav {
    display: none; flex-direction: column; align-items: flex-start; gap: 4px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper-raised); border-bottom: 1px solid var(--line);
    padding: 8px 16px 20px;
  }
  .site-header__nav.is-open { display: flex; }
  .site-header__nav a { padding: 10px 0; width: 100%; }
  .nav-toggle { display: inline-flex; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { border-top: 1px solid var(--line); margin-top: 96px; padding-block: 48px 32px; }
.site-footer__inner { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 32px; display: grid; }
.site-footer__name { font-weight: 700; }
.site-footer__tagline { color: var(--ink-soft); margin-top: 8px; font-size: .9375rem; max-width: 34ch; }
.site-footer__heading { text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 12px; font-size: .8125rem; }
.site-footer__links { flex-direction: column; gap: 8px; display: flex; }
.site-footer__links a { color: var(--ink); font-size: .9375rem; text-decoration: none; }
.site-footer__links a:hover { color: var(--accent); }
.site-footer__bottom {
  border-top: 1px solid var(--line); color: var(--ink-soft); padding-top: 24px;
  font-size: .8125rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.site-footer__bottom a { color: var(--ink-soft); text-decoration: none; }
.site-footer__bottom a:hover { color: var(--accent); }
.site-footer__credit { color: var(--ink-soft); }
.site-footer__credit a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.site-footer__credit a:hover { color: var(--accent); }

@media (width <= 900px) { .site-footer__inner { grid-template-columns: 1fr 1fr; } }
@media (width <= 560px) { .site-footer__inner { grid-template-columns: 1fr; } }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { padding-block: 64px 48px; }
.hero__eyebrow {
  display: inline-block; color: var(--accent-deep); background: var(--accent-tint);
  font-size: .8125rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  padding: 6px 12px; border-radius: var(--radius); margin-bottom: 20px;
}
.hero__title { font-size: var(--step-4); font-weight: 700; letter-spacing: -.02em; line-height: 1.08; max-width: 16ch; }
.hero__subtitle { font-size: var(--step-1); color: var(--ink-soft); margin-top: 20px; max-width: 46ch; font-weight: 400; }
.hero__actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

@media (width <= 640px) { .hero { padding-block: 40px 32px; } }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius); font-weight: 600; font-size: .9375rem;
  padding: 13px 24px; text-decoration: none; border: 1px solid transparent;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--accent-deep); }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--ink); }

/* ==========================================================================
   Section headings
   ========================================================================== */

.section { padding-block: 56px; }
.section--tight { padding-block: 32px; }
.section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; }
.section__title { font-size: var(--step-2); font-weight: 700; letter-spacing: -.015em; }
.section__desc { color: var(--ink-soft); margin-top: 8px; max-width: 56ch; }
.section__link { font-size: .9375rem; font-weight: 600; color: var(--accent-deep); text-decoration: none; white-space: nowrap; }
.section__link:hover { text-decoration: underline; }

/* ==========================================================================
   Calculator grid / cards
   ========================================================================== */

.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.calc-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised);
  padding: 22px 20px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s;
  display: flex; flex-direction: column; gap: 6px;
}
.calc-card:hover { border-color: var(--accent); }
.calc-card__icon { width: 22px; height: 22px; color: var(--accent); margin-bottom: 6px; }
.calc-card__title { font-weight: 600; font-size: 1.0625rem; }
.calc-card__desc { color: var(--ink-soft); font-size: .875rem; line-height: 1.45; }

.calc-card--popular { border-color: var(--line-strong); }
.calc-card__tag {
  align-self: flex-start; font-size: .6875rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--teal); background: var(--teal-tint);
  padding: 3px 8px; border-radius: var(--radius); margin-bottom: 4px;
}

@media (width <= 900px) { .calc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (width <= 560px) { .calc-grid { grid-template-columns: 1fr; } }

.category-block { padding-block: 40px; border-top: 1px solid var(--line); }
.category-block:first-of-type { border-top: none; }
.category-block__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.category-block__title { font-size: var(--step-1); font-weight: 700; }
.category-block__count { color: var(--ink-soft); font-size: .875rem; }

/* ==========================================================================
   Calculator tool (input + result)
   ========================================================================== */

.calc-tool {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised);
  display: grid; grid-template-columns: 1.1fr 1fr;
}
.calc-tool__inputs { padding: 32px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 28px; }
.calc-tool__results { padding: 32px; background: var(--paper); display: flex; flex-direction: column; gap: 24px; }

@media (width <= 860px) {
  .calc-tool { grid-template-columns: 1fr; }
  .calc-tool__inputs { border-right: none; border-bottom: 1px solid var(--line); }
}

.field { display: flex; flex-direction: column; gap: 10px; }
.field__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field__label { font-size: .8125rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); }
.field__value-wrap { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--paper); flex-shrink: 0; }
.field__prefix, .field__suffix { padding: 8px 10px; color: var(--ink-soft); font-size: .9375rem; background: var(--line); }
.field__input {
  border: none; background: transparent; padding: 8px 8px; font-size: 1rem; font-weight: 600;
  width: 8ch; text-align: right; -moz-appearance: textfield;
}
.field__input::-webkit-outer-spin-button, .field__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field__input:focus { outline: none; }

.field__range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  background: var(--line-strong); border-radius: 4px; outline: none;
}
.field__range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 3px solid var(--paper-raised); box-shadow: 0 0 0 1px var(--accent);
}
.field__range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer;
  border: 3px solid var(--paper-raised); box-shadow: 0 0 0 1px var(--accent);
}
.field__range-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-soft); margin-top: 2px; }

.field--select select {
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper);
  padding: 10px 12px; font-size: .9375rem; width: 100%;
}

.result-hero { text-align: left; }
.result-hero__label { font-size: .8125rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); }
.result-hero__value { font-size: var(--step-3); font-weight: 700; letter-spacing: -.02em; margin-top: 6px; color: var(--accent-deep); }

.result-row { display: flex; justify-content: space-between; align-items: baseline; padding-block: 12px; border-top: 1px solid var(--line); }
.result-row:first-of-type { border-top: 1px solid var(--line); }
.result-row__label { color: var(--ink-soft); font-size: .9375rem; display: flex; align-items: center; gap: 8px; }
.result-row__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.result-row__value { font-weight: 600; font-size: 1.0625rem; }

.breakdown-bar { height: 10px; border-radius: 6px; overflow: hidden; display: flex; background: var(--line); }
.breakdown-bar__segment { height: 100%; }

.result-note {
  font-size: .8125rem; color: var(--ink-soft); background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; line-height: 1.5;
}

.calc-chart { width: 100%; height: 160px; margin-top: 4px; }

/* ==========================================================================
   Content: explanation, methodology, FAQ
   ========================================================================== */

.prose { max-width: 72ch; }
.prose > * + * { margin-top: 16px; }
.prose h2 { font-size: var(--step-1); font-weight: 700; margin-top: 40px; letter-spacing: -.01em; }
.prose h3 { font-size: 1.125rem; font-weight: 700; margin-top: 28px; }
.prose p { color: var(--ink-soft); line-height: 1.7; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { color: var(--ink-soft); line-height: 1.7; margin-top: 6px; }
.prose li + li { margin-top: 6px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code { background: var(--paper-raised); border: 1px solid var(--line); border-radius: 3px; padding: 2px 6px; font-size: .875em; }

.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item__q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 18px 4px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-weight: 600; font-size: 1rem;
}
.faq-item__icon { flex-shrink: 0; width: 18px; height: 18px; transition: transform .15s; color: var(--ink-soft); }
.faq-item[open] .faq-item__icon { transform: rotate(45deg); }
.faq-item__a { padding: 0 4px 18px; color: var(--ink-soft); line-height: 1.65; max-width: 68ch; }

.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (width <= 900px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (width <= 560px) { .related-grid { grid-template-columns: 1fr; } }
.related-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  text-decoration: none; color: var(--ink); font-size: .9375rem; font-weight: 500; transition: border-color .15s;
}
.related-card:hover { border-color: var(--accent); color: var(--accent-deep); }

.breadcrumb { font-size: .8125rem; color: var(--ink-soft); padding-block: 20px 0; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb__sep { margin-inline: 6px; }

.page-head { padding-block: 32px 40px; }
.page-head__title { font-size: var(--step-3); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; max-width: 22ch; }
.page-head__desc { color: var(--ink-soft); margin-top: 16px; max-width: 60ch; font-size: 1.0625rem; }

.disclaimer-strip {
  background: var(--accent-tint); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; font-size: .8125rem; color: var(--accent-deep); display: flex; gap: 10px; align-items: flex-start;
}
.disclaimer-strip svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; }

.trust-strip { display: flex; gap: 28px; flex-wrap: wrap; padding-block: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-block: 8px; }
.trust-strip__item { display: flex; align-items: center; gap: 10px; font-size: .875rem; color: var(--ink-soft); }
.trust-strip__item svg { width: 18px; height: 18px; color: var(--teal); flex-shrink: 0; }

/* Simple data table (amortization / cash-flow schedules) */
.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 480px; }
.data-table th, .data-table td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th { background: var(--paper); color: var(--ink-soft); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.data-table tbody tr:last-child td { border-bottom: none; }

.cashflow-row { display: flex; gap: 10px; align-items: center; }
.cashflow-row input { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 8px 10px; background: var(--paper); width: 100%; }
.cashflow-row__remove { background: none; border: none; color: var(--ink-soft); cursor: pointer; padding: 6px; flex-shrink: 0; }
.cashflow-row__remove:hover { color: var(--warn); }
.link-btn { background: none; border: none; color: var(--accent-deep); font-weight: 600; font-size: .875rem; cursor: pointer; padding: 8px 0; text-align: left; }
.link-btn:hover { text-decoration: underline; }

/* About / static pages */
.static-page .prose h2:first-child { margin-top: 0; }

/* AdSense-reserved slot (kept clean, unused until approved) */
.ad-slot { display: none; }
