@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
}

:root {
  --bg: #fcfcfc;
  --surface: #fff;
  --surface-2: #f7f7f5;
  --text: #171717;
  --muted: #636363;
  --border: #deded9;
  --border-strong: #c9c9c2;
  --accent: #349400;
  --accent-hover: #287600;
  --accent-soft: #eef7e9;
  --green: #349400;
  --green-soft: #eef7e9;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 18px 50px rgba(23, 23, 23, .09);
  --shadow-soft: 0 8px 24px rgba(23, 23, 23, .05);
  --maxw: 1180px;
  color-scheme: light;
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { color: var(--text); line-height: 1.12; letter-spacing: -.035em; }
h1 { margin: .2em 0 .3em; font-size: clamp(2.35rem, 1.45rem + 3.5vw, 4.5rem); font-weight: 760; }
h2 { margin: 2em 0 .65em; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); font-weight: 700; }
h3 { margin: 1.4em 0 .45em; font-size: 1.12rem; }
p { margin: .65em 0; }
code { padding: .16em .42em; border-radius: 6px; background: var(--surface-2); font-size: .9em; }
pre { overflow-x: auto; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: .88rem; }
.muted { color: var(--muted); }
.wrap { width: min(100%, var(--maxw)); margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 100; padding: 9px 14px; border-radius: 999px; background: var(--surface); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: rgba(252, 252, 252, .86);
  backdrop-filter: blur(16px);
}
.nav { display: flex; align-items: center; gap: 12px; min-height: 80px; }
.brand { color: var(--text); font-size: 1rem; font-weight: 760; letter-spacing: -.03em; }
.brand:hover { text-decoration: none; }
.nav-spacer { flex: 1; }
.nav-menu {
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(249, 249, 249, .7);
}
.nav-item { position: relative; }
.nav-item > button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: .88rem; font-weight: 600; }
.nav-item > button:hover { background: var(--surface); color: var(--text); }
.nav-item > button svg { width: 10px; opacity: .6; }
.dropdown { position: absolute; top: calc(100% + 10px); left: 0; display: none; min-width: 260px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }
.nav-item:hover .dropdown, .nav-item:focus-within .dropdown { display: flex; flex-direction: column; }
.dropdown a { padding: 9px 11px; border-radius: 9px; color: var(--text); font-size: .9rem; }
.dropdown a:hover { background: var(--surface-2); text-decoration: none; }
.nav-burger { display: none; width: 42px; height: 42px; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); }
.nav-burger svg { width: 18px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 650; transition: background .15s, border-color .15s, transform .15s; }
.btn:hover { border-color: var(--text); text-decoration: none; transform: translateY(-1px); }
.btn-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 13px; font-size: .84rem; }

/* Home */
.hero { padding: clamp(70px, 11vw, 140px) 0 72px; text-align: center; }
.hero .wrap { max-width: 900px; }
.hero .eyebrow { display: inline-flex; padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .77rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hero p.lead { max-width: 650px; margin: .65em auto 1.65em; color: var(--muted); font-size: clamp(1.08rem, .95rem + .55vw, 1.35rem); }
.hero-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.section { padding: 38px 0 76px; }
.section-head { margin-bottom: 24px; text-align: left; }
.section-head h2 { margin: 0; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.calc-card { position: relative; display: flex; align-items: center; min-height: 92px; padding: 22px 58px 22px 24px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
.calc-card::after { content: ""; position: absolute; right: 25px; width: 9px; height: 9px; border-top: 1.5px solid var(--muted); border-right: 1.5px solid var(--muted); transform: rotate(45deg); }
.calc-card:hover { border-color: var(--accent); box-shadow: var(--shadow-soft); text-decoration: none; transform: translateY(-2px); }
.calc-card h3 { margin: 0; font-size: 1.05rem; letter-spacing: -.02em; }

/* Pages */
.page { padding: 38px 0 80px; }
.page > .wrap > .lead { max-width: 760px; font-size: 1.1rem; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; color: #8a8a85; font-size: .8rem; }
.breadcrumb a { color: inherit; }
.article { min-width: 0; }
.prose { font-size: 1rem; }
.prose > h1:first-child { margin-top: 0; }
.prose h2 { padding-top: .3em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin: .36em 0; }
.guide-content { max-width: 790px; margin-top: 36px; }
.compact-content { max-width: 860px; margin: 58px auto 0; }
.lastup { margin: -.15em 0 1.25em; color: var(--muted); font-size: .8rem; }
.lastup b { color: var(--text); }

/* Calculator */
.calc-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; margin: 26px 0 10px; padding: 14px; border: 1px solid var(--border); border-radius: 30px; background: var(--surface-2); }
.panel { overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 19px 22px; border-bottom: 1px solid var(--border); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1rem; letter-spacing: -.02em; }
.panel-body { padding: 20px 22px 22px; }
.results-panel { position: sticky; top: 96px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.preset-row .lbl { width: 100%; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.chip { padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: .8rem; font-weight: 600; }
.chip:hover { border-color: var(--accent); color: var(--accent-hover); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 620; }
.field .ctl { position: relative; display: flex; align-items: center; }
.field input[type=number], .field input[type=text], .field select, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; outline: none; background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .ctl .affix { position: absolute; right: 12px; color: var(--muted); font-size: .82rem; pointer-events: none; }
.field .ctl.has-suffix input { padding-right: 38px; }
.field textarea { min-height: 170px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }
.toggle { display: inline-flex; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle .track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--border-strong); transition: .15s; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .15s; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.tip { position: relative; display: inline-grid; width: 15px; height: 15px; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--muted); font-size: .65rem; cursor: help; }
.tip:hover::after { content: attr(data-tip); position: absolute; bottom: 130%; left: 50%; z-index: 20; width: max-content; max-width: 240px; padding: 8px 10px; border-radius: 8px; background: var(--text); color: #fff; font-size: .75rem; font-weight: 500; line-height: 1.4; transform: translateX(-50%); }
.adv-toggle { margin-top: 16px; }
.adv-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.adv-section[hidden] { display: none; }

/* Results */
.headline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric { padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.metric.big { grid-column: 1 / -1; border-color: #cfe6c2; background: var(--accent-soft); }
.metric .k { color: var(--muted); font-size: .75rem; font-weight: 600; }
.metric .v { margin-top: 3px; font-size: 1.42rem; font-weight: 750; letter-spacing: -.03em; }
.metric.big .v { color: var(--accent-hover); font-size: 2rem; }
.metric .h { color: var(--muted); font-size: .72rem; }
.subhead { margin: 21px 0 9px; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; margin: 7px 0; font-size: .82rem; }
.bar-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e6e6e1; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.amt { font-variant-numeric: tabular-nums; font-weight: 620; }
.cmp-table, .ptable { width: 100%; border-collapse: collapse; font-size: .82rem; }
.cmp-table th, .cmp-table td, .ptable th, .ptable td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.cmp-table th, .ptable th { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.cmp-table td.num, .cmp-table th.num, .ptable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cmp-table tr.hl td { background: var(--accent-soft); font-weight: 650; }
.cmp-note { margin-top: 8px; color: var(--muted); font-size: .77rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.reco { margin-top: 16px; padding: 13px 14px; border: 1px solid #cfe6c2; border-radius: 12px; background: var(--green-soft); font-size: .88rem; }
.reco b, .reco strong { color: var(--accent-hover); }
.tips { display: flex; flex-direction: column; gap: 7px; margin: 10px 0 0; padding-left: 1.15em; }
.tips li { padding-left: 2px; font-size: .85rem; }
.export-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.counter-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 100; padding: 10px 18px; border-radius: 999px; background: var(--text); color: #fff; font-size: .86rem; font-weight: 600; opacity: 0; box-shadow: var(--shadow); transform: translateX(-50%) translateY(16px); transition: .2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Supporting content */
.faq details { margin: 8px 0; padding: 3px 16px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.faq summary { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; font-weight: 620; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); }
.faq details[open] summary::after { content: "-"; }
.faq details p { margin: 0 0 14px; color: var(--muted); }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.related-grid a { display: flex; align-items: center; min-height: 58px; padding: 12px 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-size: .9rem; font-weight: 620; }
.related-grid a:hover { border-color: var(--accent); text-decoration: none; }
.formula-box, .callout { margin: 12px 0; padding: 15px 17px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.contact-form { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.contact-form .btn-primary { align-self: flex-start; }
.contact-form .form-note { margin: 0; font-size: .8rem; }

/* Footer */
.site-footer { margin-top: 50px; padding: 58px 0 28px; border-top: 1px solid var(--border); background: #f8f8f6; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 34px; }
.footer-grid h4 { margin: 0 0 12px; color: var(--text); font-size: .8rem; letter-spacing: 0; }
.footer-grid ul { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.footer-grid a { color: var(--muted); font-size: .88rem; }
.footer-grid a:hover { color: var(--text); }
.footer-about p { max-width: 290px; color: var(--muted); font-size: .88rem; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .78rem; }

@media (max-width: 900px) {
  .calc-shell { grid-template-columns: 1fr; }
  .results-panel { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .nav { min-height: 68px; }
  .nav-menu { position: absolute; top: 68px; left: 12px; right: 12px; display: none; flex-direction: column; padding: 8px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
  .nav-menu.open { display: flex; }
  .nav-item, .nav-item > button { width: 100%; }
  .nav-item > button { justify-content: space-between; border-radius: 9px; }
  .dropdown { position: static; display: flex; min-width: 0; padding: 2px 0 6px 10px; border: 0; box-shadow: none; }
  .nav-burger { display: grid; }
  .hero { padding-top: 72px; }
  .card-grid, .field-grid, .headline-grid, .related-grid { grid-template-columns: 1fr; }
  .counter-stats { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 96px 1fr auto; }
  .calc-shell { margin-inline: -6px; padding: 7px; border-radius: 23px; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media print {
  .site-header, .site-footer, .export-row, .preset-row, .nav { display: none !important; }
  .calc-shell { grid-template-columns: 1fr; border: 0; padding: 0; }
}
