:root {
  --ink: #10212b;
  --muted: #586771;
  --paper: #f4f7f5;
  --surface: #ffffff;
  --line: #dce4df;
  --brand: #2563eb;
  --brand-dark: #1e3a8a;
  --accent: #f97316;
  --accent-soft: #fff1e8;
  --success: #18794e;
  --shadow: 0 18px 55px rgba(16, 33, 43, .10);
  --radius: 18px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.62;
}
a { color: var(--brand-dark); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--brand); }
button, input, select { font: inherit; }
button, input, select, a { -webkit-tap-highlight-color: transparent; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 50; padding: .7rem 1rem; background: white; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244,247,245,.92);
  border-bottom: 1px solid rgba(220,228,223,.9);
  backdrop-filter: blur(14px);
}
.nav {
  width: min(1180px, calc(100% - 2rem));
  min-height: 68px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  font-weight: 850;
  font-size: 1.18rem;
  letter-spacing: -.03em;
  text-decoration: none;
}
.logo-mark {
  width: 42px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: white;
  background: var(--ink);
  border-radius: 5px 12px 5px 5px;
  font-size: .69rem;
  letter-spacing: .03em;
  box-shadow: inset 0 -6px 0 var(--accent);
}
.nav-links { display: flex; align-items: center; gap: 1.3rem; font-weight: 680; }
.nav-links a { color: var(--ink); text-decoration: none; }
.nav-links a:hover { color: var(--brand); }
.nav-cta { padding: .58rem .86rem; border: 1px solid var(--brand); border-radius: 999px; }

.hero {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 5rem 0 2.4rem;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 1rem;
  color: var(--brand-dark);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 22px; height: 3px; background: var(--accent); border-radius: 2px; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.045em; }
h1 { margin: 0; font-size: clamp(2.5rem, 6vw, 5.3rem); max-width: 11ch; }
.hero-copy { margin: 1.25rem 0 1.3rem; color: var(--muted); font-size: clamp(1.04rem, 1.5vw, 1.2rem); max-width: 48ch; }
.trust-line { display: flex; flex-wrap: wrap; gap: .55rem 1rem; color: var(--muted); font-size: .9rem; }
.trust-line span::before { content: "✓"; color: var(--success); font-weight: 900; margin-right: .35rem; }

.calculator-shell {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.calc-head { padding: 1.25rem 1.35rem; display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.calc-head h2 { margin: 0 0 .3rem; font-size: 1.35rem; }
.calc-head p { margin: 0; color: var(--muted); font-size: .88rem; }
.step-chip { align-self: start; white-space: nowrap; padding: .3rem .58rem; color: var(--brand-dark); background: #e7f3f1; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.calc-grid { padding: 1.25rem 1.35rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; gap: .38rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .82rem; font-weight: 750; }
.input-wrap { position: relative; }
.input-wrap input, .field select, .field input {
  width: 100%;
  min-height: 45px;
  padding: .66rem .78rem;
  color: var(--ink);
  background: #fbfcfb;
  border: 1px solid #cdd8d2;
  border-radius: 10px;
  outline: none;
}
.input-wrap input { padding-right: 3rem; }
.input-wrap span { position: absolute; right: .75rem; top: 50%; color: var(--muted); font-size: .8rem; transform: translateY(-50%); pointer-events: none; }
input:focus, select:focus { border-color: var(--brand) !important; box-shadow: 0 0 0 3px rgba(0,108,103,.12); }
.advanced { border-top: 1px solid var(--line); }
.advanced summary { padding: .9rem 1.35rem; cursor: pointer; font-size: .88rem; font-weight: 780; }
.advanced .calc-grid { padding-top: .35rem; }
.result-panel { padding: 1.2rem 1.35rem 1.35rem; color: white; background: var(--ink); }
.result-top { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.result-label { display: block; color: #b9c7cc; font-size: .76rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.result-value { display: block; margin-top: .2rem; font-size: 2rem; line-height: 1; font-weight: 850; letter-spacing: -.04em; }
.result-value.accent { color: #ff9a78; }
.breakdown { margin: 1rem 0 0; padding: .9rem 0 0; border-top: 1px solid rgba(255,255,255,.15); display: grid; gap: .32rem; }
.breakdown div { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; }
.breakdown dt { color: #b9c7cc; }
.breakdown dd { margin: 0; font-weight: 720; }
.formula-note { margin: .8rem 0 0; color: #b9c7cc; font-size: .76rem; }

.section { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; padding: 4.8rem 0; }
.section-head { max-width: 680px; margin-bottom: 2rem; }
.section h2 { margin: .2rem 0 .8rem; font-size: clamp(2rem, 4vw, 3.4rem); }
.section-head p { margin: 0; color: var(--muted); font-size: 1.08rem; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card {
  min-height: 210px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { color: var(--ink); transform: translateY(-3px); border-color: #b8cbc4; box-shadow: 0 14px 35px rgba(16,33,43,.08); }
.card-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--brand-dark); background: #e7f3f1; border-radius: 12px; font-weight: 900; }
.card h3 { margin: 1rem 0 .45rem; font-size: 1.25rem; }
.card p { margin: 0 0 1.2rem; color: var(--muted); font-size: .92rem; }
.card .arrow { margin-top: auto; color: var(--brand); font-weight: 800; }

.principles { background: var(--ink); color: white; }
.principles .section { display: grid; grid-template-columns: .8fr 1.2fr; gap: 4rem; }
.principles .eyebrow { color: #8fd6cf; }
.principles h2 { margin-top: 0; }
.principle-list { display: grid; gap: 1rem; }
.principle { padding: 1.1rem 1.2rem; border: 1px solid rgba(255,255,255,.15); border-radius: 14px; }
.principle strong { display: block; margin-bottom: .2rem; }
.principle p { margin: 0; color: #b9c7cc; font-size: .9rem; }

.content-page { width: min(880px, calc(100% - 2rem)); margin: 0 auto; padding: 4.5rem 0; }
.content-page.wide { width: min(1080px, calc(100% - 2rem)); }
.breadcrumbs { margin-bottom: 1.2rem; color: var(--muted); font-size: .83rem; }
.breadcrumbs a { color: var(--muted); }
.page-lead { color: var(--muted); font-size: 1.16rem; max-width: 70ch; }
.content-page h1 { max-width: 16ch; font-size: clamp(2.4rem, 6vw, 4.7rem); }
.content-page h2 { margin: 3.2rem 0 .9rem; font-size: clamp(1.65rem, 3.5vw, 2.5rem); }
.content-page h3 { margin: 2rem 0 .6rem; font-size: 1.3rem; }
.content-page p, .content-page li { max-width: 75ch; }
.content-page li + li { margin-top: .45rem; }
.callout { margin: 1.5rem 0; padding: 1.1rem 1.2rem; background: #e7f3f1; border-left: 4px solid var(--brand); border-radius: 0 12px 12px 0; }
.warning { background: var(--accent-soft); border-left-color: var(--accent); }
.formula { overflow-x: auto; padding: 1rem 1.1rem; background: var(--ink); color: white; border-radius: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: .85rem .9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #edf4f1; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
.source-list { color: var(--muted); font-size: .88rem; }

.site-footer { background: #0a171e; color: #b9c7cc; }
.footer-inner { width: min(1180px, calc(100% - 2rem)); margin: auto; padding: 3rem 0; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer .logo { color: white; }
.site-footer h3 { margin: 0 0 .7rem; color: white; font-size: .9rem; letter-spacing: 0; }
.site-footer p { max-width: 42ch; font-size: .85rem; }
.footer-links { display: grid; gap: .4rem; }
.footer-links a { color: #b9c7cc; font-size: .85rem; text-decoration: none; }
.footer-links a:hover { color: white; }
.footer-bottom { grid-column: 1 / -1; padding-top: 1.2rem; display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .78rem; }

@media (max-width: 880px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 3rem; }
  h1 { max-width: 13ch; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .principles .section { grid-template-columns: 1fr; gap: 1.6rem; }
}
@media (max-width: 600px) {
  .nav { width: min(100% - 1.2rem, 1180px); }
  .hero, .section, .content-page, .content-page.wide { width: min(100% - 1.2rem, 1180px); }
  .hero { padding-top: 2.2rem; }
  .calc-grid, .result-top, .card-grid, .footer-inner { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .footer-bottom { grid-column: auto; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
