/* Investment Calculator Hub - single stylesheet, no build step */
:root {
  --ink: #10203a;
  --ink-2: #2b3a55;
  --muted: #5e6a7d;
  --paper: #f6f4ee;
  --paper-2: #ece8dd;
  --white: #ffffff;
  --line: #d9d4c7;
  --line-soft: #e8e4d9;
  --green: #0f7a5a;
  --green-soft: #e1f2ea;
  --red: #a8402b;
  --gold: #b8923a;
  --focus: #1d4ed8;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); margin-top: 0; }
h3 { font-size: 1.25rem; margin-top: 1.6em; }
p { margin: 0 0 1.1em; }
strong { font-weight: 600; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; font-size: 0.92em; background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 20px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 6px; z-index: 10; }
.skip:focus { top: 12px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand svg { width: 28px; height: 28px; flex: none; }
.site-nav { display: flex; gap: 22px; font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--ink-2); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--green); }

/* Hero + calculator */
.hero { padding: 40px 0 20px; }
.eyebrow { display: inline-block; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); font-weight: 600; margin-bottom: 14px; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; margin-bottom: 0; }

.calc { margin: 28px 0 0; display: grid; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); box-shadow: 0 1px 2px rgba(16,32,58,0.04), 0 12px 40px -24px rgba(16,32,58,0.25); }
.calc-inputs { padding: 28px 24px; }
.calc-results { padding: 28px 24px; background: var(--ink); color: #fff; }
@media (min-width: 860px) {
  .calc { grid-template-columns: 1fr 1fr; }
  .calc-inputs, .calc-results { padding: 36px; }
}

.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; }
.field .hint { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.control { position: relative; display: flex; align-items: center; }
.control .prefix, .control .suffix { position: absolute; color: var(--muted); font-size: 1rem; pointer-events: none; }
.control .prefix { left: 14px; }
.control .suffix { right: 14px; }
.control input {
  width: 100%; font: inherit; font-size: 1.2rem; font-variant-numeric: tabular-nums;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
  color: var(--ink); min-height: 50px;
}
.control input.has-prefix { padding-left: 30px; }
.control input.has-suffix { padding-right: 64px; }
.control input:focus { border-color: var(--ink); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(29,78,216,0.2); }
.control input[aria-invalid="true"] { border-color: var(--red); }
.error { color: var(--red); font-size: 0.85rem; margin-top: 6px; min-height: 1.2em; }

.results-title { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: #a9b6cc; margin: 0 0 18px; font-weight: 600; }
.results { margin: 0; }
.result { padding: 14px 0; border-top: 1px solid rgba(255,255,255,0.12); }
.result:first-of-type { border-top: 0; padding-top: 0; }
.result dt { font-size: 0.95rem; color: #c4cddc; margin-bottom: 4px; }
.result dd { margin: 0; font-family: var(--serif); font-size: 2.1rem; line-height: 1.1; font-variant-numeric: tabular-nums; min-height: 1.1em; }
.result.primary dd { font-size: 2.9rem; }
.result dd.pos { color: #6fe0b4; }
.result dd.neg { color: #ff9f88; }
.result dd.idle { color: #8b98ad; font-size: 1.2rem; font-family: var(--sans); padding-top: 6px; }
.result .note { display: block; font-size: 0.85rem; line-height: 1.4; min-height: 0; color: #a9b6cc; margin-top: 6px; font-family: var(--sans); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 18px 0 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; font-size: 0.98rem; padding: 12px 18px; border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; min-height: 46px; }
.btn:hover { background: var(--ink-2); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--green); }
.actions .status { font-size: 0.9rem; color: var(--muted); width: 100%; min-height: 1.3em; margin: 0; }


/* Editorial content */
.content { padding: 8px 0 40px; }
.prose { max-width: 70ch; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.5em; }
.section { padding: 36px 0; border-top: 1px solid var(--line-soft); }
.section:first-of-type { border-top: 0; }

.band { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 32px 24px; margin: 8px 0 24px; }
@media (min-width: 860px) { .band { padding: 40px 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; } }
.band h3 { margin-top: 0; color: #fff; font-size: 1.1rem; }
.band p { color: #c4cddc; margin-bottom: 0.6em; }
.formula { font-family: var(--serif); font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.5; color: #fff; margin: 0 0 12px; }
.formula sup { font-size: 0.65em; }

table { width: 100%; border-collapse: collapse; font-size: 0.98rem; font-variant-numeric: tabular-nums; margin: 18px 0 8px; }
caption { text-align: left; font-weight: 600; padding-bottom: 10px; font-family: var(--serif); font-size: 1.1rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
td.num, th.num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.examples { display: grid; gap: 28px; margin-top: 8px; }
@media (min-width: 860px) { .examples { grid-template-columns: 1fr 1fr 1fr; gap: 36px; } }
.example h3 { margin-top: 0; }
.example .steps { margin: 10px 0 0; padding: 0 0 0 16px; list-style: none; border-left: 2px solid var(--green); }
.example .steps li { margin-bottom: 8px; font-size: 0.98rem; }
.example .verdict { font-weight: 600; margin-top: 10px; }

.mistakes { counter-reset: m; list-style: none; padding: 0; margin: 0; max-width: 70ch; }
.mistakes li { counter-increment: m; position: relative; padding-left: 56px; margin-bottom: 22px; }
.mistakes li::before { content: counter(m, decimal-leading-zero); position: absolute; left: 0; top: 2px; font-family: var(--serif); font-size: 1.6rem; color: var(--gold); line-height: 1; }
.mistakes li strong { display: block; margin-bottom: 2px; }

.faq { max-width: 76ch; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 40px 16px 0; font-weight: 600; font-size: 1.05rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.5rem; color: var(--green); font-weight: 400; }
.faq details[open] summary::after { content: "-"; }
.faq .answer { padding: 0 0 18px; color: var(--ink-2); }
.faq .answer p:last-child { margin-bottom: 0; }

/* Subpages */
.page { padding: 40px 0 56px; }
.page h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.page .prose h2 { font-size: 1.4rem; margin-top: 1.8em; }
.breadcrumb { font-size: 0.9rem; color: var(--muted); margin: 0 0 18px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; }
.breadcrumb li + li::before { content: "/"; margin: 0 8px; color: var(--line); }
.breadcrumb a { color: var(--muted); }
.notice { border-left: 3px solid var(--gold); background: var(--white); padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 20px 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: grid; gap: 16px; }
@media (min-width: 860px) { .site-footer .wrap { grid-template-columns: 1fr auto; align-items: start; } }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-nav a { color: var(--ink-2); text-decoration: none; }
.footer-nav a:hover { color: var(--green); }
.site-footer p { margin: 0 0 6px; max-width: 62ch; }
