:root {
  --bg: #ffffff;
  --surface: #f1f5f4;
  --ink: #1d2327;
  --muted: #56636a;
  --line: #d9e1df;
  --creek: #0e5a5a;
  --creek-deep: #0a4343;
  --on-creek: #ffffff;
  --saffron: #f2a900;
  --link: #0e5a5a;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1120px;
  --radius-s: 6px;
  --radius-l: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1717;
    --surface: #172323;
    --ink: #e6ecea;
    --muted: #9fb0ad;
    --line: #2a3a39;
    --creek: #0f5e5c;
    --creek-deep: #0b4a48;
    --saffron: #f5b82e;
    --link: #6cc5bf;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1717; --surface: #172323; --ink: #e6ecea; --muted: #9fb0ad; --line: #2a3a39;
  --creek: #0f5e5c; --creek-deep: #0b4a48; --saffron: #f5b82e; --link: #6cc5bf; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 28px; min-height: 64px; flex-wrap: wrap; }
.wordmark { font: 600 20px/1 var(--display); color: var(--creek); text-decoration: none; letter-spacing: -0.01em; }
:root .site-header .wordmark { color: var(--link); }
.main-nav { display: flex; gap: 22px; flex: 1; flex-wrap: wrap; }
.main-nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current] { border-bottom-color: var(--saffron); }
.lang-switch { display: flex; gap: 2px; }
.lang-switch a { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 5px 8px; border-radius: var(--radius-s); }
.lang-switch a[aria-current] { background: var(--surface); color: var(--ink); }

/* hero */
.hero { padding: 72px 0 64px; border-bottom: 1px solid var(--line); }
.hero-sentence {
  font: 500 clamp(30px, 5.4vw, 60px)/1.18 var(--display);
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 17ch;
}
.hero-pre, .hero-post, .hero-option { display: block; }
.hero-post { color: var(--muted); }
.hero-option {
  color: var(--ink);
  text-decoration: none;
  width: fit-content;
  background-image: linear-gradient(var(--saffron), var(--saffron));
  background-size: 100% 0.14em;
  background-position: 0 92%;
  background-repeat: no-repeat;
  transition: background-size .18s ease, color .18s ease;
}
.hero-option:hover, .hero-option:focus-visible { background-size: 100% 0.42em; }
.hero-option::after { content: "  ↗"; font-size: 0.45em; vertical-align: 0.9em; color: var(--muted); }
.hero-sub { font-size: 19px; color: var(--muted); max-width: 52ch; margin: 28px 0 0; }

/* home blocks */
.home-block { padding-top: 56px; }
.home-block:last-child { padding-bottom: 72px; }
.home-block h2 { font: 600 22px/1.3 var(--body); margin: 0 0 18px; }
.calc-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--creek); border-radius: var(--radius-l); overflow: hidden; }
.calc-list li + li { border-left: 1px solid rgba(255,255,255,.18); }
.calc-list a { display: flex; flex-direction: column; gap: 8px; padding: 26px 24px 28px; height: 100%; color: var(--on-creek); text-decoration: none; }
.calc-list a:hover { background: var(--creek-deep); }
.calc-list-title { font: 600 19px/1.3 var(--body); }
.calc-list-title::after { content: ""; display: block; width: 28px; height: 3px; background: var(--saffron); margin-top: 12px; }
.calc-list-desc { opacity: .85; font-size: 15px; line-height: 1.5; }
.guide-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.guide-item { padding: 22px 24px 24px 0; text-decoration: none; color: var(--ink); }
.guide-item + .guide-item { padding-left: 24px; border-left: 1px solid var(--line); }
.guide-item h3 { margin: 0 0 6px; font-size: 19px; font-weight: 600; color: var(--link); }
.guide-item:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.guide-item p { margin: 0; color: var(--muted); font-size: 15px; }

/* page head */
.crumbs { font-size: 14px; color: var(--muted); padding-top: 22px; }
.crumbs a { color: var(--muted); }
.page-head { padding: 24px 0 8px; max-width: 760px; }
.page-head h1 { font: 500 clamp(28px, 4vw, 44px)/1.15 var(--display); letter-spacing: -0.02em; margin: 0 0 18px; }
.lede { font-size: 19px; line-height: 1.55; margin: 0 0 10px; }
.updated { font-size: 14px; color: var(--muted); margin: 0; }

/* facts */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 28px 0 8px; border-top: 3px solid var(--creek); border-bottom: 1px solid var(--line); }
.facts div { padding: 16px 18px 18px 0; }
.facts div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.facts dt { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; font-weight: 600; font-size: 16px; line-height: 1.35; }

/* guide layout */
.guide-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; padding: 24px 0 80px; }
.prose { max-width: 720px; }
.prose h2 { font: 600 25px/1.3 var(--body); margin: 44px 0 14px; letter-spacing: -0.01em; scroll-margin-top: 16px; }
.prose p, .prose li { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 18px 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { background: var(--surface); font-weight: 600; border-bottom: 2px solid var(--creek); }
.prose tbody td:first-child { font-weight: 600; }
ol.steps { list-style: none; padding: 0; counter-reset: s; }
ol.steps li { counter-increment: s; position: relative; padding: 0 0 14px 44px; margin: 0; }
ol.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--creek); color: #fff; font-weight: 600; font-size: 14px; display: grid; place-items: center; }

.toc { position: sticky; top: 20px; align-self: start; font-size: 15px; border-left: 1px solid var(--line); padding-left: 22px; }
.toc-title { font-weight: 600; margin: 4px 0 8px; }
.toc ol { list-style: none; padding: 0; margin: 0 0 20px; }
.toc li { margin: 0; }
.toc li a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc li a:hover { color: var(--ink); }

.calc-banner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 20px; margin: 32px 0 8px; padding: 20px 22px; background: var(--creek); color: var(--on-creek); border-radius: var(--radius-l); text-decoration: none; }
.calc-banner:hover { background: var(--creek-deep); }
.calc-banner-label { grid-column: 1; font-size: 13px; opacity: .8; }
.calc-banner-title { grid-column: 1; font-weight: 600; font-size: 19px; }
.calc-banner-btn { grid-column: 2; grid-row: 1 / span 2; background: var(--saffron); color: #1d2327; font-weight: 600; padding: 10px 18px; border-radius: 999px; }

.btn-primary, .btn-secondary { display: inline-block; font-weight: 600; text-decoration: none; padding: 11px 18px; border-radius: 999px; font-size: 15px; line-height: 1.3; }
.btn-primary { background: var(--saffron); color: #1d2327; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { border: 1.5px solid var(--creek); color: var(--link); }
.btn-secondary:hover { background: var(--surface); }

.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { cursor: pointer; font-weight: 600; padding: 14px 28px 14px 0; position: relative; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 22px; font-weight: 400; color: var(--muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0 0 16px; color: var(--ink); }

.firms { margin-top: 44px; padding: 4px 24px 24px; background: var(--surface); border-radius: var(--radius-l); }
.firms h2 { margin-top: 20px; }
.sources { list-style: none; padding: 0; columns: 2; column-gap: 32px; font-size: 15px; }
.sources li { margin: 0 0 8px; break-inside: avoid; }

/* calculators */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 32px; margin: 24px 0 8px; align-items: start; }
.calc-form { display: grid; gap: 22px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.field > label, .field legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 2px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.field-check { align-self: end; padding-bottom: 10px; }
input[type="text"], input[type="number"] {
  font: 500 17px/1.3 var(--body); color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 11px 12px; width: 100%;
}
input[type="text"]:focus, input[type="number"]:focus { border-color: var(--creek); outline: none; box-shadow: 0 0 0 3px rgba(242,169,0,.35); }
.field > .choice, .field > .check, .choice, .check { font-weight: 400; display: flex; gap: 10px; align-items: flex-start; font-size: 16px; cursor: pointer; padding: 3px 0; }
.choice input, .check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--creek); flex: none; }
.stepper { display: inline-flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: var(--radius-s); width: fit-content; overflow: hidden; }
.stepper button { width: 44px; border: 0; background: var(--surface); color: var(--ink); font-size: 20px; cursor: pointer; }
.stepper button:hover { background: var(--line); }
.stepper input { width: 64px; border: 0; border-radius: 0; text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="range"] { width: 100%; accent-color: var(--creek); }

.calc-result { position: sticky; top: 20px; background: var(--creek); color: var(--on-creek); border-radius: var(--radius-l); padding: 26px 24px 22px; min-height: 200px; }
.result-label { font-size: 14px; opacity: .85; margin: 0 0 6px; }
.result-value { font: 600 clamp(26px, 3.2vw, 34px)/1.15 var(--display); letter-spacing: -0.02em; margin: 0; }
.result-value::after { content: ""; display: block; width: 44px; height: 4px; background: var(--saffron); margin-top: 14px; }
.result-alt { margin: 12px 0 0; font-size: 15px; opacity: .9; }
.result-sub { font-size: 13px; opacity: .8; margin: 22px 0 6px; }
.result-rows { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.result-rows li { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.16); }
.result-rows li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.result-routes { list-style: none; padding: 0; margin: 8px 0 0; }
.result-routes li { font-weight: 600; font-size: 17px; padding: 10px 0 10px 28px; position: relative; border-top: 1px solid rgba(255,255,255,.16); }
.result-routes li::before { content: "✓"; position: absolute; left: 0; color: var(--saffron); font-weight: 700; }
.result-empty { margin: 0; opacity: .9; }
.result-flag { margin: 16px 0 0; padding: 10px 12px; background: rgba(242,169,0,.18); border-left: 3px solid var(--saffron); font-size: 14px; }
.result-note { font-size: 12.5px; opacity: .75; margin: 18px 0 0; line-height: 1.45; }
.after-calc { padding: 24px 0 80px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 36px 0 44px; font-size: 15px; }
.footer-row { display: grid; grid-template-columns: 1fr auto; gap: 40px; }
.footer-note { color: var(--muted); max-width: 56ch; margin: 12px 0 0; font-size: 14px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-links a { color: var(--ink); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .guide-grid { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .calc { grid-template-columns: 1fr; }
  .calc-result { position: static; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .header-row { gap: 10px 18px; padding: 12px 0; }
  .main-nav { order: 3; flex-basis: 100%; gap: 18px; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; scrollbar-width: none; }
  .lang-switch { margin-left: auto; }
  .hero { padding: 44px 0 40px; }
  .calc-list, .guide-list { grid-template-columns: 1fr; }
  .calc-list li + li { border-left: 0; border-top: 1px solid rgba(255,255,255,.18); }
  .guide-item, .guide-item + .guide-item { padding: 18px 0; border-left: 0; }
  .guide-item + .guide-item { border-top: 1px solid var(--line); }
  .field-grid { grid-template-columns: 1fr; }
  .sources { columns: 1; }
  .footer-row { grid-template-columns: 1fr; }
  .calc-banner { grid-template-columns: 1fr; }
  .calc-banner-btn { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
