/* Huisstijl Termijnrente.nl: zie docs/huisstijl.md */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  /* Brand colours: the same in light and dark mode */
  --brand: #0b6e69;
  --brand-deep: #084f4c;
  --gold: #f2b33d;
  --on-brand: #ffffff;
  --page: #f5f8f7;
  --surface: #ffffff;
  --text: #132a2e;
  --text-2: #57696c;
  --border: rgba(19, 42, 46, 0.11);
  --grid: #e5ebea;
  --axis: #bccac8;
  --accent: #0a6b66;
  --row-hover: #eef6f4;
  --good: #006c10;
  --good-bg: #e3f4e5;
  --bad: #b42d2e;
  --bad-bg: #fbe6e6;
  --tag-bg: #e9efee;
  --s1: #257de0;
  --s2: #f47230;
  --s3: #00b894;
  --s4: #f2a600;
  --curve: #008b82;
  --curve-prev: #7d8c8a;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", var(--font);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0b1314;
    --surface: #14201f;
    --text: #e9f1ef;
    --text-2: #93a7a5;
    --border: rgba(233, 241, 239, 0.10);
    --grid: #26332f;
    --axis: #3d4c49;
    --accent: #5cc8bb;
    --row-hover: #1b2b29;
    --good: #53c556;
    --good-bg: #16301a;
    --bad: #f07a7b;
    --bad-bg: #3a1a1a;
    --tag-bg: #22302e;
    --s1: #338ced;
    --s2: #e76624;
    --s3: #00a888;
    --s4: #d28e05;
  --curve: #26ab9d;
  --curve-prev: #748784;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b1314;
  --surface: #14201f;
  --text: #e9f1ef;
  --text-2: #93a7a5;
  --border: rgba(233, 241, 239, 0.10);
  --grid: #26332f;
  --axis: #3d4c49;
  --accent: #5cc8bb;
  --row-hover: #1b2b29;
  --good: #53c556;
  --good-bg: #16301a;
  --bad: #f07a7b;
  --bad-bg: #3a1a1a;
  --tag-bg: #22302e;
  --s1: #338ced;
  --s2: #e76624;
  --s3: #00a888;
  --s4: #d28e05;
  --curve: #26ab9d;
  --curve-prev: #748784;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.5 var(--font);
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--surface); border-top: 4px solid var(--brand); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em;
}
.brand-mark { width: 34px; height: 34px; flex: none; display: block; }
.brand:hover .brand-name { color: var(--accent); }
.site-header nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-header nav a { color: var(--text-2); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.site-header nav a:hover { color: var(--text); background: var(--tag-bg); }
.site-header nav a[aria-current="page"] { color: var(--text); font-weight: 600; background: var(--tag-bg); }

main { padding: 8px 16px 48px; }
section { margin-top: 40px; }
section.intro { margin-top: 32px; }
h1, h2, .tile-value, .facts dd.big { font-family: var(--font-display); letter-spacing: -0.015em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; font-weight: 800; margin: 0 0 10px; }
h2 { font-size: 1.35rem; font-weight: 700; margin: 0 0 4px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
.lead { font-size: 1.1rem; color: var(--text-2); margin: 0 0 8px; max-width: 60em; }
.muted { color: var(--text-2); }
.small { font-size: 0.875rem; }
.empty { color: var(--text-2); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 16px; }
.crumbs { margin-top: 24px; color: var(--text-2); font-size: 0.9rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 24px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.tile-label { color: var(--text-2); font-size: 0.875rem; }
.tile-value { font-size: 2rem; font-weight: 700; line-height: 1.2; margin: 4px 0; }
.tile-value-sm { font-size: 1.5rem; }
.tile-sub { color: var(--text-2); font-size: 0.875rem; }
.tile.feature { background: var(--brand); border-color: var(--brand); color: var(--on-brand); position: relative; overflow: hidden; }
.tile.feature .tile-label, .tile.feature .tile-sub { color: rgba(255, 255, 255, 0.86); }
.tile.feature a { color: var(--on-brand); }
.tile.feature .tile-label::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold); margin-right: 7px; vertical-align: 1px;
}

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 0.925rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
thead th { font-weight: 600; color: var(--text-2); font-size: 0.825rem; position: sticky; top: 0; background: var(--surface); }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: var(--row-hover); }
tbody th { font-weight: 500; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.strong { font-weight: 700; }
thead th button {
  all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center;
}
thead th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
thead th button::after { content: "↕"; opacity: 0.35; font-size: 0.8em; }
thead th[aria-sort="ascending"] button::after { content: "▲"; opacity: 1; }
thead th[aria-sort="descending"] button::after { content: "▼"; opacity: 1; }
.linkish { all: unset; cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.linkish:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.825rem; color: var(--text-2); }
.filters select, .filters input {
  font: inherit; font-size: 0.95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--axis); border-radius: 8px; padding: 7px 10px; min-width: 170px;
}
.filters select:focus, .filters input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.filters label.check { flex-direction: row; align-items: center; gap: 8px; align-self: flex-end; min-height: 38px; font-size: 0.95rem; color: var(--text); cursor: pointer; }
.filters label.check input { min-width: 0; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--accent); }

/* Tags and change markers (icon + label, never color alone) */
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--tag-bg); color: var(--text); }
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.chg { font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg.up { color: var(--good); }
.chg.down { color: var(--bad); }
.chg.same { color: var(--text-2); }

/* Change log */
.day { margin-top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.day h3 { color: var(--text-2); font-weight: 600; font-size: 0.9rem; }
.events { list-style: none; margin: 0; padding: 0; }
.events li { padding: 4px 0; border-top: 1px solid var(--grid); }
.events li:first-child { border-top: 0; }

/* Bank facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 24px 0 0; }
.facts div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.facts dt { color: var(--text-2); font-size: 0.825rem; }
.facts dd { margin: 2px 0 0; font-weight: 500; }

/* Chart */
.chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; padding: 0; font-size: 0.875rem; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 16px; height: 2px; border-radius: 1px; }
.plot { position: relative; outline: none; }
.plot:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 6px; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.grid { stroke: var(--grid); stroke-width: 1; }
.axis { stroke: var(--axis); stroke-width: 1; }
.tick { fill: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.dlabel { fill: var(--text-2); font-size: 11px; }
.dlabel .dv { fill: var(--text); font-weight: 600; }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.s1 { stroke: var(--s1); background: var(--s1); }
.s2 { stroke: var(--s2); background: var(--s2); }
.s3 { stroke: var(--s3); background: var(--s3); }
.s4 { stroke: var(--s4); background: var(--s4); }
.crosshair { stroke: var(--axis); stroke-width: 1; visibility: hidden; }
.dot { stroke: var(--surface); stroke-width: 2; }
.dot.s1 { fill: var(--s1); } .dot.s2 { fill: var(--s2); } .dot.s3 { fill: var(--s3); } .dot.s4 { fill: var(--s4); }
.tooltip {
  position: absolute; top: 0; pointer-events: none; z-index: 2;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); padding: 8px 10px; font-size: 0.8rem; min-width: 180px;
}
.tooltip .tt-date { color: var(--text-2); margin-bottom: 4px; }
.tooltip .tt-row { display: grid; grid-template-columns: 12px auto 1fr; gap: 6px; align-items: center; }
.tooltip .tt-row strong { font-variant-numeric: tabular-nums; }
.tooltip .tt-row span:last-child { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-view { margin-top: 8px; font-size: 0.875rem; }
.table-view summary { cursor: pointer; color: var(--accent); }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 0.875rem; }
.site-footer .wrap { padding-top: 16px; padding-bottom: 24px; }
.site-footer p { margin: 0 0 8px; max-width: 70em; }

@media (max-width: 640px) {
  th, td { padding: 6px 8px; }
  .filters label { flex: 1 1 140px; }
  .filters select, .filters input { min-width: 0; width: 100%; }
  .filters label.check { flex-basis: 100%; }
  .filters label.check input { width: 18px; }
  .tile-value { font-size: 1.6rem; }
}
@media (forced-colors: active) {
  .line { stroke: CanvasText; }
  .s2.line { stroke-dasharray: 6 3; } .s3.line { stroke-dasharray: 2 3; } .s4.line { stroke-dasharray: 10 3 2 3; }
}

/* Brand, bank/term facts, plain event lists, day pages, explainer */
.brand .tld { color: var(--text-2); font-weight: 500; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; color: var(--text); margin-bottom: 8px; }
.footer-brand svg { width: 22px; height: 22px; }
.facts dd.big { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.events.plain li { padding: 6px 0; }
.events.plain time { color: var(--text-2); font-variant-numeric: tabular-nums; }
.events.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 16px; margin-top: 16px; }
.day h3 a { color: inherit; text-decoration: none; }
.day h3 a:hover { color: var(--accent); text-decoration: underline; }
.pager { margin-top: 24px; }
.prose { max-width: 46em; margin-top: 24px; }
.prose h2 { margin-top: 32px; }
.prose p, .prose li { line-height: 1.65; }
.prose li { margin: 4px 0; }

/* Kicker above titles */
.kicker { display: block; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; font-weight: 700; color: var(--accent); margin: 0 0 6px; }

/* Rentetrap */
.trap-line { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.trap-line.best { stroke: var(--curve); stroke-width: 2.5; }
.trap-line.median { stroke: var(--curve); stroke-width: 1.25; opacity: 0.55; }
.trap-line.prev { stroke: var(--curve-prev); stroke-width: 1.5; }
.trap-band { fill: var(--curve); opacity: 0.12; }
.coin { fill: var(--gold); stroke: var(--surface); stroke-width: 2; }
.key.trap-best { background: var(--curve); height: 3px; }
.key.trap-median { background: var(--curve); opacity: 0.55; }
.key.trap-prev { background: var(--curve-prev); }
.key.trap-band-key { height: 10px; border-top: 2px solid var(--curve); background: color-mix(in srgb, var(--curve) 14%, transparent); }
.dot.trap-best, .dot.trap-median { fill: var(--curve); }
.dot.trap-prev { fill: var(--curve-prev); }

/* Barometer gauge */
.gauge { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto; overflow: visible; }
.g-track, .g-fill { fill: none; stroke-width: 18; stroke-linecap: round; }
.g-track { stroke: var(--grid); }
.g-fill.up { stroke: var(--good); }
.g-fill.down { stroke: var(--bad); }
.g-tick { stroke: var(--axis); stroke-width: 2; stroke-linecap: round; }
.g-needle { stroke: var(--text); stroke-width: 4; stroke-linecap: round; }
.g-end { fill: var(--text-2); font-size: 13px; }
.gauge .coin { stroke-width: 3; }

.baro { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 12px; margin-top: 24px; }
.baro-gauge { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 16px 16px; text-align: center; }
.baro-mood { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.15; margin: 8px 0 2px; }
.baro-counts { margin: 0; font-size: 0.925rem; }
.baro-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
.baro-tiles .tile-value .chg { font-family: var(--font); font-size: 0.95rem; vertical-align: middle; }
.tile.feature .chg { color: var(--on-brand); }

.baro-teaser {
  display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center; margin-top: 24px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand);
  border-radius: var(--radius); padding: 14px 20px; color: var(--text); text-decoration: none;
}
.baro-teaser:hover { border-color: var(--accent); border-left-color: var(--brand); }
.baro-teaser:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.baro-teaser > span { display: flex; flex-direction: column; gap: 2px; }
.baro-teaser .kicker { margin: 0; }
.baro-teaser strong { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; letter-spacing: -0.015em; }
.baro-teaser .more { color: var(--accent); font-weight: 600; margin-top: 4px; }
.baro-teaser .gauge { max-width: 150px; }
.baro-teaser .g-end { display: none; }

/* Biggest movers: diverging bars around a zero axis */
.movers { list-style: none; margin: 12px 0 0; padding: 4px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.movers li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(140px, 1fr) minmax(0, auto); gap: 8px 16px; align-items: center; padding: 9px 0; border-top: 1px solid var(--grid); }
.movers li:first-child { border-top: 0; }
.m-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-bar { position: relative; display: grid; grid-template-columns: 1fr 1fr; height: 16px; }
.m-bar::before { content: ""; position: absolute; left: 50%; top: -5px; bottom: -5px; width: 1px; background: var(--axis); }
.m-bar > span { height: 16px; }
.movers li.up .m-bar > span { grid-column: 2; justify-self: start; background: var(--good); border-radius: 0 4px 4px 0; }
.movers li.down .m-bar > span { grid-column: 1; justify-self: end; background: var(--bad); border-radius: 4px 0 0 4px; }
.m-val { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .baro { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .baro-teaser { grid-template-columns: 96px 1fr; gap: 14px; padding: 12px 14px; }
  .baro-teaser .gauge { max-width: 96px; }
  .baro-teaser .muted { display: none; }
  .movers li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .m-name { grid-column: 1 / -1; }
  .trap .tick { font-size: 21px; }
  .trap .xt.alt { display: none; }
  .trap .dlabel { font-size: 22px; }
}
@media (forced-colors: active) {
  .trap-line.prev { stroke-dasharray: 4 3; }
  .g-fill.up, .g-fill.down, .movers li .m-bar > span { forced-color-adjust: none; }
}
