@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "Adventor"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/adventor-700.woff") format("woff"); }

:root {
  --paper: #f4f6fb;
  --surface: #ffffff;
  --ink: #101a33;
  --muted: #566184;
  --line: #d9dfee;
  --cobalt: #2748d9;
  --cobalt-dark: #1b34a8;
  --mark: #ffd84d;
  --hl: #ffd84d;
  --panel: #101a33;
  --panel-text: #f2f5ff;
  --panel-muted: #a9b4d6;
  --display: "Adventor", "Avenir Next", "Century Gothic", "Segoe UI", system-ui, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b1124;
    --surface: #131b33;
    --ink: #e9eefb;
    --muted: #9ca8cc;
    --line: #263150;
    --cobalt: #8ea5ff;
    --cobalt-dark: #b7c4ff;
    --hl: #6e5c12;
    --panel: #1b2547;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--text);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 17px;
  font-feature-settings: "kern", "liga";
}
a { color: var(--cobalt); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--cobalt-dark); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; }
main p, main li { max-width: 68ch; }

/* ---------- header ---------- */
header.site .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; padding-bottom: 20px; gap: 16px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 1.35rem; text-decoration: none; color: var(--ink); letter-spacing: -.02em; }
.logo span { color: var(--cobalt); }
header.site nav a { margin-left: 22px; color: var(--muted); text-decoration: none; font-size: .96rem; }
header.site nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--mark); text-decoration-thickness: 3px; }

/* ---------- headings ---------- */
.hero { padding: 44px 0 26px; }
.hero h1, h1.page-title { font-family: var(--display); font-weight: 700; letter-spacing: -.025em; line-height: 1.08; margin: 0; }
.hero h1 { font-size: clamp(2.1rem, 5.6vw, 3.4rem); max-width: 21ch; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 52ch; margin: 18px 0 0; }
h1.page-title { font-size: clamp(1.85rem, 4.6vw, 2.7rem); margin: 18px 0 14px; max-width: 20ch; }
.crumbs { font-size: .9rem; color: var(--muted); margin-top: 8px; }
.crumbs a { color: var(--muted); }
.intro { color: var(--muted); font-size: 1.12rem; margin: 0 0 28px; max-width: 60ch; }

main h2 { font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: -.015em; line-height: 1.2; margin: 52px 0 12px; }
main h3 { font-family: var(--display); font-weight: 700; font-size: 1.1rem; margin: 26px 0 6px; }

/* ---------- the calculator ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  margin: 24px 0;
  box-shadow: 0 18px 40px -18px rgba(16, 26, 51, .28);
}
.calc-grid { display: grid; grid-template-columns: 1fr; }
@media (min-width: 840px) { .calc-grid { grid-template-columns: 1.15fr 1fr; } }
.calc-grid > div:first-child { padding: 28px; }
.cur-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-size: .92rem; color: var(--muted); }
select, input[type=number] {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 14px; width: 100%;
  font-variant-numeric: tabular-nums;
}
select:focus, input:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 4px rgba(39, 72, 217, .16); }
.cur-row select { width: auto; padding: 6px 12px; border-radius: 999px; font-weight: 600; }
.field { margin-bottom: 18px; }
.field[hidden] { display: none; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: .84rem; margin-top: 5px; line-height: 1.45; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .prefix, .input-wrap .suffix { position: absolute; color: var(--muted); font-size: .95rem; pointer-events: none; }
.input-wrap .prefix { left: 14px; }
.input-wrap .suffix { right: 14px; }
.input-wrap.has-prefix input { padding-left: 38px; }
.input-wrap.has-suffix input { padding-right: 56px; }
.note { font-size: .83rem; color: var(--muted); margin: 6px 0 0; }

.results { background: var(--panel); color: var(--panel-text); padding: 28px; align-self: stretch; }
.results h2 { margin: 0 0 16px; font-family: var(--text); font-weight: 600; font-size: .95rem; letter-spacing: 0; color: var(--panel-muted); }
.big { font-family: var(--display); font-weight: 700; font-size: clamp(2.6rem, 9vw, 3.9rem); line-height: 1; letter-spacing: -.03em; color: var(--mark); font-variant-numeric: lining-nums; overflow-wrap: anywhere; }
.big-label { color: var(--panel-muted); font-size: .98rem; margin: 8px 0 22px; }
.row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid rgba(255, 255, 255, .14); font-size: .98rem; }
.row span { color: var(--panel-muted); }
.row b { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.empty { color: var(--panel-muted); }
@keyframes bump { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.big.bump { animation: bump .22s ease-out; }
@media (prefers-reduced-motion: reduce) { .big.bump { animation: none; } html { scroll-behavior: auto; } }

/* ---------- article content ---------- */
.answer { font-size: 1.25rem; line-height: 1.5; margin: 6px 0 8px; max-width: 60ch; }
.answer b { font-weight: 600; background: linear-gradient(transparent 58%, var(--hl) 58%); padding: 0 .1em; }
code.formula {
  display: block; background: var(--surface); border-left: 4px solid var(--cobalt);
  padding: 14px 18px; border-radius: 4px 12px 12px 4px; margin: 14px 0; font-size: .93rem; overflow-x: auto; white-space: pre-wrap; line-height: 1.7;
}
details { border-bottom: 1px solid var(--line); padding: 4px 0; max-width: 68ch; }
details:first-of-type { border-top: 1px solid var(--line); }
details summary { cursor: pointer; font-weight: 600; padding: 14px 32px 14px 0; position: relative; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.5rem; font-weight: 400; color: var(--cobalt); line-height: 1.2; }
details[open] summary::after { content: "\2212"; }
details p { margin: 0 0 16px; color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 14px 0 8px; max-width: 680px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .98rem; font-variant-numeric: tabular-nums; }
.table-wrap th, .table-wrap td { text-align: left; padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-wrap th { font-weight: 600; color: var(--muted); font-size: .9rem; border-bottom: 2px solid var(--ink); }
.table-wrap td:first-child { color: var(--ink); }
.table-wrap td.num, .table-wrap th.num { text-align: right; padding-right: 0; padding-left: 12px; }
.table-wrap td.num { font-weight: 600; }

/* lists of links: rows, not cards */
.grid { display: block; margin: 14px 0 8px; border-top: 1px solid var(--line); }
.tile {
  display: grid; grid-template-columns: 1fr 14px; gap: 2px 18px; align-items: center;
  padding: 16px 4px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line);
  position: relative; transition: background-color .15s, padding-left .15s;
}
.tile b { grid-column: 1; font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.tile span { grid-column: 1; color: var(--muted); font-size: .94rem; max-width: 64ch; }
.tile::after { content: ""; grid-column: 2; grid-row: 1 / span 2; width: 8px; height: 8px; border-top: 2px solid var(--cobalt); border-right: 2px solid var(--cobalt); transform: rotate(45deg); transition: transform .15s; }
.tile:hover { background: var(--surface); padding-left: 14px; color: var(--ink); }
.tile:hover::after { transform: translateX(4px) rotate(45deg); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chips a { text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 15px; font-size: .93rem; color: var(--ink); }
.chips a:hover { border-color: var(--cobalt); color: var(--cobalt); }

.disclaimer { font-size: .86rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 18px; margin-top: 48px; max-width: none; }
footer.site { margin-top: 64px; padding: 36px 0 44px; font-size: .92rem; color: var(--muted); background: var(--surface); border-top: 1px solid var(--line); }
footer.site a { color: var(--muted); margin-right: 18px; display: inline-block; }
footer.site a:hover { color: var(--cobalt); }
footer.site .links { margin-bottom: 12px; line-height: 1.9; }
.legal h2 { font-size: 1.25rem; margin-top: 36px; }
