/* Fonts: self-hosted via @fontsource packages (served from /vendor/fonts).
   Atkinson Hyperlegible: designed for maximum legibility. Fraunces: warm, friendly headings. Comic Neue: charts only. */
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 400; font-style: normal; font-display: swap; src: url('/vendor/fonts/atkinson/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 400; font-style: italic; font-display: swap; src: url('/vendor/fonts/atkinson/atkinson-hyperlegible-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 700; font-style: normal; font-display: swap; src: url('/vendor/fonts/atkinson/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 600; font-style: normal; font-display: swap; src: url('/vendor/fonts/fraunces/fraunces-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 700; font-style: normal; font-display: swap; src: url('/vendor/fonts/fraunces/fraunces-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Comic Neue'; font-weight: 400; font-style: normal; font-display: swap; src: url('/vendor/fonts/comic-neue/comic-neue-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Comic Neue'; font-weight: 700; font-style: normal; font-display: swap; src: url('/vendor/fonts/comic-neue/comic-neue-latin-700-normal.woff2') format('woff2'); }

/* Colours (from the current site): navy #19192d + dusty rose. Text/background pairs meet WCAG AA (4.5:1) */
:root {
  --paper: #fdfcfc;
  --paper-2: #f5efef;
  --card: #ffffff;
  --ink: #19192d;
  --ink-soft: #4a4a63;
  --line: #e4d9d9;
  --primary: #19192d;        /* buttons, bands */
  --primary-hover: #2e2e57;
  --primary-ink: #ffffff;
  --accent: #8a4f4f;         /* links and accents: darker rose, 6.4:1 on white */
  --accent-hover: #6b3838;
  --pink: #be9696;
  --go: #1f7a45;             /* subscribe buttons */
  --go-hover: #17613a;
  --go-ink: #ffffff;           /* decorative rose from the current logo/graphs */
  --band: #19192d;
  --band-ink: #ffffff;
  --chart-bg: #ffffff;
  --sans: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --hand: 'Comic Neue', 'Comic Sans MS', cursive;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12121f; --paper-2: #1c1c30; --card: #181829; --ink: #f4eeee; --ink-soft: #c3bcc9;
    --line: #34344f; --primary: #be9696; --primary-hover: #d4b2b2; --primary-ink: #19192d;
    --accent: #dfb8b8; --accent-hover: #f0d3d3; --go: #5fc88a; --go-hover: #7fd8a2; --go-ink: #0b1d12; --band: #0b0b16; --band-ink: #f4eeee; --chart-bg: #ffffff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1.125rem; line-height: 1.7; }
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.35rem; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.wrap.narrow { width: min(720px, 100% - 32px); }
.sr-only, .hp { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--paper); color: var(--ink); padding: 10px 14px; z-index: 99; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.meta { font-size: .95rem; color: var(--ink-soft); margin: 0 0 .5rem; }
.meta a { color: inherit; }
.eyebrow { display: inline-block; font-size: .95rem; font-weight: 700; color: var(--accent); background: var(--paper-2); padding: 2px 12px; border-radius: 999px; margin: 0 0 1rem; }
.fine { font-size: .9rem; color: var(--ink-soft); }
.lead { font-size: 1.3rem; color: var(--ink-soft); max-width: 40em; }

/* subscribe band (top of every page) */
.subscribe-band { background: var(--band); color: var(--band-ink); }
.subscribe-band .subscribe-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 10px 0; }
.subscribe-band label { flex: 1 1 280px; }
.subscribe-band input { flex: 0 1 280px; }
.subscribe-band button { background: var(--pink); color: #19192d; }
.subscribe-band button:hover { background: #d4b2b2; color: #19192d; }

/* forms and buttons */
input[type="email"] { font: inherit; font-size: 1rem; min-height: 48px; padding: 10px 14px; border: 2px solid var(--ink-soft); border-radius: 10px; background: var(--card); color: var(--ink); min-width: 0; }
button, .button { font: inherit; font-size: 1rem; font-weight: 700; min-height: 48px; padding: 10px 24px; border: 0; border-radius: 10px; background: var(--primary); color: var(--primary-ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
button:hover, .button:hover { background: var(--primary-hover); color: var(--primary-ink); }
.subscribe-box { margin: 3rem 0; padding: 1.75rem; background: var(--paper-2); border: 2px solid var(--line); border-radius: var(--radius); }
.subscribe-box h2 { font-size: 1.6rem; margin-bottom: .25rem; }
.subscribe-box .subscribe-form { display: flex; flex-wrap: wrap; gap: 10px; margin: 1rem 0 .5rem; }
.subscribe-box input { flex: 1 1 240px; }
.subscribe-box.footer { margin-top: 2rem; }

/* header and nav */
.site-header { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 10; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--accent); }
.brand-mark { height: 44px; width: auto; flex: none; border-radius: 6px; }
.nav { display: flex; align-items: center; gap: 4px; font-size: 1.05rem; }
.nav a, .nav-parent { color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 10px; background: none; font-weight: 700; }
.nav a:hover, .nav-parent:hover { color: var(--accent); background: var(--paper-2); }
.nav a[aria-current="page"] { background: var(--paper-2); color: var(--accent); box-shadow: inset 0 -3px 0 var(--pink); border-radius: 10px 10px 0 0; }
.nav-group { position: relative; }
.nav-parent::after { content: ' ▾'; font-size: .8em; margin-left: 4px; }
.dropdown { display: none; position: absolute; left: 0; top: 100%; min-width: 250px; margin: 0; padding: 8px; list-style: none; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(25, 25, 45, .16); }
.nav-group:hover .dropdown, .nav-group:focus-within .dropdown, .nav-group.open .dropdown { display: block; }
.dropdown a { display: flex; font-weight: 400; }
.dropdown a[aria-current="page"] { box-shadow: none; border-radius: 10px; font-weight: 700; }
.nav-toggle { display: none; background: var(--paper-2); color: var(--ink); border: 2px solid var(--line); }
.nav-toggle:hover { background: var(--line); color: var(--ink); }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; flex-direction: column; align-items: stretch; width: 100%; padding-bottom: 12px; }
  .nav.open { display: flex; }
  .dropdown { position: static; display: block; box-shadow: none; border: 0; border-left: 3px solid var(--line); border-radius: 0; margin-left: 14px; padding: 0 0 0 6px; background: none; }
  .nav-parent { cursor: default; }
  .nav-parent::after { content: ''; }
  .nav a[aria-current="page"] { border-radius: 10px; box-shadow: none; }
}

/* hero, cards */
.hero { background: linear-gradient(180deg, var(--paper-2), var(--paper)); padding: clamp(40px, 8vw, 88px) 0 32px; }
.hero h1 { max-width: 14em; }
.featured { padding: 2.5rem 0 3rem; border-bottom: 1px solid var(--line); }
.featured h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); } .featured h2 a { color: var(--ink); text-decoration: none; }
.featured h2 a:hover { color: var(--accent); text-decoration: underline; }
.section-title { margin: 3rem 0 1.25rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; margin-bottom: 2rem; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; transition: transform .15s, border-color .15s, box-shadow .15s; }
.card:hover, .card:focus-within { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 22px rgba(25, 25, 45, .12); }
.card h3 a { color: var(--ink); text-decoration: none; } .card h3 a:hover { color: var(--accent); text-decoration: underline; }
.card p { font-size: 1.05rem; margin: 0 0 .6rem; }
.page-head, .post-head { padding: clamp(32px, 6vw, 64px) 0 1rem; }

/* prose */
.prose { font-size: 1.2rem; line-height: 1.75; }
.prose h2 { margin-top: 2.2em; } .prose h3 { margin-top: 1.8em; }
.prose blockquote { margin: 1.5em 0; padding: .4em 1.4em; border-left: 5px solid var(--accent); background: var(--paper-2); border-radius: 0 var(--radius) var(--radius) 0; }
.prose code { background: var(--paper-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 1.05rem; } .prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.contact-list { list-style: none; padding: 0; } .contact-list li { padding: 12px 0; border-bottom: 1px solid var(--line); } .contact-list strong { display: inline-block; min-width: 110px; }

/* charts: only these are xkcd-styled */
figure.chart { position: relative; overflow: hidden; margin: 2.2rem -1rem; padding: 1rem 1rem .75rem; background: var(--chart-bg); color: #111; border: 2px solid #19192d; border-radius: 6px 10px 5px 9px; box-shadow: 4px 4px 0 rgba(190, 150, 150, .6); }
.chart-canvas { position: relative; overflow: hidden; }
.chart-canvas svg { display: block; width: 100%; height: auto; max-width: 100%; }
figure.chart figcaption { font-family: var(--hand); font-size: 1.05rem; color: #333; text-align: center; margin-top: .5rem; }
.chart-error { color: #b00020; }
figure.chart .chart-legend { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .15rem .9rem; font-family: var(--hand); font-size: .95rem; }
figure.chart .chart-legend li { display: flex; align-items: center; gap: .35rem; }
figure.chart .chart-legend i { width: .8rem; height: .8rem; border: 1.5px solid #19192d; border-radius: 2px; flex: none; }
/* charts next to each other: widths follow the weights in the chart block, so the content boxes are used for sizing */
.chart-row { display: flex; align-items: flex-end; gap: .8rem; margin: 2.2rem -1rem; }
.chart-row figure.chart { margin: 0; min-width: 0; box-sizing: content-box; padding-inline: .5rem; }
@media (max-width: 760px) {
  figure.chart { margin-inline: 0; }
  .chart-row { margin-inline: 0; flex-direction: column; align-items: stretch; }
  .chart-row figure.chart { flex: none !important; }
}
/* xkcd text: white outline behind letters, like matplotlib's xkcd mode */
figure.chart svg text { paint-order: stroke; stroke: var(--chart-bg); stroke-width: 4px; stroke-linejoin: round; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 120px; padding: 6px 10px; background: #fffdf5; border: 2px solid #111; border-radius: 4px; font-family: var(--hand); font-size: 16px; line-height: 1.35; color: #111; box-shadow: 3px 3px 0 rgba(190, 150, 150, .6); }
.chart-tip[hidden] { display: none; }
.chart-tip i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 1.5px solid #111; }

/* footer */
.site-footer { margin-top: 4rem; padding: 2rem 0 3rem; background: var(--paper-2); border-top: 1px solid var(--line); font-size: 1.05rem; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; margin: 2rem 0 1rem; }
.foot-cols strong { font-family: var(--display); font-size: 1.1rem; }
.foot-cols ul { list-style: none; padding: 0; margin: .5rem 0 0; } .foot-cols li { margin: .35rem 0; } .foot-cols p { margin: .5rem 0 0; color: var(--ink-soft); }

/* imported images */
.prose img { display: block; max-width: 100%; height: auto; margin: 1.5rem auto; border-radius: 8px; }
.card-img { display: block; margin: -1.4rem -1.5rem 1rem; }
.card-img img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0; }
.featured .featured-img { display: block; margin-top: 1.5rem; }
.featured .featured-img img { display: block; width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); }
.prose table { display: block; overflow-x: auto; }

/* every subscribe (Aanmelden) button is the same green */
.subscribe-form button { background: var(--go); color: var(--go-ink); }
.subscribe-form button:hover { background: var(--go-hover); color: var(--go-ink); }
.prose img.portrait { width: 220px; height: 220px; object-fit: cover; border-radius: 50%; margin: .25rem auto 1rem; }
@media (min-width: 640px) { .prose img.portrait { float: left; margin: .25rem 1.75rem 1rem 0; } }

/* highlighted articles slider */
.slider { position: relative; margin: 1.5rem 0 1rem; border-radius: var(--radius); overflow: hidden; background: var(--band); color: #fff; }
.slider-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slider-track::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; height: clamp(360px, 46vw, 520px); display: flex; align-items: flex-end; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(25, 25, 45, .96) 0%, rgba(25, 25, 45, .72) 42%, rgba(25, 25, 45, .1) 78%); }
.slide-text { position: relative; z-index: 1; padding: clamp(20px, 4vw, 48px); padding-bottom: 72px; max-width: 52rem; }
.slide-meta { margin: 0 0 .6rem; font-size: .95rem; color: #fff; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.pill { background: var(--pink); color: #19192d; font-weight: 700; padding: 2px 12px; border-radius: 999px; }
.slide h2 { color: #fff; font-size: clamp(1.6rem, 3.6vw, 2.6rem); margin: 0 0 .5rem; }
.slide h2 a { color: #fff; text-decoration: none; }
.slide h2 a::after { content: ''; position: absolute; inset: 0; z-index: 2; } /* the whole slide is clickable */
.slide h2 a:hover, .slide h2 a:focus-visible { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 3px; }
.slide h2 a:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.slide-summary { margin: 0; font-size: 1.1rem; color: #f1ecec; max-width: 44rem; }
.slide.no-image { background: linear-gradient(135deg, #19192d, #454580); }
@media (max-width: 640px) { .slide-summary { display: none; } .slide { height: 380px; } }
.slider-controls { position: absolute; inset: 0 0 56px; display: flex; justify-content: space-between; align-items: center; padding: 0 12px; pointer-events: none; }
.slider-btn { pointer-events: auto; position: relative; z-index: 3; width: 48px; height: 48px; min-height: 48px; padding: 0; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #19192d; }
.slider-btn:hover { background: #fff; color: #19192d; }
.slider-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.slider-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px clamp(20px, 4vw, 48px) 14px; }
.slider-dots { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.slider-dots button { width: 44px; height: 44px; min-height: 44px; padding: 0; background: none; position: relative; border-radius: 50%; }
.slider-dots button::before { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid #fff; background: transparent; }
.slider-dots button[aria-current="true"]::before { background: var(--pink); border-color: var(--pink); }
.slider-dots button:hover { background: rgba(255, 255, 255, .15); }
.slider :focus-visible { outline-color: #fff; }
.slide-text { padding-inline: clamp(64px, 8vw, 96px); }
.slider-bar { padding-inline: clamp(64px, 8vw, 96px); }
@media (max-width: 640px) { .slide-text, .slider-bar { padding-inline: 20px; } .slider-controls { align-items: flex-start; padding-top: 12px; } }
@media (max-width: 640px) { .slider-dots button { width: 34px; } .slider-bar { gap: 6px; } }

.slider-track.animating { scroll-snap-type: none; }

/* statistics page */
.stats-range { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1rem; }
.stats-range a { padding: 6px 14px; border: 2px solid var(--primary); border-radius: 999px; text-decoration: none; color: var(--ink); }
.stats-range a[aria-current] { background: var(--primary); color: var(--primary-ink); }
.stats-custom { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 1rem; }

/* answer shown in place of the sign-up form fields */
.subscribe-msg { flex: 1 1 100%; margin: 0; font-weight: 600; }
.subscribe-msg.error { color: #a1281e; }
.subscribe-band .subscribe-msg.error { color: #ffd0cb; }
.subscribe-form [hidden] { display: none !important; }
