:root {
  --paper: #edf2ee;
  --ink: #17211f;
  --muted: #60716d;
  --line: #c6d0cb;
  --field: #fbfcf7;
  --cedar: #5a2736;
  --copper: #b7673c;
  --steel: #2f5d62;
  --mint: #d9eadf;
  --danger: #a44732;
  --ok: #2d6a4f;
  --shadow: 0 18px 55px rgba(47, 39, 27, 0.14);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(29, 37, 34, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(29, 37, 34, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(29, 37, 34, 0.11);
  background: rgba(237, 242, 238, 0.9);
  backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--ink);
  background: var(--mint);
  color: var(--steel);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 900;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.nav-links a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(47, 93, 98, 0.1);
  color: var(--ink);
  outline: none;
}

.hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 30px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
  gap: 28px;
  align-items: start;
}

.kicker {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 18px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: rgba(251, 252, 247, 0.82);
  color: var(--cedar);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
  line-height: 1.03;
}

h1 {
  max-width: 760px;
  font-size: clamp(42px, 7vw, 84px);
  font-weight: 900;
}

.lead {
  max-width: 640px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 19px;
}

.hero-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.note {
  border: 1px solid var(--line);
  background: rgba(251, 252, 247, 0.76);
  padding: 14px;
}

.note strong {
  display: block;
  font-size: 20px;
}

.note span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.calculator-shell {
  border: 2px solid var(--ink);
  background: var(--field);
  box-shadow: var(--shadow);
}

.ledger-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 2px solid var(--ink);
  background: var(--steel);
  color: white;
  padding: 13px 16px;
}

.ledger-head h2 {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.2;
}

.ledger-stamp {
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.tab {
  border: 0;
  border-right: 1px solid var(--line);
  background: #e2e9e5;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  min-height: 46px;
  padding: 10px;
}

.tab:last-child {
  border-right: 0;
}

.tab[aria-selected="true"] {
  background: var(--field);
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--copper);
}

.tool-panel {
  display: none;
  padding: 18px;
}

.tool-panel.active {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #aebbb6;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 10px 11px;
}

.field input:focus,
.field select:focus,
.button:focus-visible {
  outline: 3px solid rgba(183, 103, 60, 0.32);
  outline-offset: 2px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.action-note {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--steel);
  font-size: 13px;
  font-weight: 750;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  padding: 10px 14px;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
}

.button:hover {
  transform: translateY(-1px);
}

.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.metric {
  min-height: 102px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 14px;
}

.metric.wide {
  grid-column: 1 / -1;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  margin-top: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.metric-value.compact {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 19px;
  line-height: 1.28;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.status-strong {
  color: var(--ok);
}

.status-borderline {
  color: var(--copper);
}

.status-weak {
  color: var(--danger);
}

.rent-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 14px;
}

.rent-table th,
.rent-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  text-align: left;
}

.rent-table td:last-child,
.rent-table th:last-child {
  text-align: right;
  font-weight: 850;
}

.content-band {
  border-top: 1px solid var(--line);
  padding: 52px 0;
}

.content-inner {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
}

.content-inner h2 {
  font-size: clamp(28px, 4vw, 46px);
}

.content-inner h3 {
  margin-top: 28px;
  font-size: 24px;
}

.content-inner p,
.content-inner li {
  color: #42504a;
  font-size: 17px;
}

.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: start;
}

.formula {
  border-left: 5px solid var(--steel);
  background: rgba(251, 252, 247, 0.78);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  padding: 14px 16px;
  overflow-x: auto;
}

.faq {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.faq details {
  border: 1px solid var(--line);
  background: rgba(251, 252, 247, 0.8);
  padding: 14px 16px;
}

.faq summary {
  cursor: pointer;
  font-weight: 850;
}

.disclaimer-box {
  border: 1px solid var(--line);
  background: rgba(217, 234, 223, 0.5);
  color: #41514a;
  padding: 16px;
  font-size: 14px;
}

.report-card {
  display: none;
  margin-top: 18px;
  border: 1px solid var(--line);
  background: white;
  padding: 18px;
}

.report-card h3 {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.2;
}

.report-date,
.report-disclaimer {
  color: var(--muted);
  font-size: 13px;
}

.report-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.report-card dl div {
  border: 1px solid var(--line);
  padding: 12px;
}

.report-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.report-card dd {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 900;
}

.site-footer {
  border-top: 2px solid var(--ink);
  background: #dfe8e3;
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner a {
  margin-left: 12px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.simple-page {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0;
}

.simple-page h1 {
  font-size: clamp(38px, 6vw, 68px);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.resource-card {
  border: 1px solid var(--line);
  background: rgba(251, 252, 247, 0.86);
  padding: 18px;
  text-decoration: none;
}

.resource-card:hover,
.resource-card:focus-visible {
  border-color: var(--steel);
  outline: 3px solid rgba(47, 93, 98, 0.14);
}

.resource-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.resource-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.article-page {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0;
}

.article-page h1 {
  font-size: clamp(38px, 6vw, 70px);
}

.article-page h2 {
  margin-top: 38px;
  font-size: clamp(27px, 4vw, 42px);
}

.article-page h3 {
  margin-top: 26px;
  font-size: 24px;
}

.article-page p,
.article-page li {
  color: #42504a;
  font-size: 18px;
}

.answer-card,
.article-callout {
  border: 1px solid var(--line);
  background: rgba(251, 252, 247, 0.9);
  padding: 18px;
  margin: 24px 0;
}

.answer-card {
  border-left: 6px solid var(--steel);
}

.article-callout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  background: rgba(251, 252, 247, 0.86);
}

.article-table th,
.article-table td {
  border: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.article-table th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.checklist {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
}

.checklist li {
  border-left: 4px solid var(--copper);
  background: rgba(251, 252, 247, 0.7);
  padding: 10px 12px;
}

@media (max-width: 920px) {
  .hero-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 34px;
  }

  .calculator-shell {
    order: -1;
  }
}

@media (max-width: 680px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero-notes,
  .form-grid,
  .results,
  .tabs,
  .resource-grid,
  .article-callout {
    grid-template-columns: 1fr;
  }

  .tab {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-inner a {
    display: inline-block;
    margin: 0 12px 8px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  html {
    scroll-behavior: auto;
  }

  .button:hover {
    transform: none;
  }
}

@media print {
  body {
    background: white;
  }

  .site-header,
  .hero > .hero-grid > div:first-child,
  .tabs,
  .form-grid,
  .actions,
  .action-note,
  .results,
  .content-band,
  .site-footer {
    display: none !important;
  }

  .hero,
  .hero-grid,
  .calculator-shell,
  .tool-panel.active,
  .report-card {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .ledger-head {
    color: var(--ink);
    background: white;
    border-bottom: 2px solid var(--ink);
    padding: 0 0 12px;
  }

  .report-card {
    padding-top: 18px !important;
  }
}
