/* CalcSherpa — design system (palette & type proposed by Grok, 2026-11-15) */
:root {
  --navy: #0b1f33;
  --navy-2: #12304d;
  --brand: #0f766e;
  --brand-hover: #115e59;
  --brand-soft: #e6f4f1;
  --accent: #f59e0b;
  --accent-soft: #fff4dc;
  --bg: #f7f9fb;
  --surface: #ffffff;
  --line: #e2e8f0;
  --text: #0b1f33;
  --muted: #475569;
  --good: #16a34a;
  --cost: #b45309;
  --chart3: #3b82f6;
  --chart4: #a855f7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11,31,51,.06), 0 8px 24px rgba(11,31,51,.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16.5px/1.65 var(--font); }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.015em; color: var(--navy); }
h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); line-height: 1.12; margin: 0 0 12px; font-weight: 800; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); line-height: 1.25; margin: 40px 0 12px; font-weight: 700; }
h3 { font-size: 1.1rem; margin: 24px 0 6px; font-weight: 700; }
.lead { color: var(--muted); font-size: 1.12rem; margin: 0 0 14px; max-width: 70ch; }
.num, .big, .stat b, table { font-variant-numeric: tabular-nums; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 22px; min-height: 66px; }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--navy); font-family: var(--display); font-weight: 800; font-size: 1.28rem; letter-spacing: -.02em; }
.logo b { color: var(--brand); font-weight: 800; }
.logo img { border-radius: 9px; }
.logo--light { color: #fff; }
.logo--light b { color: #5eead4; }
.top-nav { display: flex; gap: 4px; }
.top-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .94rem; padding: 8px 12px; border-radius: 8px; }
.top-nav a:hover { background: var(--bg); color: var(--navy); }
.head-search { position: relative; margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; width: 260px; color: var(--muted); }
.head-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.head-search input { border: 0; background: transparent; font: inherit; font-size: .94rem; padding: 9px 0; width: 100%; outline: none; color: var(--text); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .94rem; }
.search-results a:hover, .search-results a.on { background: var(--brand-soft); }
.search-results .empty { padding: 10px; color: var(--muted); font-size: .9rem; }

/* Home hero */
.hero { background: radial-gradient(1200px 400px at 85% -10%, rgba(94,234,212,.22), transparent 60%), linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 70%, #0f3d47 100%); color: #e8f0f7; padding: 64px 0 76px; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5vw, 3.3rem); max-width: 16ch; }
.hero h1 span { color: #5eead4; }
.hero .lead { color: #c3d3e2; font-size: 1.18rem; max-width: 56ch; }
.hero-search { position: relative; max-width: 620px; margin: 26px 0 18px; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 0 18px; box-shadow: 0 10px 30px rgba(0,0,0,.25); color: var(--muted); }
.hero-search .ico { width: 22px; height: 22px; }
.hero-search input { flex: 1; border: 0; font: inherit; font-size: 1.08rem; padding: 17px 0; outline: none; color: var(--text); background: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips span { color: #9fb4c7; font-size: .9rem; margin-right: 4px; }
.chips a { color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); text-decoration: none; padding: 6px 13px; border-radius: 999px; font-size: .9rem; font-weight: 500; }
.chips a:hover { background: rgba(255,255,255,.2); color: #fff; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero-card { display: grid; gap: 4px; background: #fff; color: var(--text); border-radius: 18px; padding: 22px 24px; box-shadow: 0 24px 60px rgba(0,0,0,.35); text-decoration: none; transform: rotate(1.2deg); transition: transform .2s; }
.hero-card:hover { transform: rotate(0); color: var(--text); }
.hc-tag { justify-self: start; background: var(--brand-soft); color: var(--brand); font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.hc-label { color: var(--muted); font-size: .85rem; margin-top: 8px; }
.hc-big { font-family: var(--display); font-size: 2.6rem; font-weight: 800; color: var(--brand); line-height: 1.05; font-variant-numeric: tabular-nums; }
.hc-row { display: flex; gap: 16px; align-items: center; margin: 10px 0 6px; }
.hc-row svg { width: 96px; height: 96px; flex: none; }
.hc-legend { display: grid; gap: 5px; font-size: .85rem; color: var(--muted); flex: 1; }
.hc-legend span { display: flex; align-items: center; gap: 7px; }
.hc-legend i { width: 9px; height: 9px; border-radius: 3px; }
.hc-legend b { margin-left: auto; color: var(--navy); }
.hc-note { color: var(--muted); font-size: .8rem; }
.hc-cta { color: var(--brand); font-weight: 700; margin-top: 8px; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } .hero-card { display: none; } }
.trustbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.trustbar .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding-top: 18px; padding-bottom: 18px; }
.trust-item { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--muted); line-height: 1.4; }
.trust-item .ico { color: var(--brand); margin-top: 2px; }
.trust-item b { display: block; color: var(--navy); font-size: .95rem; }
.section { padding: 46px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-head h2 { margin: 0 0 4px; }
.section-head p { margin: 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 18px; }
.card { display: flex; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
.card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.card-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.card-icon .ico { width: 22px; height: 22px; }
.cat-home .card-icon { background: var(--accent-soft); color: var(--cost); }
.cat-work .card-icon { background: #e8f0fe; color: #1d4ed8; }
.card-title { display: block; font-weight: 700; font-family: var(--display); color: var(--navy); }
.card-text { display: block; color: var(--muted); font-size: .9rem; line-height: 1.45; margin-top: 2px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step .n { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.step h3 { margin: 0 0 4px; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }
.home-copy { max-width: 760px; padding-bottom: 40px; }

/* Calculator page */
.page { padding-top: 26px; padding-bottom: 56px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.trustline { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: .86rem; color: var(--muted); margin: 4px 0 6px; }
.trustline span { display: inline-flex; align-items: center; gap: 6px; }
.trustline .ico { width: 16px; height: 16px; color: var(--brand); }
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; margin: 22px 0 8px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.calc > .tabs, .calc > .table-wrap { grid-column: 1 / -1; }
.calc--stack { grid-template-columns: 1fr; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px 16px; align-content: start; }
.field label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 5px; color: var(--navy); }
.field .hint { display: block; font-size: .76rem; color: var(--muted); font-weight: 400; }
.input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: #fff; }
.input span { padding: 0 10px; color: var(--muted); font-size: .95rem; }
.input input, .input select { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 500; padding: 11px 10px; outline: none; font-variant-numeric: tabular-nums; }
.results { background: linear-gradient(180deg, #f2faf8, #fff 60%); border: 1px solid #cfe9e3; border-radius: 14px; padding: 20px; position: sticky; top: 84px; }
.calc--stack .results { position: static; }
.big-label { color: var(--muted); font-size: .9rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.big { font-family: var(--display); font-size: clamp(2.2rem, 4.4vw, 3rem); font-weight: 800; color: var(--brand); line-height: 1.08; margin: 2px 0 6px; letter-spacing: -.02em; }
.chart { display: flex; gap: 18px; align-items: center; margin: 14px 0 6px; }
.chart svg { width: 128px; height: 128px; flex: none; }
.legend { display: grid; gap: 6px; font-size: .88rem; color: var(--muted); }
.legend div { display: flex; gap: 8px; align-items: baseline; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; transform: translateY(1px); }
.legend b { color: var(--navy); margin-left: auto; padding-left: 10px; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat small { color: var(--muted); font-size: .78rem; display: block; }
.stat b { display: block; font-size: 1.08rem; color: var(--navy); }
.takeaways { margin-top: 16px; background: var(--accent-soft); border: 1px solid #fde4ad; border-radius: 12px; padding: 12px 14px; }
.takeaways h4 { margin: 0 0 6px; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--cost); font-family: var(--font); }
.takeaways ul { margin: 0; padding-left: 18px; font-size: .92rem; }
.takeaways li { margin: 3px 0; }
.warn { color: var(--cost); font-weight: 600; }
.table-wrap { overflow-x: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: right; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; }
details.more summary { cursor: pointer; color: var(--brand); font-weight: 600; margin-top: 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { font: inherit; font-size: .9rem; font-weight: 600; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.calc td input { font: inherit; color: var(--text); background: #fbfcfd; border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; max-width: 130px; }
.calc td input:focus { outline: none; border-color: var(--brand); }

/* Article */
.article > :not(.calc) { max-width: 780px; }
.prose .article > * { max-width: 780px; }
.formula { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 14px 16px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .95rem; overflow-x: auto; }
.faq h3 { margin-top: 20px; }
.updated { color: var(--muted); font-size: .85rem; }
.sources { margin-top: 34px; font-size: .92rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px 12px; }
.sources h2 { font-size: 1.05rem; margin-top: 16px; }
.sources ul { padding-left: 18px; margin: 6px 0; }
.related { margin-top: 22px; }
.related h2 { font-size: 1.15rem; margin: 0 0 10px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.related a { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--navy); font-weight: 600; font-size: .95rem; }
.related a:hover { border-color: var(--brand); }
.related .ico { color: var(--brand); }
.pin-figure { margin: 36px 0 0; max-width: 260px; }
.pin-figure img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.pin-figure figcaption { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.prose { max-width: 760px; }

/* Ads (fixed min-height to avoid layout shift, clearly labeled) */
.ad-slot { margin: 26px 0; min-height: 280px; background: #f1f4f7; border: 1px dashed var(--line); border-radius: 12px; padding: 8px; max-width: 780px; }
.ad-label { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }

/* Footer */
.site-footer { background: var(--navy); color: #b8c7d6; margin-top: 30px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; padding-top: 44px; padding-bottom: 28px; }
.footer-grid h2 { color: #fff; font-size: .95rem; margin: 6px 0 10px; font-family: var(--font); letter-spacing: 0; }
.footer-grid a { color: #b8c7d6; text-decoration: none; display: block; padding: 3px 0; }
.footer-grid a:hover { color: #fff; }
.footer-brand p { max-width: 36ch; }
.footer-social { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-social a { display: inline; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; padding-bottom: 26px; font-size: .82rem; color: #8ea3b8; }

@media (max-width: 960px) {
  .calc { grid-template-columns: 1fr; }
  .results { position: static; }
  .top-nav { display: none; }
  .head-search { width: auto; flex: 1; max-width: 340px; }
  .trustbar .wrap { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .header-row { gap: 12px; }
  .logo span { display: none; }
  .hero { padding: 40px 0 48px; }
  .steps { grid-template-columns: 1fr; }
  .trustbar .wrap { grid-template-columns: 1fr; }
  .chart svg { width: 104px; height: 104px; }
  .calc { padding: 16px; }
  .footer-grid { grid-template-columns: 1fr; }
}
