/* Normdale site styles (one file for the whole site).
   Design: Direction C, "clean trust layout in warm paper colors" (approved by Diego 2026-10-24).
   System fonts only: no web fonts, no third-party requests.
   Mobile first: 16 px side gutters, no horizontal scroll. */

:root {
  color-scheme: light dark;
  --bg: #ece7dc;
  --soft: #f6f0e2;
  --card: #fcfaf4;
  --ink: #3e2a24;
  --ink-strong: #2b1c17;
  --muted: #6b5c4d;      /* darker than the preview grey (#786959) for 4.5:1 text contrast */
  --link: #46597a;       /* darker than the preview blue (#5f7696) for 4.5:1 link contrast */
  --blue: #5f7696;
  --mustard: #dea834;
  --red: #b04a3a;
  --line: #d6cbb6;
  --btn-ink: #3e2a24;
  --shadow: #3e2a24;
  --foot-bg: #3e2a24;
  --foot-ink: #f6f0e2;
  --foot-link: #f0c25a;
  --draft-bg: #fff4d6;
  --draft-line: #b04a3a;
  --warn-bg: #fbeee0;
  /* Chart series (validated with the dataviz palette checker, light surface #fcfaf4): minimum, fixed, + extra */
  --c-min: #b8432f;
  --c-fixed: #3563b5;
  --c-extra: #178a50;
  --grid: #e3dacb;
  --radius: 12px;
  --gutter: 16px;
  --measure: 720px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1613;
    --soft: #271f1a;
    --card: #2b221d;
    --ink: #f1e8d9;
    --ink-strong: #fbf5ea;
    --muted: #c4b5a3;
    --link: #a9bddb;
    --blue: #9fb3cf;
    --mustard: #e2b04a;
    --red: #e88a78;
    --line: #4a3d33;
    --btn-ink: #2b1c17;
    --shadow: #000000;
    --foot-bg: #120e0c;
    --foot-ink: #ece3d4;
    --foot-link: #f0c25a;
    --draft-bg: #3a2a16;
    --draft-line: #e88a78;
    --warn-bg: #3a2418;
    --c-min: #dc6f5a;    /* dark steps validated against the dark card #2b221d */
    --c-fixed: #668fdb;
    --c-extra: #2aa868;
    --grid: #3d322a;
  }
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--font);
  overflow-wrap: break-word;
}

main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { color: var(--ink-strong); line-height: 1.15; }
h1 { font-size: clamp(30px, 7vw, 48px); font-weight: 800; margin: 0 0 14px; letter-spacing: -0.01em; }
h2 { font-size: clamp(22px, 4.5vw, 28px); font-weight: 800; margin: 36px 0 10px; }
h3 { font-size: 19px; font-weight: 700; margin: 24px 0 6px; }
p, ul, ol { margin: 0 0 14px; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: var(--gutter); top: -100px;
  background: var(--mustard); color: var(--btn-ink); padding: 8px 14px;
  font-weight: 700; border-radius: 8px; z-index: 10;
}
.skip-link:focus { top: 8px; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: 980px; }

/* ---------- Header: "Normdale" wordmark + logo only ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; min-height: 68px; max-width: 980px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink-strong); text-decoration: none;
  font-weight: 800; font-size: 22px; letter-spacing: .3px;
}
.brand img {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--soft); border: 1px solid var(--line);
}

/* ---------- Draft banner (remove on launch day together with the copy) ---------- */
.draft-banner {
  margin: 16px 0 0; padding: 10px 14px;
  background: var(--draft-bg); border: 2px dashed var(--draft-line); border-radius: 10px;
  font-size: 15px;
}
.draft-banner strong { color: var(--red); letter-spacing: .08em; }
.draft { /* inline marker for placeholder text */
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .08em;
  color: var(--red); border: 1px solid var(--red); border-radius: 4px; padding: 0 5px; margin-right: 6px;
  vertical-align: 2px;
}
.placeholder { color: var(--muted); font-style: italic; }

/* ---------- Page blocks ---------- */
.page { padding-top: 0; padding-bottom: 48px; }
.page > h1 { margin-top: 28px; }
.hero { text-align: center; padding: 36px 0 12px; }
.sub { font-size: 19px; color: var(--muted); margin: 0 0 14px; max-width: 34em; }
.hero .sub { margin: 0 auto 6px; }
.byline { font-size: 15px; color: var(--muted); margin-bottom: 22px; }

.btn {
  display: inline-block; width: 100%; max-width: 420px; margin-top: 18px;
  background: var(--mustard); color: var(--btn-ink); text-decoration: none; text-align: center;
  font-weight: 800; font-size: 18px; padding: 14px 18px;
  border: 2px solid var(--btn-ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--shadow);
}
.btn:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--shadow); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 18px 0;
}
.card-soft { background: var(--soft); }
.card-dashed { border-style: dashed; border-width: 2px; }

.grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 18px 0; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid .card { margin: 0; }
.card h3 { margin-top: 0; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }

.fact b { display: block; font-size: 26px; line-height: 1.2; color: var(--red); }

.trust-bar {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 14px 0; margin: 30px 0 0; font-size: 15px; color: var(--muted); text-align: center;
}

/* Payoff tool shell */
.tool-shell { text-align: center; padding: 28px 18px; }
.tool-shell p { margin-bottom: 8px; }
.ep-note {
  background: var(--soft); border-left: 4px solid var(--mustard); border-radius: 8px;
  padding: 12px 14px; margin: 18px 0; font-size: 16px;
}
.ep-note p:last-child { margin-bottom: 0; }
.ep-results { padding-left: 20px; margin-bottom: 10px; }
.ep-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.ep-actions .btn { margin-top: 0; }

/* ---------- Payoff Calculator ---------- */
.btn { cursor: pointer; font-family: inherit; }
.btn-small { width: auto; font-size: 16px; padding: 9px 14px; }
.btn-plain { background: var(--card); color: var(--ink-strong); border-color: var(--ink); }

.calc { padding: 18px 16px; }
.calc .btn { margin-top: 8px; }
.field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 700; color: var(--ink-strong); margin-bottom: 6px; padding: 0; line-height: 1.35; }
.sub-label { display: block; font-weight: 700; font-size: 16px; margin: 12px 0 6px; color: var(--ink-strong); }
.help { font-size: 15px; color: var(--muted); margin: 6px 0 0; line-height: 1.45; }
.optional { font-weight: 400; color: var(--muted); }
.tag-inline { display: inline-block; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; margin-top: 2px; }

.input-wrap {
  display: flex; align-items: center; width: 100%; max-width: 260px;
  background: var(--card); border: 2px solid var(--muted); border-radius: 10px;
}
.input-wrap:focus-within { outline: 3px solid var(--mustard); outline-offset: 2px; }
.input-wrap > span { padding: 0 4px 0 12px; color: var(--muted); font-weight: 700; }
.input-suffix > span { padding: 0 12px 0 4px; }
.input-wrap input {
  flex: 1 1 auto; min-width: 0; width: 100%; border: 0; background: transparent; color: var(--ink-strong);
  font: 600 19px/1.3 var(--font); padding: 11px 12px 11px 4px; outline: none;
}
.input-suffix input { padding-left: 12px; }
.input-wrap input[aria-invalid="true"] { color: var(--red); }
.input-wrap:has(input[aria-invalid="true"]) { border-color: var(--red); }
.input-small { display: inline-flex; width: 96px; vertical-align: middle; }
.input-small input { font-size: 17px; padding-top: 6px; padding-bottom: 6px; }
.rule-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 0; }

.choices { display: grid; gap: 8px; margin-bottom: 4px; }
.choice {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; font-weight: 600;
}
.choice:has(input:checked) { border: 2px solid var(--ink); background: var(--soft); }
.choice input, .range-row input { accent-color: var(--ink); }
.choice input { width: 20px; height: 20px; margin: 0; flex: none; }

.range-row { display: flex; align-items: center; gap: 14px; }
.range-row input { flex: 1 1 auto; min-width: 0; height: 32px; margin: 0; }
.range-row output { min-width: 56px; font-weight: 800; font-size: 19px; color: var(--ink-strong); text-align: right; }

.field-msg { font-size: 15px; margin: 6px 0 0; font-weight: 600; }
.field-msg.is-error { color: var(--red); }
.field-msg.is-warn { color: var(--ink); }
.form-errors { border: 2px solid var(--red); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; background: var(--warn-bg); font-size: 15px; }
.form-errors ul { margin: 4px 0 0; padding-left: 20px; }
.form-errors-title { font-weight: 800; margin: 0; }

.results { margin: 8px 0 24px; scroll-margin-top: 12px; }
.results h2 { margin-top: 24px; }
.results h2:focus { outline: none; }
.empty-state { color: var(--muted); }
.result-hero { text-align: center; padding: 18px 14px; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--shadow); margin-top: 8px; }
.result-hero p { margin: 0; }
.result-label { font-size: 15px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.result-date { font-size: clamp(30px, 8vw, 40px); font-weight: 800; color: var(--ink-strong); line-height: 1.15; margin: 2px 0 4px !important; }
.result-months { font-size: 18px; font-weight: 700; }
.result-plan { font-size: 15px; color: var(--muted); margin-top: 4px !important; }

.warnings { list-style: none; padding: 0; margin: 14px 0; }
.warnings li { background: var(--warn-bg); border-left: 4px solid var(--red); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 16px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.stats > div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stats dt { font-size: 14px; color: var(--muted); line-height: 1.3; }
.stats dd { margin: 2px 0 0; font-size: 21px; font-weight: 800; color: var(--ink-strong); }
.stats dd.stat-note { font-size: 13px; font-weight: 400; color: var(--muted); line-height: 1.35; }

.table-wrap { overflow-x: auto; margin: 8px 0; }
.compare { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.compare th, .compare td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font-size: 13px; color: var(--muted); font-weight: 700; }
.compare th[scope="row"], .compare thead th:first-child { text-align: left; font-weight: 700; color: var(--ink-strong); }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare tr.is-yours { background: var(--soft); }
.compare td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-note { display: block; font-size: 12px; color: var(--muted); white-space: normal; }
.yours-tag { display: block; font-size: 12px; font-weight: 700; color: var(--muted); padding-left: 18px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c-min); }
.swatch.s-fixed { background: var(--c-fixed); }
.swatch.s-extra { background: var(--c-extra); }
.compare-summary { padding-left: 20px; font-weight: 700; margin: 10px 0 0; }

.chart { margin: 18px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 10px 8px; }
.chart figcaption { font-weight: 700; color: var(--ink-strong); font-size: 16px; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.legend { list-style: none; padding: 0; margin: 4px 0 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 11px var(--font); }
.chart .tick-title { font-size: 11px; }
.chart .series { stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke: var(--c-min); }
.chart .series.s-fixed { stroke: var(--c-fixed); stroke-dasharray: 7 4; }
.chart .series.s-extra { stroke: var(--c-extra); stroke-dasharray: 2 4; }
.chart .end-dot { fill: var(--c-min); stroke: var(--card); stroke-width: 2; }
.chart .end-dot.s-fixed { fill: var(--c-fixed); }
.chart .end-dot.s-extra { fill: var(--c-extra); }
.chart .crosshair { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-readout { font-size: 14px; color: var(--muted); margin: 4px 0 0; min-height: 2.9em; }
.result-actions { margin: 14px 0 0; }

.assumptions h2, .notice h2 { margin-top: 0; font-size: 21px; }
.assumptions ul { padding-left: 20px; }
.notice { border: 2px solid var(--ink); }
.notice p:last-child, .assumptions p:last-child { margin-bottom: 0; }
.sources li { margin-bottom: 8px; }

/* ---------- How we calculate ---------- */
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.data { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--card); border: 1px solid var(--line); margin: 8px 0 16px; }
.data th, .data td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.data th:first-child, .data td:first-child { text-align: left; }
.data thead th { font-size: 13px; color: var(--muted); }

@media print {
  .site-header, .site-footer, .skip-link, .calc, .ep-note, .result-actions, .chart-readout { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--foot-bg); color: var(--foot-ink); font-size: 15px; padding: 26px 0 30px; margin-top: 24px; }
.site-footer a { color: var(--foot-link); }
.site-footer p { margin: 0 0 10px; }
.footer-links { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { display: inline-block; padding: 4px 0; }
.footer-sign { opacity: .9; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 48px 0; }
.notfound img { width: 120px; height: 120px; border-radius: 50%; border: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .btn:hover { transform: none; }
}

/* About page: author photo (real photo of the founder) */
.author-photo { float: right; width: 120px; height: 120px; margin: 4px 0 12px 16px; border-radius: 50%; border: 3px solid var(--mustard); object-fit: cover; }

/* Payoff Calculator form: inverted theme so it stands out from the page.
   Light page = brown form; dark page = cream form. Same tokens as the page, swapped. */
.calc {
  color-scheme: dark;
  --soft: #271f1a; --card: #2b221d; --ink: #f1e8d9; --ink-strong: #fbf5ea; --muted: #c4b5a3;
  --link: #a9bddb; --mustard: #e2b04a; --red: #e88a78; --line: #4a3d33; --btn-ink: #2b1c17; --shadow: #000000;
  --warn-bg: #3a2418;
}
@media (prefers-color-scheme: dark) {
  .calc {
    color-scheme: light;
    --soft: #f6f0e2; --card: #fcfaf4; --ink: #3e2a24; --ink-strong: #2b1c17; --muted: #6b5c4d;
    --link: #46597a; --mustard: #dea834; --red: #b04a3a; --line: #d6cbb6; --btn-ink: #3e2a24; --shadow: #3e2a24;
    --warn-bg: #fbeee0;
  }
}

/* ---------- Breadcrumb (visible, mirrored in BreadcrumbList JSON-LD) ---------- */
.breadcrumb { font-size: 15px; color: var(--muted); margin: 0 0 14px; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.breadcrumb li + li::before { content: "\203A"; margin-right: 8px; }
.breadcrumb a { color: inherit; }

/* ---------- Cookie banner (built by consent.js; Accept and Reject share one style) ---------- */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--card); color: var(--ink); border-top: 2px solid var(--ink);
  padding: 16px var(--gutter) 18px; box-shadow: 0 -4px 0 rgba(0, 0, 0, .08);
}
.consent > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.consent-title { font-size: 18px; margin: 0 auto 6px; padding-right: 28px; }
.consent-text { font-size: 15px; margin: 0 auto 10px; }
.consent-actions { display: flex; gap: 12px; }
.consent-btn { flex: 1 1 0; width: auto; max-width: none; margin-top: 0; font-size: 16px; padding: 11px 14px; }
.consent-close {
  position: absolute; top: 8px; right: 10px; width: 44px; height: 44px; padding: 0;
  background: none; border: 0; color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer;
}
.consent-close:focus-visible, .consent-btn:focus-visible, .link-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.link-btn {
  background: none; border: 0; padding: 4px 0; margin: 0; font: inherit; color: var(--foot-link);
  text-decoration: underline; cursor: pointer;
}
@media print { .consent { display: none !important; } }
