/* ================================================================
   ExchangeCalc — sitewide stylesheet
   Deed-green ledger aesthetic: paper grid, serif display, mono numbers
   ================================================================ */
:root {
  --paper: #fbfcfa;
  --grid-line: rgba(30, 92, 70, 0.07);
  --ink: #1c2b26;
  --ink-soft: #51655d;
  --deed-green: #1e5c46;
  --deed-green-dark: #14412f;
  --brass: #9a7b2d;
  --boot-red: #a4432f;
  --card: #ffffff;
  --hairline: #d9e2dd;
  --focus: #2a7c5f;
  --radius: 6px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 80px; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hairline);
}
.navbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; height: 60px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 19px; font-weight: 700;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.brand-accent { color: var(--deed-green); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 6px; background: var(--deed-green);
  color: #fff; font-family: var(--font-num); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; letter-spacing: 0;
}
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; }
.nav-links a {
  font-size: 14px; font-weight: 600; color: var(--ink-soft); text-decoration: none;
  padding: 6px 2px; border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--deed-green-dark); border-bottom-color: var(--deed-green); }
.nav-cta {
  background: var(--deed-green); color: #fff !important; padding: 8px 16px !important;
  border-radius: 5px; border-bottom: none !important;
}
.nav-cta:hover { background: var(--deed-green-dark); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--hairline); border-radius: 5px;
  padding: 7px 10px; font-size: 16px; line-height: 1; color: var(--ink); cursor: pointer;
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--hairline); padding: 8px 20px 14px;
    box-shadow: 0 8px 16px rgba(28, 43, 38, 0.08);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 2px; border-bottom: 1px dotted var(--hairline); }
  .nav-links li:last-child a { margin-top: 10px; text-align: center; }
}

/* ---------- Breadcrumbs ---------- */
.crumbs { padding: 16px 0 0; font-size: 12.5px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li + li::before { content: "\203A"; color: var(--ink-soft); margin: 0 4px; }
.crumbs a { color: var(--deed-green); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { color: var(--ink-soft); }

/* ---------- Page header / hero ---------- */
header.page-head { padding: 34px 0 26px; border-bottom: 3px double var(--deed-green); margin-bottom: 30px; }
.eyebrow {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--deed-green); font-weight: 600; margin-bottom: 8px;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.2vw, 42px);
  font-weight: 600; letter-spacing: -0.01em; line-height: 1.12;
}
.subhead { color: var(--ink-soft); max-width: 66ch; margin-top: 10px; font-size: 15.5px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(28, 43, 38, 0.04);
}
.card h2 {
  font-family: var(--font-display); font-size: 19px; font-weight: 600;
  padding-bottom: 10px; margin-bottom: 16px; border-bottom: 1px solid var(--hairline);
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.card h2 .tag {
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft);
}

/* ---------- Calculator inputs ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .results { position: static; } }
.results { position: sticky; top: 76px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field .hint { display: block; font-weight: 400; font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.money { position: relative; }
.money::before {
  content: "$"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-soft); font-size: 14px; pointer-events: none;
}
.pct { position: relative; }
.pct::after {
  content: "%"; position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-soft); font-size: 14px; pointer-events: none;
}
input[type="text"], input[type="date"], select {
  width: 100%; padding: 9px 11px; font-size: 15px; font-family: var(--font-num);
  border: 1px solid #c3d0c9; border-radius: 4px; background: #fdfefd; color: var(--ink);
}
.money input { padding-left: 24px; }
.pct input { padding-right: 26px; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 1px;
}
select { font-family: var(--font-body); }
.check { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; font-size: 13.5px; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--deed-green); }
.check span b { font-weight: 600; }
.check .hint { color: var(--ink-soft); font-size: 12px; display: block; }

/* ---------- Results components ---------- */
.headline-num {
  font-family: var(--font-num); font-size: clamp(30px, 4vw, 38px); font-weight: 700;
  color: var(--deed-green-dark); letter-spacing: -0.02em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.headline-label {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 600; margin-bottom: 4px;
}
.split-bar {
  display: flex; height: 14px; border-radius: 7px; overflow: hidden;
  margin: 14px 0 8px; border: 1px solid var(--hairline); background: #eef2ef;
}
.split-bar .deferred { background: var(--deed-green); transition: width 0.25s ease; }
.split-bar .recognized { background: var(--boot-red); transition: width 0.25s ease; }
@media (prefers-reduced-motion: reduce) {
  .split-bar .deferred, .split-bar .recognized { transition: none; }
}
.split-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); }
.split-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot.g { background: var(--deed-green); } .dot.r { background: var(--boot-red); }
table.ledger { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 6px; }
table.ledger td { padding: 6px 0; border-bottom: 1px dotted var(--hairline); vertical-align: top; }
table.ledger td:last-child {
  text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap;
}
table.ledger tr.total td { border-bottom: none; border-top: 2px solid var(--ink); font-weight: 700; padding-top: 8px; }
table.ledger tr.section td { border-bottom: none; padding-top: 12px; font-weight: 700; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.neg { color: var(--boot-red); }
.pos { color: var(--deed-green-dark); }
.req { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 13.5px; border-bottom: 1px dotted var(--hairline); }
.req:last-child { border-bottom: none; }
.req .mark { font-family: var(--font-num); font-weight: 700; flex-shrink: 0; width: 18px; text-align: center; }
.req.met .mark { color: var(--deed-green); }
.req.unmet .mark { color: var(--boot-red); }

/* ---------- Deadline timeline ---------- */
.timeline { margin-top: 18px; }
.timeline-track { position: relative; height: 4px; background: var(--hairline); border-radius: 2px; margin: 46px 8px 50px; }
.tl-node { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 12px; height: 12px; border-radius: 50%; background: var(--deed-green); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--deed-green); }
.tl-node.brass { background: var(--brass); box-shadow: 0 0 0 1px var(--brass); }
.tl-label { position: absolute; transform: translateX(-50%); font-size: 11.5px; text-align: center; width: 130px; color: var(--ink-soft); }
.tl-label.above { bottom: 16px; } .tl-label.below { top: 16px; }
.tl-label b { display: block; color: var(--ink); font-family: var(--font-num); font-size: 12.5px; }
.tl-fill { position: absolute; height: 100%; background: linear-gradient(90deg, var(--deed-green), var(--brass)); border-radius: 2px; }

/* ---------- Article typography ---------- */
article.prose { max-width: 760px; }
article.prose h2 {
  font-family: var(--font-display); font-size: 24px; font-weight: 600;
  margin: 34px 0 12px; line-height: 1.2;
}
article.prose h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 24px 0 8px; }
article.prose p { margin-bottom: 14px; font-size: 15.5px; line-height: 1.65; }
article.prose ul, article.prose ol { margin: 0 0 14px 22px; font-size: 15.5px; line-height: 1.65; }
article.prose li { margin-bottom: 6px; }
article.prose a { color: var(--deed-green); text-decoration-thickness: 1px; text-underline-offset: 2px; }
article.prose a:hover { color: var(--deed-green-dark); }
article.prose strong { font-weight: 650; }
article.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 16px 0 20px; background: #fff; }
article.prose th {
  text-align: left; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft); border-bottom: 2px solid var(--ink); padding: 8px 10px;
}
article.prose td { padding: 9px 10px; border-bottom: 1px dotted var(--hairline); vertical-align: top; }
article.prose td.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.example-box {
  background: #fff; border: 1px solid var(--hairline); border-left: 4px solid var(--brass);
  border-radius: var(--radius); padding: 16px 18px; margin: 18px 0; font-size: 14.5px;
}
.example-box .example-label {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
  color: var(--brass); display: block; margin-bottom: 6px;
}
.warn-box {
  background: #fdf6f4; border: 1px solid #ecd4cd; border-left: 4px solid var(--boot-red);
  border-radius: var(--radius); padding: 16px 18px; margin: 18px 0; font-size: 14.5px;
}
.warn-box .warn-label {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
  color: var(--boot-red); display: block; margin-bottom: 6px;
}

/* ---------- CTA box ---------- */
.cta-box {
  display: block; background: var(--deed-green); color: #fff; text-decoration: none;
  border-radius: var(--radius); padding: 18px 22px; margin: 22px 0;
  box-shadow: 0 2px 6px rgba(20, 65, 47, 0.25);
}
.cta-box:hover { background: var(--deed-green-dark); }
.cta-box .cta-title { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.cta-box .cta-sub { display: block; font-size: 13.5px; color: #cfe0d7; margin-top: 3px; }

/* ---------- Related grid ---------- */
.related { margin-top: 40px; }
.related h2 {
  font-family: var(--font-display); font-size: 21px; font-weight: 600; margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 3px double var(--deed-green);
}
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.related-grid a {
  background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 14px 16px; text-decoration: none; color: var(--ink);
  box-shadow: 0 1px 2px rgba(28, 43, 38, 0.04);
}
.related-grid a:hover { border-color: var(--deed-green); }
.related-grid b { display: block; font-size: 14.5px; margin-bottom: 4px; color: var(--deed-green-dark); }
.related-grid span { font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }

/* ---------- FAQ ---------- */
.faq-item { padding: 12px 0; border-bottom: 1px dotted var(--hairline); }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-item h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.faq-item p { font-size: 14px; color: var(--ink-soft); max-width: 75ch; }
.faq-card { margin-top: 32px; }

/* ---------- Site footer ---------- */
.site-footer {
  background: var(--deed-green-dark); color: #cfe0d7; margin-top: 40px;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 28px 28px;
}
.footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 44px 20px 28px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 32px;
}
@media (max-width: 900px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-inner { grid-template-columns: 1fr; gap: 26px; } }
.footer-inner h3 {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; margin: 18px 0 10px; font-weight: 700;
}
.footer-inner h3:first-child { margin-top: 0; }
.footer-inner p { font-size: 13.5px; line-height: 1.6; margin-bottom: 10px; }
.footer-fineprint { font-size: 12px; color: #9dbcac; }
.footer-brand {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  font-family: var(--font-display); font-size: 19px; font-weight: 700; color: #fff;
}
.footer-brand .brand-mark { background: rgba(255,255,255,0.14); }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 7px; }
.footer-links a { color: #cfe0d7; text-decoration: none; font-size: 13.5px; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.14);
  max-width: 1120px; margin: 0 auto; padding: 16px 20px 22px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 12.5px; color: #9dbcac;
}
