:root {
  --page: #f6f6f2;
  --surface: #ffffff;
  --surface-soft: #f0f1eb;
  --ink: #17221d;
  --muted: #66706a;
  --line: #dfe3dc;
  --accent: #206044;
  --accent-dark: #174a34;
  --tax: #7d9b82;
  --insurance: #bec9b7;
  --other: #d8c89e;
  --danger: #a63f33;
  --radius: 18px;
  --small-radius: 9px;
  --shadow: 0 18px 50px rgba(30, 45, 36, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--ink); }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.site-header, main, footer { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.site-header { min-height: 78px; padding: 12px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; color: #fff; background: var(--accent); border-radius: 50% 50% 50% 12px; font-family: Georgia, serif; }
.site-nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 6px 18px; }
.site-nav a { color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }

.intro { padding: 72px 0 46px; max-width: 760px; }
.eyebrow, .step { margin: 0 0 12px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 20px; max-width: 700px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 7vw, 72px); font-weight: 400; line-height: .98; letter-spacing: -.045em; }
.lede { margin-bottom: 0; max-width: 650px; color: var(--muted); font-size: 19px; line-height: 1.6; }

.calculator { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); align-items: start; gap: 24px; }
.inputs-card, .results-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.inputs-card { padding: 32px; }
.results-card { position: sticky; top: 24px; padding: 32px; color: #f7faf7; background: var(--ink); border-color: var(--ink); box-shadow: var(--shadow); }
.results-card .step { color: #a9c7b5; }
.card-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 28px; }
.card-heading h2, .explanation h2 { margin: 0; font-family: Georgia, serif; font-size: 28px; font-weight: 400; letter-spacing: -.02em; }
.text-button { min-height: 40px; padding: 0 10px; border: 0; color: var(--muted); background: transparent; border-radius: 7px; cursor: pointer; }
.text-button:hover { color: var(--ink); background: var(--surface-soft); }
.reset-link { display: inline-flex; align-items: center; text-decoration: none; }
.calculate-button { width: 100%; min-height: 50px; margin-top: 26px; border: 0; border-radius: var(--small-radius); color: #fff; background: var(--accent); font-weight: 700; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.calculate-button:hover { background: var(--accent-dark); }
.calculate-button:active { transform: translateY(1px); }

.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { min-width: 0; }
.field.full { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 650; }
input, select { width: 100%; height: 48px; padding: 0 13px; color: var(--ink); background: var(--surface); border: 1px solid #cfd5ce; border-radius: var(--small-radius); outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(32, 96, 68, .14); }
input:invalid:not(:focus) { border-color: #c89088; }
.input-affix { display: flex; align-items: center; height: 48px; overflow: hidden; background: var(--surface); border: 1px solid #cfd5ce; border-radius: var(--small-radius); transition: border-color .15s ease, box-shadow .15s ease; }
.input-affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(32, 96, 68, .14); }
.input-affix span { padding-left: 14px; color: var(--muted); white-space: nowrap; font-size: 14px; }
.input-affix input { height: 46px; border: 0; border-radius: 0; box-shadow: none; }
.input-affix.suffix span { padding: 0 14px 0 4px; }
.field-note { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.optional-fields { margin-top: 24px; border-top: 1px solid var(--line); }
.optional-fields summary { display: flex; align-items: center; justify-content: space-between; min-height: 58px; font-size: 14px; font-weight: 650; cursor: pointer; list-style: none; }
.optional-fields summary::-webkit-details-marker { display: none; }
.optional-fields[open] summary span { transform: rotate(45deg); }
.details-grid { padding-top: 6px; }
.form-error { margin: 20px 0 0; padding: 12px; color: var(--danger); background: #fff1ef; border-radius: 8px; font-size: 14px; }

.monthly-total { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 26px; }
.monthly-total span { font-family: Georgia, serif; font-size: clamp(44px, 6vw, 64px); letter-spacing: -.04em; }
.monthly-total small { color: #aeb9b2; font-size: 14px; }
.payment-bar { display: flex; width: 100%; height: 8px; margin-bottom: 22px; overflow: hidden; background: #34413a; border-radius: 99px; }
.bar { width: 0; transition: width .18s ease; }
.principal { background: #eef4ef; }
.tax { background: var(--tax); }
.insurance { background: var(--insurance); }
.other { background: var(--other); }
.breakdown { margin: 0; }
.breakdown > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #34413a; }
.breakdown dt { color: #bdc7c0; font-size: 14px; }
.breakdown dd { margin: 0; font-size: 14px; font-weight: 650; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; }
.loan-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 24px 0 20px; }
.loan-summary div { min-width: 0; }
.loan-summary span, .loan-summary strong { display: block; }
.loan-summary span { margin-bottom: 5px; color: #96a49b; font-size: 11px; }
.loan-summary strong { overflow-wrap: anywhere; font-size: 13px; }
.result-note { margin: 0; color: #8e9b93; font-size: 11px; line-height: 1.5; }

.explanation { display: grid; grid-template-columns: .7fr 1.3fr; gap: 64px; padding: 112px 0; }
.explanation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.explanation article { border-top: 1px solid var(--line); padding-top: 18px; }
.explanation article > span { color: var(--accent); font-size: 12px; font-weight: 700; }
.explanation h3 { margin: 24px 0 10px; font-size: 16px; }
.explanation article p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
footer { display: flex; justify-content: space-between; gap: 24px; padding: 28px 0 42px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
footer p { margin: 0; }
footer a { color: var(--muted); margin-right: 16px; text-underline-offset: 3px; }
footer a:hover { color: var(--accent); }
.page-main { width: min(880px, calc(100% - 48px)); margin-inline: auto; }
.content-hero { padding: 74px 0 44px; max-width: 760px; }
.content-hero h1 { font-size: clamp(38px, 6vw, 62px); }
.content-hero .lede { max-width: 680px; }
.faq-list { margin-bottom: 96px; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 0; font-weight: 700; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary span { color: var(--accent); font-size: 22px; font-weight: 400; }
.faq-list details[open] summary span { transform: rotate(45deg); }
.faq-list details p { max-width: 690px; padding: 0 36px 22px 0; margin: 0; color: var(--muted); line-height: 1.7; }
.prose-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding-bottom: 104px; }
.prose-grid article, .content-callout { padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.prose-grid h2, .legal-copy h2, .guide-list h2 { margin: 0 0 12px; font-family: Georgia, serif; font-size: 25px; font-weight: 400; letter-spacing: -.02em; }
.prose-grid p, .legal-copy p, .guide-list p { margin: 0; color: var(--muted); line-height: 1.7; }
.content-callout { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: -42px 0 104px; background: var(--surface-soft); }
.content-callout p { margin: 0; font-family: Georgia, serif; font-size: 25px; }
.inline-button { width: auto; min-width: 170px; margin: 0; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.guide-list { margin-bottom: 104px; border-top: 1px solid var(--line); }
.guide-list article { display: grid; grid-template-columns: 64px 1fr; gap: 20px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.guide-list article > span { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.guide-list h2 { margin-bottom: 7px; }
.legal-copy { max-width: 720px; padding-bottom: 104px; }
.legal-copy h2 { margin-top: 40px; }

:focus-visible { outline: 3px solid rgba(32, 96, 68, .3); outline-offset: 3px; }

@media (max-width: 880px) {
  .calculator { grid-template-columns: 1fr; }
  .results-card { position: static; }
  .explanation { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 620px) {
  .site-header, main, footer { width: min(100% - 32px, 1180px); }
  .intro { padding: 50px 0 34px; }
  .lede { font-size: 17px; }
  .inputs-card, .results-card { padding: 24px 20px; }
  .two-columns, .explanation-grid { grid-template-columns: 1fr; }
  .loan-summary { gap: 14px; }
  .explanation { padding: 72px 0; }
  footer { flex-direction: column; }
  .site-header { align-items: flex-start; }
  .site-nav { padding-top: 8px; gap: 8px 12px; }
  .page-main { width: min(100% - 32px, 880px); }
  .content-hero { padding: 52px 0 32px; }
  .prose-grid { grid-template-columns: 1fr; padding-bottom: 90px; }
  .content-callout { align-items: flex-start; flex-direction: column; margin: -32px 0 80px; }
  .inline-button { width: 100%; }
}
