/* ════════════════════════════════════════════════════════════════════════
   Renovate Cafe — design system
   A "drafting table / blueprint workshop" aesthetic: warm paper, blueprint
   ink, a carpenter-pencil amber accent, and Space Grotesk numerals built for
   a calculator. Light is the default; [data-theme="dark"] is a blueprint night.
   Self-hosted variable fonts. Vanilla CSS, no framework.
   ════════════════════════════════════════════════════════════════════════ */

/* ───────────────────────────── Fonts ───────────────────────────── */
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700;
  font-display: swap; src: url("/assets/fonts/spacegrotesk.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900;
  font-display: swap; src: url("/assets/fonts/inter.woff2") format("woff2");
}

/* ───────────────────────────── Tokens ───────────────────────────── */
:root {
  --paper:    #F7F4EE;
  --paper-2:  #EFEADF;
  --surface:  #FFFFFF;
  --surface-2:#FBF8F2;
  --ink:      #16212E;
  --ink-2:    #4C5660;   /* AA on paper */
  --ink-3:    #5F6770;   /* AA on paper (≥4.6:1) — used on real informational copy */
  --line:     #E4DDD0;
  --line-2:   #EDE7DB;

  --accent:    #C56A2D;  /* carpenter-pencil amber / cedar */
  --accent-ink:#A8551F;  /* AA text on paper */
  --accent-bg: #F6E7D7;
  --blueprint:    #2E5A7E;
  --blueprint-ink:#234A66;
  --blueprint-bg: #E2EAF1;

  --display: "Space Grotesk", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --shadow-sm: 0 1px 2px rgba(22,33,46,.05), 0 2px 8px rgba(22,33,46,.05);
  --shadow:    0 6px 18px rgba(22,33,46,.07), 0 20px 44px rgba(22,33,46,.08);
  --shadow-lg: 0 12px 28px rgba(22,33,46,.10), 0 36px 70px rgba(22,33,46,.13);

  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 22px;
  --wrap:      75rem;
  --measure:   40rem;

  --grid-line: rgba(46,90,126,.07);   /* blueprint grid on paper */
  --grain-opacity: .025;
  --grain-blend: multiply;

  /* default accent token = amber; calculators override via .calc-<name> */
  --c: var(--accent); --c-ink: var(--accent-ink); --c-bg: var(--accent-bg);
}

/* per-calculator accents (light) */
.calc-mulch      { --c:#6F7D2E; --c-ink:#566324; --c-bg:#ECEEDA; }
.calc-paint      { --c:#2E6FA8; --c-ink:#235784; --c-bg:#E0EAF3; }
.calc-concrete   { --c:#5B6770; --c-ink:#444E56; --c-bg:#E7E9EB; }
.calc-deck       { --c:#B0682F; --c-ink:#8A5022; --c-bg:#F4E7D7; }
.calc-fence      { --c:#4F7A47; --c-ink:#3B5E36; --c-bg:#E4EEDF; }
.calc-roofing    { --c:#9A4B3A; --c-ink:#79392C; --c-bg:#F1E2DD; }
.calc-drywall    { --c:#766A9A; --c-ink:#5A4F7C; --c-bg:#ECE7F2; }
.calc-tile       { --c:#2F8079; --c-ink:#23605A; --c-bg:#DDEDEA; }
.calc-flooring   { --c:#8A5A33; --c-ink:#6C4626; --c-bg:#EFE5D9; }
.calc-insulation { --c:#AE567D; --c-ink:#894262; --c-bg:#F4E2EB; }

/* ───────────────────────────── Dark theme ───────────────────────────── */
:root[data-theme="dark"] {
  --paper:    #0E1822;
  --paper-2:  #13212D;
  --surface:  #16242F;
  --surface-2:#1A2A36;
  --ink:      #E9EEF2;
  --ink-2:    #A6B3BD;
  --ink-3:    #8A98A2;   /* AA on blueprint-dark surfaces (≥4.5:1) */
  --line:     #253743;
  --line-2:   #1D2C37;

  --accent:    #E2873F;
  --accent-ink:#EE9C57;
  --accent-bg: #2A2016;
  --blueprint:    #6FA8D6;
  --blueprint-ink:#90C0E6;
  --blueprint-bg: #15242F;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 3px 12px rgba(0,0,0,.4);
  --shadow:    0 8px 22px rgba(0,0,0,.5), 0 28px 56px rgba(0,0,0,.55);
  --shadow-lg: 0 14px 30px rgba(0,0,0,.55), 0 40px 80px rgba(0,0,0,.65);

  --grid-line: rgba(111,168,214,.08);
  --grain-opacity: .04;
  --grain-blend: overlay;
}
:root[data-theme="dark"] .calc-mulch      { --c:#AEBE5E; --c-ink:#C2D072; --c-bg:#1E2417; }
:root[data-theme="dark"] .calc-paint      { --c:#5FA0DA; --c-ink:#85BBE8; --c-bg:#142230; }
:root[data-theme="dark"] .calc-concrete   { --c:#9AA6AF; --c-ink:#B4BEC5; --c-bg:#1B262C; }
:root[data-theme="dark"] .calc-deck       { --c:#DB9356; --c-ink:#E8AB74; --c-bg:#241B12; }
:root[data-theme="dark"] .calc-fence      { --c:#82B277; --c-ink:#9CC692; --c-bg:#172217; }
:root[data-theme="dark"] .calc-roofing    { --c:#D07E6B; --c-ink:#E0998a; --c-bg:#241713; }
:root[data-theme="dark"] .calc-drywall    { --c:#A99CD0; --c-ink:#C0B5E2; --c-bg:#1C1A28; }
:root[data-theme="dark"] .calc-tile       { --c:#56B3A9; --c-ink:#79CabF; --c-bg:#13231F; }
:root[data-theme="dark"] .calc-flooring   { --c:#C2895A; --c-ink:#D6A276; --c-bg:#221913; }
:root[data-theme="dark"] .calc-insulation { --c:#D684AB; --c-ink:#E5A1C2; --c-bg:#241620; }

/* ───────────────────────────── Base ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1.05rem; line-height: 1.7;
  font-feature-settings: "kern","liga","cv05";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}
/* faint film grain for a tactile, printed feel */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 2147483646; pointer-events: none;
  opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
img, svg { max-width: 100%; }
::selection { background: var(--c-bg); color: var(--ink); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--ink); }

h1, h2, h3, h4 {
  font-family: var(--display); font-weight: 600; line-height: 1.1;
  letter-spacing: -0.02em; color: var(--ink); margin: 0 0 .5em; text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.5rem); font-weight: 600; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.6vw, 2.2rem); }
h3 { font-size: 1.32rem; }
p { margin: 0 0 1.1em; text-wrap: pretty; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1.5rem; }
.muted { color: var(--ink-2); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .55em; font-family: var(--sans); font-weight: 700;
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 1rem;
}
.eyebrow.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.skip { position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 0 0 10px 0; }
.skip:focus { left: 0; }

/* Visible keyboard focus ring (WCAG 2.4.7) — keyboard-only, never on mouse click. */
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* tabular figures everywhere numbers matter */
.num, .result-hero-val, .result-list dd, .calc input, .stat-num { font-variant-numeric: tabular-nums; }

/* ───────────────────────────── Buttons ───────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5em; font-family: var(--sans);
  font-weight: 600; font-size: .95rem; line-height: 1; cursor: pointer; text-decoration: none;
  padding: .9em 1.45em; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); background: var(--surface);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s ease, background-color .18s, border-color .18s, color .18s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--ink-3); color: var(--ink); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; box-shadow: var(--shadow); }
:root[data-theme="dark"] .btn-primary { color: #0E1822; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn-sm { padding: .6em 1rem; font-size: .86rem; }
.btn .arr { transition: transform .2s ease; }
.btn:hover .arr { transform: translateX(3px); }

/* ───────────────────────────── Header ───────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  backdrop-filter: saturate(150%) blur(12px); -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--paper) 88%, transparent); }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--display);
  font-weight: 600; font-size: 1.24rem; letter-spacing: -0.03em; color: var(--ink); white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; flex: 0 0 auto; }
.nav { display: flex; gap: .1rem; margin-left: auto; }
.nav a { position: relative; color: var(--ink-2); font-weight: 500; font-size: .96rem; padding: .5rem .8rem; border-radius: 9px; transition: color .2s; }
.nav a::after { content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .3rem; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease; border-radius: 2px; }
.nav a:hover { color: var(--ink); } .nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: .25rem; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); border-radius: 11px; cursor: pointer; transition: border-color .2s, color .2s, transform .2s; }
.icon-btn:hover { border-color: var(--ink-3); color: var(--accent-ink); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .moon { display: none; } .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; } :root[data-theme="dark"] .theme-toggle .sun { display: none; }
.nav-toggle { display: none; }

/* ───────────────────────────── Hero ───────────────────────────── */
.hero { position: relative; isolation: isolate; padding: clamp(3rem, 7vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); overflow: hidden; }
.hero--home::before {
  /* blueprint grid wash behind the homepage hero */
  content: ""; position: absolute; inset: -2px -2px auto -2px; height: 130%; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 78%);
          mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 78%);
}
.hero-inner { max-width: 52rem; }
.hero--home { text-align: left; }
.hero h1 .accent { color: var(--accent-ink); }
.hero .lede { font-size: clamp(1.1rem, 1rem + .6vw, 1.32rem); line-height: 1.6; color: var(--ink-2); max-width: 40rem; margin: 1.2rem 0 1.8rem; }
.hero .cta-row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 2.2rem; color: var(--ink-2); font-size: .9rem; }
.hero-meta b { font-family: var(--display); color: var(--ink); font-weight: 600; }
.hero-meta .dotsep { display: inline-flex; align-items: center; gap: .5rem; }
.hero-meta .dotsep::before { content: ""; width: 18px; height: 18px; flex: 0 0 auto; color: var(--accent-ink); }

/* ───────────────────────────── Calculator hub grid ───────────────────────────── */
.section { margin-top: clamp(3rem, 6vw, 4.5rem); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.6rem; }
.section-head h2 { margin: 0; } .section-head .eyebrow { margin-bottom: .45rem; }
.section-head .more { font-weight: 600; font-size: .9rem; color: var(--ink-2); white-space: nowrap; display: inline-flex; gap: .4em; align-items: center; }
.section-head .more:hover { color: var(--accent-ink); } .section-head .more:hover .arr { transform: translateX(3px); }

.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: .55rem; padding: 1.4rem 1.4rem 1.3rem; overflow: hidden;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  transition: transform .22s cubic-bezier(.2,.7,.3,1), box-shadow .22s, border-color .22s;
}
.tool-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c) 50%, var(--line)); }
.tool-card:hover::before { transform: scaleX(1); }
.tool-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--c-bg); color: var(--c-ink); margin-bottom: .35rem; }
.tool-ic svg { width: 25px; height: 25px; }
.tool-card h3 { font-size: 1.2rem; margin: 0; letter-spacing: -.02em; }
.tool-card p { margin: 0; color: var(--ink-2); font-size: .92rem; line-height: 1.55; }
.tool-card .go { margin-top: auto; padding-top: .7rem; font-size: .8rem; font-weight: 700; letter-spacing: .02em; color: var(--c-ink); display: inline-flex; gap: .4em; align-items: center; text-transform: uppercase; }
.tool-card .go .arr { transition: transform .2s; } .tool-card:hover .go .arr { transform: translateX(4px); }

/* feature row of "how it works" / trust badges */
.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.1rem; margin-top: 1.4rem; }
.trust-item { display: flex; gap: .85rem; align-items: flex-start; padding: 1.2rem 1.3rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-2); }
.trust-item .ic { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--blueprint-bg); color: var(--blueprint-ink); }
.trust-item .ic svg { width: 21px; height: 21px; }
.trust-item h4 { font-family: var(--display); margin: .1rem 0 .25rem; font-size: 1.02rem; }
.trust-item p { margin: 0; font-size: .88rem; color: var(--ink-2); line-height: 1.5; }

/* ───────────────────────────── Calculator page ───────────────────────────── */
.calc-page-head { padding: clamp(1.6rem,4vw,2.6rem) 0 .5rem; }
.breadcrumbs { font-size: .82rem; color: var(--ink-3); margin-bottom: 1.1rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.breadcrumbs a { color: var(--ink-2); } .breadcrumbs a:hover { color: var(--ink); }
.calc-page-head .tool-ic { width: 54px; height: 54px; border-radius: 14px; margin-bottom: 1rem; }
.calc-page-head .tool-ic svg { width: 30px; height: 30px; }
.calc-page-head h1 { margin: 0 0 .5rem; }
.calc-page-head .tagline { font-size: 1.15rem; color: var(--ink-2); max-width: 44rem; margin: 0; }

.calc {
  margin-top: 1.6rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); overflow: hidden;
}
.calc-layout { display: grid; grid-template-columns: 1.15fr .85fr; }
@media (max-width: 56rem) { .calc-layout { grid-template-columns: 1fr; } }

.calc-form { padding: clamp(1.4rem, 3vw, 2.1rem); display: grid; grid-template-columns: 1fr 1fr; gap: 1.05rem 1.1rem; align-content: start; }
.calc-form .form-title { grid-column: 1 / -1; display: flex; align-items: center; gap: .6rem; margin: 0 0 .2rem; font-family: var(--display); font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.calc-form .form-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.field.is-wide { grid-column: 1 / -1; }
.field.is-hidden { display: none; }
.field-label { font-size: .82rem; font-weight: 600; color: var(--ink); display: flex; align-items: baseline; gap: .5rem; }
.field-label .opt { font-size: .66rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: .05em .35em; }
.field-help { font-size: .76rem; color: var(--ink-3); line-height: 1.4; }

/* number field with inline unit + steppers */
.num-field, .select-field { position: relative; display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); transition: border-color .18s, box-shadow .18s, background-color .18s; }
.num-field:focus-within, .select-field:focus-within { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); background: var(--surface); }
.num-field .prefix, .num-field .unit { display: grid; place-items: center; padding-inline: .7rem; font-size: .82rem; color: var(--ink-3); font-weight: 600; white-space: nowrap; pointer-events: none; }
.num-field .prefix { border-right: 1px solid var(--line-2); }
.num-field input { flex: 1 1 auto; width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink); font-family: var(--display); font-size: 1.05rem; font-weight: 500; padding: .62rem .2rem .62rem .8rem; }
.num-field input:focus { outline: none; }
.num-field input:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; border-radius: 4px; }
.num-field .unit { font-family: var(--display); }
.num-field .steppers { display: grid; grid-template-rows: 1fr 1fr; border-left: 1px solid var(--line-2); }
.num-field .step { display: grid; place-items: center; width: 30px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-size: .8rem; line-height: 1; padding: 0; transition: background-color .15s, color .15s; }
.num-field .step:hover { background: var(--c-bg); color: var(--c-ink); }
.num-field .step svg { width: 11px; height: 11px; }
/* hide native spinners */
.num-field input::-webkit-outer-spin-button, .num-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-field input[type=number] { -moz-appearance: textfield; appearance: textfield; }

.select-field select { flex: 1; width: 100%; border: 0; background: transparent; color: var(--ink); font-family: var(--sans); font-size: .95rem; font-weight: 500;
  padding: .68rem 2.4rem .68rem .8rem; cursor: pointer; -webkit-appearance: none; appearance: none; }
.select-field select:focus { outline: none; }
.select-field select:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; border-radius: 4px; }
.select-field::after { content: ""; position: absolute; right: .9rem; top: 50%; width: 11px; height: 7px; transform: translateY(-50%); pointer-events: none;
  background: var(--ink-2); clip-path: polygon(0 0, 100% 0, 50% 100%); }

/* result aside */
.calc-aside { background: linear-gradient(180deg, var(--c-bg), var(--surface-2) 65%); border-left: 1px solid var(--line); padding: clamp(1.4rem,3vw,2rem); }
:root[data-theme="dark"] .calc-aside { background: linear-gradient(180deg, color-mix(in srgb, var(--c-bg) 75%, var(--surface)), var(--surface) 70%); }
@media (max-width: 56rem) { .calc-aside { border-left: 0; border-top: 1px solid var(--line); } }
.calc-aside-inner { position: sticky; top: 88px; }
.calc-aside .aside-title { font-family: var(--display); font-size: .76rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--c-ink); margin: 0 0 1rem; display: flex; align-items: center; gap: .5rem; }
.calc-aside .aside-title::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }

.result-hero { padding: .2rem 0 1.1rem; border-bottom: 1px dashed color-mix(in srgb, var(--c) 35%, var(--line)); margin-bottom: 1rem; }
.result-hero-val { font-family: var(--display); font-weight: 600; font-size: clamp(2.6rem, 2rem + 3vw, 3.6rem); line-height: 1; letter-spacing: -.04em; color: var(--c-ink); }
.result-hero-label { margin-top: .4rem; font-size: .95rem; color: var(--ink-2); font-weight: 500; }
.result-hero-label span { color: var(--ink-3); }
.result-list { margin: 0; display: grid; gap: .1rem; }
.result-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .55rem .1rem; border-bottom: 1px solid var(--line-2); }
.result-list > div:last-child { border-bottom: 0; }
.result-list dt { color: var(--ink-2); font-size: .92rem; margin: 0; }
.result-list dd { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.12rem; color: var(--ink); white-space: nowrap; }
.result-list dd .u { font-family: var(--sans); font-size: .76rem; font-weight: 500; color: var(--ink-3); margin-left: .25rem; }
.result-list .is-money dd { color: var(--c-ink); }
.result-note { margin: 1rem 0 0; font-size: .85rem; line-height: 1.55; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem .9rem; }
.calc-actions { margin-top: 1.1rem; }
.calc-copy { width: 100%; justify-content: center; }
.calc-copy.copied { border-color: var(--c); color: var(--c-ink); }

/* "what you'll need" affiliate box */
.needs { margin-top: 2.2rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); padding: 1.3rem 1.4rem; }
.needs h2 { font-size: 1.05rem; margin: 0 0 .2rem; display: inline-flex; align-items: center; gap: .5rem; }
.needs h2 svg { width: 19px; height: 19px; color: var(--accent-ink); }
.needs .needs-sub { font-size: .82rem; color: var(--ink-3); margin: 0 0 1rem; }
.needs ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem,1fr)); gap: .5rem; }
.needs li a { display: flex; align-items: center; gap: .6rem; padding: .7rem .85rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: .92rem; font-weight: 500; transition: border-color .18s, transform .18s, box-shadow .18s; }
.needs li a:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.needs li a::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.needs li a .ext { margin-left: auto; color: var(--ink-3); }
.needs li a .ext svg { width: 13px; height: 13px; display: block; }

/* ───────────────────────────── Prose / supporting ───────────────────────────── */
.prose { max-width: var(--measure); margin: 2.6rem auto 0; font-size: 1.08rem; line-height: 1.75; }
.prose.full { margin-inline: 0; }
.prose > * { max-width: var(--measure); }
.prose.full > * { max-width: none; }
.prose h2 { font-size: 1.55rem; margin: 1.9em 0 .5em; letter-spacing: -.02em; }
.prose h3 { font-size: 1.22rem; margin: 1.6em 0 .4em; }
.prose p a, .prose li a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: .2em; text-decoration-thickness: .08em; transition: text-decoration-color .2s, color .2s; }
.prose p a:hover, .prose li a:hover { color: var(--ink); text-decoration-color: var(--accent); }
.prose ul, .prose ol { margin: 1.1em 0; padding-left: 1.3em; }
.prose li { margin: .45em 0; padding-left: .25em; }
.prose li::marker { color: var(--c); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose blockquote { margin: 1.8em 0; padding: .3em 0 .3em 1.6rem; border-left: 3px solid var(--c); font-style: italic; color: var(--ink); }

/* ───────────────────────────── FAQ ───────────────────────────── */
.faq { max-width: var(--measure); margin: 2.8rem auto 0; }
.faq h2 { font-size: 1.5rem; margin: 0 0 1.1rem; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: .7rem; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.faq details[open] { border-color: color-mix(in srgb, var(--c) 40%, var(--line)); box-shadow: var(--shadow-sm); }
.faq summary { list-style: none; cursor: pointer; padding: 1rem 1.2rem; font-family: var(--display); font-weight: 600; font-size: 1.02rem; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { flex: 0 0 auto; width: 18px; height: 18px; color: var(--c-ink); transition: transform .25s ease; }
.faq details[open] summary .chev { transform: rotate(180deg); }
.faq details > div { padding: 0 1.2rem 1.1rem; color: var(--ink-2); font-size: .98rem; line-height: 1.65; }

/* ───────────────────────────── Cross-links / related ───────────────────────────── */
.crosslinks { max-width: var(--measure); margin: 3rem auto 0; padding-top: 1.8rem; border-top: 1px solid var(--line); }
.crosslinks .eyebrow { color: var(--ink-3); }
.crosslinks h2 { font-size: 1.4rem; margin: 0 0 1rem; }
.crosslinks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.crosslinks li a { display: flex; align-items: center; gap: .8rem; padding: .8rem .7rem; border-radius: 10px; color: var(--ink); transition: background-color .2s; }
.crosslinks li a:hover { background: var(--surface-2); }
.crosslinks li a .t { font-family: var(--display); font-weight: 500; font-size: 1.05rem; }
.crosslinks li a .arr { margin-left: auto; color: var(--ink-3); }

/* small "jump to calculator" callout used inside blog posts */
.calc-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.3rem; justify-content: space-between;
  margin: 2rem 0; padding: 1.3rem 1.5rem; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line));
  background: linear-gradient(135deg, var(--c-bg), var(--surface) 75%); box-shadow: var(--shadow-sm); }
.calc-cta .cta-tx { display: flex; align-items: center; gap: .9rem; }
.calc-cta .tool-ic { width: 42px; height: 42px; border-radius: 11px; margin: 0; }
.calc-cta .tool-ic svg { width: 23px; height: 23px; }
.calc-cta b { font-family: var(--display); font-size: 1.08rem; display: block; line-height: 1.25; }
.calc-cta span { font-size: .88rem; color: var(--ink-2); }
.calc-cta .btn { white-space: nowrap; }

/* ───────────────────────────── Blog ───────────────────────────── */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.1rem; }
.post-card { position: relative; display: flex; flex-direction: column; gap: .55rem; padding: 1.4rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: transform .22s cubic-bezier(.2,.7,.3,1), box-shadow .22s, border-color .22s; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); }
.post-card h3 { font-size: 1.15rem; margin: 0; line-height: 1.25; }
.post-card p { margin: 0; color: var(--ink-2); font-size: .9rem; line-height: 1.55; }
.post-card .read-on { margin-top: auto; padding-top: .3rem; font-size: .76rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--c-ink); display: inline-flex; align-items: center; gap: .4em; }
.post-card .read-on .arr { transition: transform .2s; } .post-card:hover .read-on .arr { transform: translateX(4px); }
.topic-tag { align-self: flex-start; display: inline-flex; align-items: center; gap: .45em; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink); }
.topic-tag::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--c); }

.topic-section { scroll-margin-top: 90px; margin-top: clamp(2.6rem,5vw,3.6rem); }
.topic-section .section-head { border-bottom: 1px solid var(--line); padding-bottom: .9rem; }

/* article */
.article { padding-top: 1.4rem; }
.article-header { max-width: var(--measure); margin-inline: auto; }
.article-header h1 { margin: .2rem 0 0; }
.article-lede { font-size: 1.22rem; line-height: 1.55; color: var(--ink-2); margin: 1rem 0 0; }
.article-meta { display: flex; align-items: center; gap: .7rem; color: var(--ink-3); font-size: .85rem; margin-top: 1.1rem; }
.article-meta .topic-tag { color: var(--c-ink); }
.article-body { max-width: var(--measure); margin: 2rem auto 0; font-size: 1.12rem; line-height: 1.78; }
.article-body > * { max-width: var(--measure); }
.article-body p a, .article-body li a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: .2em; text-decoration-thickness: .08em; }
.article-body p a:hover, .article-body li a:hover { color: var(--ink); text-decoration-color: var(--accent); }
.article-body h2 { font-size: 1.6rem; margin: 1.7em 0 .45em; }
.article-body h3 { font-size: 1.28rem; margin: 1.5em 0 .4em; }
.article-body ul, .article-body ol { margin: 1.1em 0; padding-left: 1.35em; }
.article-body li { margin: .45em 0; } .article-body li::marker { color: var(--c); }
.article-body strong { color: var(--ink); font-weight: 650; }
.article-body blockquote { margin: 1.8em 0; padding: .3em 0 .3em 1.5rem; border-left: 3px solid var(--c); font-style: italic; color: var(--ink); }

/* ───────────────────────────── Safety / accuracy notices ───────────────────────────── */
.safety { display: flex; gap: .9rem; align-items: flex-start; max-width: var(--measure); margin: 1.8rem auto 0;
  padding: 1rem 1.15rem; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent-bg) 72%, var(--surface)); }
.safety .ic { flex: 0 0 auto; color: var(--accent-ink); margin-top: .05rem; }
.safety .ic svg { width: 22px; height: 22px; }
.safety h2 { font-family: var(--display); font-size: .8rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent-ink); margin: 0 0 .25rem; }
.safety p { margin: 0; font-size: .88rem; line-height: 1.55; color: var(--ink-2); }
.safety p strong { color: var(--ink); font-weight: 650; }
.safety a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: .15em; }
.safety a:hover { color: var(--ink); }

.calc-disclaimer { display: flex; gap: .6rem; align-items: flex-start; margin: 1.1rem 0 0;
  font-size: .82rem; line-height: 1.5; color: var(--ink-3); }
.calc-disclaimer .ic { flex: 0 0 auto; color: var(--accent-ink); margin-top: .05rem; }
.calc-disclaimer .ic svg { width: 16px; height: 16px; display: block; }
.calc-disclaimer strong { color: var(--ink-2); font-weight: 650; }
.calc-disclaimer a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: .15em; }
.calc-disclaimer a:hover { color: var(--ink); }

/* ───────────────────────────── Ads ───────────────────────────── */
.ad { margin: 2.4rem auto; text-align: center; max-width: var(--measure); }
.ad::before { content: "Advertisement"; display: block; font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .35rem; }
.ad ins { display: block; }
.ad-inline { min-height: 250px; }
.ad-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; padding: .25rem; background: var(--paper-2); border-top: 1px solid var(--line); display: none; min-height: 60px; }
.ad-sticky::before { display: none; }
@media (max-width: 720px) { .ad-sticky.on { display: block; } body.has-sticky { padding-bottom: 70px; } }

/* ───────────────────────────── Footer ───────────────────────────── */
.site-footer { margin-top: 5rem; color: #D9E2EA; background: #11202C; position: relative; overflow: hidden; }
:root[data-theme="dark"] .site-footer { background: #0A131B; border-top: 1px solid var(--line); }
.site-footer::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(143,190,227,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(143,190,227,.05) 1px, transparent 1px); background-size: 28px 28px; }
.footer-inner { position: relative; padding-block: 3.4rem 2.4rem; display: grid; gap: 2rem; }
.foot-top { display: flex; flex-wrap: wrap; gap: 2.4rem 4rem; align-items: start; justify-content: space-between; }
.foot-mark { max-width: 23rem; }
.foot-mark .brand { color: #fff; font-size: 1.5rem; margin-bottom: .6rem; }
.foot-mark .brand-mark .pl-ring { stroke: #fff; } .foot-mark .brand-mark .pl-bob { fill: var(--accent); }
.foot-mark p { color: #9FB1BF; font-size: .94rem; margin: 0; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 1.8rem 3.2rem; }
.footer-cols nav { display: grid; gap: .5rem; align-content: start; }
.footer-cols h4 { font-family: var(--display); margin: 0 0 .35rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: #6F8494; font-weight: 600; }
.footer-cols a { color: #B7C6D2; font-size: .92rem; } .footer-cols a:hover { color: #fff; }
.foot-divider { height: 1px; background: rgba(255,255,255,.1); }
.disclosure { color: #7E94A4; font-size: .8rem; max-width: 48rem; line-height: 1.6; }
.foot-legal { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: center; color: #7E94A4; font-size: .83rem; }
.foot-legal a { color: #9FB1BF; } .foot-legal a:hover { color: #fff; }
.foot-legal .spacer { flex: 1; }
.xref { color: var(--accent-ink); font-weight: 500; }

/* ───────────────────────────── Reveal motion ───────────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .65s ease, transform .65s cubic-bezier(.2,.7,.3,1); will-change: opacity, transform; }
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal][style*="--d"] { transition-delay: var(--d); }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1 !important; transform: none !important; } }

/* ───────────────────────────── Responsive ───────────────────────────── */
@media (max-width: 820px) {
  .nav, .header-actions .btn { display: none; }
  .nav-toggle { display: inline-grid; }
  .nav.open { display: grid; position: absolute; left: 0; right: 0; top: 70px; background: var(--paper);
    border-bottom: 1px solid var(--line); padding: .7rem 1.5rem 1rem; gap: .1rem; box-shadow: var(--shadow); }
  .nav.open a { padding: .8rem .5rem; font-size: 1.05rem; } .nav.open a::after { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; gap: .3rem; }
  .calc-form { grid-template-columns: 1fr; }
}
@media print {
  body::after, .site-header, .site-footer, .ad, .ad-sticky, .needs, .calc-cta, .hero--home::before { display: none !important; }
  body { background: #fff; color: #000; }
  .calc { box-shadow: none; border: 1px solid #ccc; }
}
