/* uchar — site stylesheet
   Tone: editorial document (statute / specification) set in a modern grid.
   Paper background, ink-blue type, one amber accent at the hourglass waist,
   navy code blocks. Self-hosted fonts (assets/fonts.css). */

@import url("fonts.css");

:root {
  --paper: #f6f3ec;
  --paper-2: #ece8de;
  --paper-3: #e0dbcd;
  --ink: #12202f;
  --ink-2: #3f4b58;
  --ink-3: #6b7683;
  --line: rgba(18, 32, 47, 0.16);
  --line-strong: rgba(18, 32, 47, 0.42);
  --blue: #17418e;
  --blue-2: #1c55b8;
  --blue-soft: #dde6f5;
  --blue-ink: #0d2757;
  --amber: #d39a1d;
  --amber-deep: #a9770c;
  --amber-soft: #f6e6bd;
  --green: #1e7a4c;
  --green-soft: #d8eee0;
  --red: #b3302a;
  --red-soft: #f3d9d6;
  --code-bg: #0f1a2b;
  --code-bg-2: #172641;
  --code-fg: #e9e4d8;
  --code-kw: #f2c462;
  --code-str: #a6d8ad;
  --code-num: #f3a98e;
  --code-cm: #7d92ad;
  --code-key: #8fc1ff;
  --font-display: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Schibsted Grotesk", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --measure: 66ch;
  --radius: 4px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --sec-col: 7.5rem;
}

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 106.25%;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  hyphens: manual;
  -webkit-hyphens: manual;
}
p, li, dd, figcaption { text-wrap: pretty; }

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.07 0 0 0 0 0.12 0 0 0 0 0.18 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

body > * { position: relative; z-index: 1; }

/* language switching: only the active language is rendered */
html[lang="nl"] [data-lang="en"] { display: none !important; }
html[lang="en"] [data-lang="nl"] { display: none !important; }

::selection { background: var(--amber-soft); color: var(--ink); }

a { color: var(--blue-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
a:hover { color: var(--blue-ink); text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--amber-deep); outline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.005em;
  margin: 0 0 0.5em;
  color: var(--ink);
  hyphens: manual;
  -webkit-hyphens: manual;
}
h1 { font-size: clamp(2.5rem, 5.6vw, 4.4rem); text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin-top: 0; text-wrap: balance; }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); margin-top: 2.2rem; }
h4 { font-family: var(--font-body); font-weight: 700; font-size: 1rem; margin-top: 1.8rem; letter-spacing: 0.01em; }
h2 + p, h3 + p { margin-top: 0; }

p, ul, ol, dl, table, figure, blockquote { margin: 0 0 1.1rem; }
p, li, dd { max-width: var(--measure); }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 0.35rem; }
li > ul, li > ol { margin-top: 0.35rem; }
strong { font-weight: 700; }
em { font-style: italic; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
small, .small { font-size: 0.86rem; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.86em;
}
:not(pre) > code {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.05em 0.35em;
  color: var(--blue-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  hyphens: none;
}
kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 3px; padding: 0 0.35em; background: #fff; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 1rem;
}
.eyebrow .dot { color: var(--amber-deep); }

.lede {
  font-size: clamp(1.12rem, 1.6vw, 1.32rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 58ch;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 1180px);
  margin-inline: auto;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 3.75rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.brand svg { width: 22px; height: 26px; display: block; }
.brand .brand-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-left: 0.6rem;
  padding-left: 0.7rem;
  border-left: 1px solid var(--line-strong);
  transform: translateY(1px);
}
.site-nav { display: flex; gap: 0.15rem; flex-wrap: wrap; }
.site-nav a {
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--ink-2);
  padding: 0.4rem 0.55rem;
  white-space: nowrap;
  border-radius: var(--radius);
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { background: var(--paper-2); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--blue-ink); border-bottom-color: var(--amber); }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}
.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font: inherit;
}
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.lang-switch button:not([aria-pressed="true"]):hover { background: var(--paper-2); }

/* The GitHub mark closes the header row. The negative margin halves the
   header gap, so mark and language switch read as one group. */
.gh-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-left: -0.75rem;
  border-radius: 999px;
  color: var(--ink-2);
}
.gh-link svg { width: 1.35rem; height: 1.35rem; display: block; fill: currentColor; }
.gh-link:hover { color: var(--ink); background: var(--paper-2); }

.nav-toggle { display: none; }

@media (max-width: 1240px) { .brand .brand-sub { display: none; } }
@media (max-width: 860px) {
  .site-header .wrap { flex-wrap: wrap; row-gap: 0; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: .4rem;
    appearance: none; border: 1px solid var(--line-strong); background: transparent;
    border-radius: var(--radius); padding: .35rem .6rem; font: inherit; font-size: .85rem; cursor: pointer; color: var(--ink);
  }
  .site-nav { display: none; flex-basis: 100%; flex-direction: column; padding: 0.4rem 0 0.8rem; border-top: 1px solid var(--line); }
  .site-nav.is-open { display: flex; }
}
/* With the GitHub mark the header row needs smaller gaps to stay one row on
   a 360px phone; below that the mark wraps and goes to the right end. */
@media (max-width: 400px) {
  .site-header .wrap { column-gap: 0.85rem; }
  .gh-link { margin-left: -0.5rem; }
}
@media (max-width: 359px) { .gh-link { margin-left: auto; } }

/* ---------- hero ---------- */
.hero {
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(2.5rem, 5vw, 4.5rem);
  border-bottom: 1px solid var(--line);
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero h1 { margin-bottom: 1.2rem; }
.hero h1 em { font-style: italic; color: var(--blue-ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-figure { order: -1; max-width: 330px; margin: 0 auto; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid var(--blue);
  color: var(--blue-ink);
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--blue-soft); text-decoration: none; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-ink); color: #fff; }
.btn--quiet { border-color: var(--line-strong); color: var(--ink); }

/* ---------- hourglass diagram ---------- */
.hourglass { width: 100%; height: auto; display: block; overflow: visible; }
.hourglass text { font-family: var(--font-mono); font-size: 12px; fill: var(--ink); letter-spacing: 0.02em; }
.hourglass .hg-node-text--long { font-size: 10.5px; }
.hourglass .hg-lbl { font-size: 10.5px; fill: var(--ink-3); letter-spacing: 0.12em; text-transform: uppercase; }
.hourglass .hg-waist-text { font-family: var(--font-display); font-size: 26px; font-style: italic; fill: var(--paper); letter-spacing: 0; }
.hourglass .hg-waist-sub { font-size: 9px; fill: var(--amber-soft); letter-spacing: 0.14em; text-transform: uppercase; }
.hourglass .hg-node { fill: #fff; stroke: var(--line-strong); stroke-width: 1; }
.hourglass .hg-node--engine { fill: var(--paper-2); }
.hourglass .hg-waist { fill: var(--blue-ink); stroke: var(--amber); stroke-width: 1.5; }
.hourglass .hg-path { fill: none; stroke: var(--blue); stroke-width: 1.5; stroke-linecap: round; }
.hourglass .hg-path--out { stroke: var(--amber-deep); }
.hourglass .hg-sand { fill: var(--amber); }

@media (prefers-reduced-motion: no-preference) {
  .hourglass .hg-path { stroke-dasharray: 400; stroke-dashoffset: 400; animation: hg-draw 1.1s cubic-bezier(.6,.05,.3,1) forwards; }
  .hourglass .hg-path:nth-of-type(1) { animation-delay: .25s; }
  .hourglass .hg-path:nth-of-type(2) { animation-delay: .35s; }
  .hourglass .hg-path:nth-of-type(3) { animation-delay: .45s; }
  .hourglass .hg-path--out:nth-of-type(4) { animation-delay: 1.0s; }
  .hourglass .hg-path--out:nth-of-type(5) { animation-delay: 1.1s; }
  .hourglass .hg-path--out:nth-of-type(6) { animation-delay: 1.2s; }
  .hourglass .hg-in { opacity: 0; animation: hg-fade .6s ease forwards; }
  .hourglass .hg-in:nth-child(1) { animation-delay: .05s; }
  .hourglass .hg-in:nth-child(2) { animation-delay: .15s; }
  .hourglass .hg-in:nth-child(3) { animation-delay: .25s; }
  .hourglass .hg-waist-g { opacity: 0; animation: hg-fade .6s ease .8s forwards; }
  .hourglass .hg-out { opacity: 0; animation: hg-fade .6s ease forwards; }
  .hourglass .hg-out:nth-child(1) { animation-delay: 1.5s; }
  .hourglass .hg-out:nth-child(2) { animation-delay: 1.6s; }
  .hourglass .hg-out:nth-child(3) { animation-delay: 1.7s; }
  .hourglass .hg-sand { animation: hg-sand 2.4s ease-in-out 1.2s infinite; }
  .reveal { opacity: 0; transform: translateY(14px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
  .reveal:nth-child(2) { animation-delay: .08s; }
  .reveal:nth-child(3) { animation-delay: .16s; }
  .reveal:nth-child(4) { animation-delay: .24s; }
  .reveal:nth-child(5) { animation-delay: .32s; }
}
@keyframes hg-draw { to { stroke-dashoffset: 0; } }
@keyframes hg-fade { to { opacity: 1; } }
@keyframes hg-sand { 0%, 100% { transform: translateY(0); opacity: .9; } 50% { transform: translateY(6px); opacity: .5; } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- statement band ---------- */
.band {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper-2) 60%, transparent), transparent);
}
.band .wrap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
}
.band-item { padding: 1.6rem 1.6rem 1.6rem 0; border-right: 1px solid var(--line); }
.band-item + .band-item { padding-left: 1.6rem; }
.band-item:last-child { border-right: 0; }
.band-item .eyebrow { margin-bottom: 0.4rem; }
.band-item p { margin: 0; font-size: 0.98rem; color: var(--ink-2); max-width: none; }
.band-item strong { font-family: var(--font-display); font-weight: 500; font-size: 1.45rem; color: var(--ink); display: block; line-height: 1.15; margin-bottom: 0.3rem; }
@media (max-width: 760px) {
  .band .wrap { grid-template-columns: 1fr; }
  .band-item { border-right: 0; border-bottom: 1px solid var(--line); padding: 1.2rem 0; }
  .band-item + .band-item { padding-left: 0; }
  .band-item:last-child { border-bottom: 0; }
}

/* ---------- sections (statute-style numbering in the margin) ---------- */
.sec {
  padding: clamp(2.6rem, 5vw, 4.5rem) 0;
  border-bottom: 1px solid var(--line);
}
.sec:last-of-type { border-bottom: 0; }
.sec .wrap {
  display: grid;
  grid-template-columns: var(--sec-col) minmax(0, 1fr);
  gap: 0 clamp(1rem, 3vw, 2.5rem);
  align-items: start;
}
.sec-mark { position: sticky; top: 5rem; }
.sec-num {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--amber-deep);
  line-height: 1;
  display: block;
}
.sec-title-small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 0.5rem;
  line-height: 1.4;
}
.sec-body > :first-child { margin-top: 0; }
.sec-body { min-width: 0; }
.sec--tight { padding-top: 1.8rem; padding-bottom: 1.8rem; }
@media (max-width: 760px) {
  .sec .wrap { grid-template-columns: minmax(0, 1fr); }
  .sec-mark { position: static; display: flex; align-items: baseline; gap: 0.8rem; margin-bottom: 1rem; }
  .sec-title-small { margin-top: 0; }
}

/* two-column prose + aside */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 3rem; align-items: start; }
.split--wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 900px) { .split, .split--wide { grid-template-columns: 1fr; } }

/* ---------- callouts ---------- */
.callout {
  border-left: 3px solid var(--amber);
  background: color-mix(in srgb, var(--amber-soft) 40%, transparent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout > :last-child { margin-bottom: 0; }
.callout--note { border-left-color: var(--blue); background: color-mix(in srgb, var(--blue-soft) 55%, transparent); }
.callout--warn { border-left-color: var(--red); background: color-mix(in srgb, var(--red-soft) 55%, transparent); }
.callout--ok { border-left-color: var(--green); background: color-mix(in srgb, var(--green-soft) 60%, transparent); }
.callout-title { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.4rem; display: block; }

/* statute article */
.artikel {
  font-family: var(--font-display);
  font-size: 1.14rem;
  line-height: 1.5;
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue-ink);
  background: #fff;
  padding: 1.3rem 1.5rem 1.2rem;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(18,32,47,.05), 0 12px 30px -24px rgba(18,32,47,.35);
}
.artikel-kop {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-ink);
  margin-bottom: 0.6rem;
  display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap;
}
.artikel-kop .bron { color: var(--ink-3); letter-spacing: 0.06em; text-transform: none; }
.artikel p { margin-bottom: 0.6rem; max-width: 70ch; }
.artikel p:last-child { margin-bottom: 0; }
.artikel ol { padding-left: 1.6rem; margin: 0.3rem 0; }
.artikel ol li { margin-bottom: 0.25rem; }

blockquote.quote {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  line-height: 1.35;
  color: var(--blue-ink);
  border: 0;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--amber);
  margin: 2rem 0;
  max-width: 34ch;
  text-wrap: balance;
}
blockquote.quote cite { display: block; font-family: var(--font-mono); font-style: normal; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-top: 0.8rem; }

/* ---------- code ---------- */
.code {
  margin: 1.4rem 0 1.8rem;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-fg);
  box-shadow: 0 20px 40px -28px rgba(13, 39, 87, 0.6);
  overflow: hidden;
  font-size: 0.86rem;
}
.code figcaption {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.9rem;
  background: var(--code-bg-2);
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--code-cm);
}
.code figcaption .code-lang { color: var(--code-kw); }
.code figcaption .code-src { margin-left: auto; text-transform: none; letter-spacing: 0.02em; color: var(--code-cm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A source label that links to its file keeps the label's colour (link blue is
   unreadable on the dark caption); the underline marks the link. */
.code figcaption .code-src a, .eyebrow a, blockquote.quote cite a { color: inherit; }
.code pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.55;
  tab-size: 4;
  hyphens: none;
}
.code pre code { font-size: inherit; display: block; min-width: max-content; }
.code--wrap pre code { white-space: pre-wrap; min-width: 0; overflow-wrap: anywhere; }
.code .copy {
  appearance: none; border: 1px solid rgba(255,255,255,.18); background: transparent; color: var(--code-fg);
  font: inherit; letter-spacing: .08em; padding: .15rem .5rem; border-radius: 3px; cursor: pointer; margin-left: auto;
}
.code figcaption .code-src + .copy { margin-left: .5rem; }
.code .copy:hover { background: rgba(255,255,255,.08); }
.code .copy.is-done { border-color: var(--code-str); color: var(--code-str); }

.tok-kw { color: var(--code-kw); }
.tok-str { color: var(--code-str); }
.tok-num { color: var(--code-num); }
.tok-cm { color: var(--code-cm); font-style: italic; }
.tok-key { color: var(--code-key); }
.tok-op { color: #d8c8ff; }
.tok-ok { color: var(--code-str); font-weight: 700; }
.tok-fail { color: var(--code-num); font-weight: 700; }
.tok-hl { background: rgba(242,196,98,.16); display: inline-block; width: 100%; }

/* prose-sized light code (case data etc.) */
.code--light { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.code--light figcaption { background: var(--paper-2); color: var(--ink-3); border-bottom-color: var(--line); }
.code--light figcaption .code-lang { color: var(--blue-ink); }
.code--light .tok-kw { color: var(--blue-ink); font-weight: 700; }
.code--light .tok-str { color: var(--green); }
.code--light .tok-num { color: var(--red); }
.code--light .tok-cm { color: var(--ink-3); }
.code--light .tok-key { color: var(--blue-2); }
.code--light .tok-op { color: var(--amber-deep); }

/* ---------- tabs ---------- */
.tabs { margin: 1.4rem 0 1.8rem; }
.tabs [role="tablist"] {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line-strong);
}
.tabs [role="tab"] {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
}
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--blue-ink); border-bottom-color: var(--amber); }
.tabs [role="tabpanel"] { margin-top: 0; }
.tabs [role="tabpanel"][hidden] { display: none; }
.tabs [role="tabpanel"] .code { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.tabs .tab-note { font-size: 0.9rem; color: var(--ink-2); margin: 0.6rem 0 0; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1.2rem; margin: 1.5rem 0; }
.card {
  position: relative;
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem 1.3rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  box-shadow: 0 1px 0 rgba(18,32,47,.04);
}
a.card:hover { transform: translateY(-2px); border-color: var(--blue); box-shadow: 0 14px 30px -20px rgba(13,39,87,.45); text-decoration: none; }
.card .eyebrow { margin-bottom: 0.6rem; }
.card h3 { margin: 0 0 0.5rem; font-size: 1.45rem; }
.card p { margin: 0; color: var(--ink-2); font-size: 0.96rem; }
.card .card-cta { display: inline-block; margin-top: 0.9rem; font-weight: 600; color: var(--blue-2); font-size: 0.92rem; }
.card--accent { border-top: 3px solid var(--amber); }
.card--blue { border-top: 3px solid var(--blue); }
.card--green { border-top: 3px solid var(--green); }
.card--ink { border-top: 3px solid var(--ink); }

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.8rem 0.6rem 0; border-bottom: 1px solid var(--line); }
th { font-family: var(--font-mono); font-weight: 400; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); border-bottom-color: var(--line-strong); }
td:first-child, th:first-child { padding-left: 0; }
tr:last-child td { border-bottom-color: var(--line-strong); }
table code { white-space: nowrap; }
.table-wrap { overflow-x: auto; margin: 0 0 1.4rem; }
.table-wrap table { margin: 0; min-width: 560px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- definition lists ---------- */
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.4rem 1.4rem; }
dl.kv dt { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-3); padding-top: 0.15rem; }
dl.kv dd { margin: 0; }
@media (max-width: 600px) { dl.kv { grid-template-columns: 1fr; gap: 0.1rem 0; } dl.kv dd { margin-bottom: 0.7rem; } }

/* ---------- steps ---------- */
ol.steps { list-style: none; padding: 0; counter-reset: step; margin: 1.5rem 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 3.2rem; margin-bottom: 1.3rem; max-width: none; }
ol.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: -0.1rem;
  font-family: var(--font-display); font-size: 1.6rem; color: var(--amber-deep); line-height: 1;
}
ol.steps > li > strong { display: block; margin-bottom: 0.2rem; }
ol.steps .code { margin-top: 0.7rem; margin-bottom: 0.4rem; }

/* ---------- tags / status ---------- */
.tag {
  display: inline-block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.15rem 0.5rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); vertical-align: middle; white-space: nowrap;
}
.tag--ok { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.tag--fail { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.tag--amber { border-color: var(--amber-deep); color: var(--amber-deep); background: var(--amber-soft); }
.tag--blue { border-color: var(--blue); color: var(--blue-ink); background: var(--blue-soft); }

/* ---------- figures / diagrams ---------- */
figure.diagram { margin: 1.6rem 0 2rem; }
figure.diagram svg { width: 100%; max-width: 680px; height: auto; display: block; margin: 0 auto; }
figure.diagram figcaption { font-size: 0.88rem; color: var(--ink-2); margin: 0.8rem auto 0; max-width: 60ch; text-align: center; }
.square text { font-family: var(--font-mono); font-size: 12px; fill: var(--ink); }
.square .eq { font-family: var(--font-display); font-size: 22px; fill: var(--amber-deep); }
.square .box { fill: #fff; stroke: var(--line-strong); }
.square .box--anchor { fill: var(--amber-soft); stroke: var(--amber-deep); }
.square line { stroke: var(--blue); stroke-width: 1.5; }

/* ---------- term with explanation (hover/focus popover, link as fallback) ---------- */
.term {
  position: relative;
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-color: var(--amber-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.term:hover { color: var(--blue-ink); text-decoration-thickness: 1px; }
.term-tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.5rem);
  width: max-content;
  max-width: min(24rem, 80vw);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  box-shadow: 0 12px 30px -14px rgba(13, 39, 87, 0.6);
  white-space: normal;
  text-align: left;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
}
.term:hover .term-tip, .term:focus-visible .term-tip { opacity: 1; transform: none; }
@media (hover: none) { .term-tip { display: none; } }

/* ---------- misc ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem 2.5rem; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); font-size: 0.84em; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mb-0 { margin-bottom: 0; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding-left: 1.6rem; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.checklist li.no::before { content: "–"; color: var(--ink-3); }

.toc { font-size: 0.92rem; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; border-bottom: 1px solid var(--line); }
.toc a { display: flex; gap: 0.8rem; text-decoration: none; color: var(--ink-2); padding: 0.5rem 0; }
.toc a:hover { color: var(--blue-ink); }
.toc .n { font-family: var(--font-display); color: var(--amber-deep); min-width: 2rem; }

.page-intro { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(1.5rem, 3vw, 2.5rem); border-bottom: 1px solid var(--line); }
.page-intro .wrap { display: grid; grid-template-columns: var(--sec-col) minmax(0, 1fr); gap: 0 clamp(1rem, 3vw, 2.5rem); }
.page-intro .page-mark { font-family: var(--font-display); font-size: 1.9rem; color: var(--amber-deep); line-height: 1; }
@media (max-width: 760px) { .page-intro .wrap { grid-template-columns: minmax(0, 1fr); } }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-strong);
  margin-top: 3rem;
  padding: 2.5rem 0 3rem;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.site-footer .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem 3rem; }
.site-footer h4 { margin: 0 0 0.6rem; font-family: var(--font-mono); font-weight: 400; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.site-footer p { margin: 0 0 0.5rem; max-width: none; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.3rem; }
.site-footer a { color: var(--ink); }

@media print {
  .site-header, .site-footer, .lang-switch, .copy { display: none !important; }
  body::before { display: none; }
  .code { box-shadow: none; }
}

/* ---------- timeline ---------- */
ol.timeline { list-style: none; padding: 0; margin: 1.5rem 0; border-left: 1px solid var(--line-strong); }
ol.timeline > li { position: relative; padding: 0 0 1.1rem 1.6rem; max-width: none; }
ol.timeline > li::before { content: ""; position: absolute; left: -5px; top: 0.45rem; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 2px solid var(--amber-deep); }
ol.timeline > li.now::before { background: var(--amber); }
ol.timeline time { display: block; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 0.1rem; }
ol.timeline p { margin: 0; max-width: 62ch; }

/* ---------- differential square ---------- */
.dsq text { font-family: var(--font-mono); font-size: 12px; fill: var(--ink); }
.dsq .dsq-sub { font-size: 9.5px; fill: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; }
.dsq .dsq-box { fill: #fff; stroke: var(--line-strong); }
.dsq .dsq-box--anchor { fill: var(--amber-soft); stroke: var(--amber-deep); }
.dsq .dsq-box--ir { fill: var(--blue-ink); stroke: var(--amber); }
.dsq .dsq-box--ir + text { fill: var(--paper); font-family: var(--font-display); font-style: italic; font-size: 16px; }
.dsq .dsq-edge { stroke: var(--blue); stroke-width: 1.4; fill: none; }
.dsq .dsq-edge--anchor { stroke: var(--amber-deep); stroke-dasharray: 4 3; }
.dsq .dsq-eq { font-family: var(--font-display); font-size: 20px; fill: var(--amber-deep); }

/* numbered facts row */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 1rem 1.5rem; margin: 1.5rem 0; }
.fact { border-top: 1px solid var(--line-strong); padding-top: 0.6rem; }
.fact .fact-n { font-family: var(--font-display); font-size: 2.1rem; line-height: 1; color: var(--ink); display: block; font-variant-numeric: tabular-nums; }
.fact .fact-l { font-size: 0.86rem; color: var(--ink-2); display: block; margin-top: 0.3rem; }

/* ---------- flow diagrams (DevOps page) ---------- */
.flow text { font-family: var(--font-mono); font-size: 12px; fill: var(--ink); }
.flow .fl-sub { font-size: 9.5px; fill: var(--ink-3); }
.flow .fl-box { fill: #fff; stroke: var(--line-strong); stroke-width: 1; }
.flow .fl-box--ok { fill: var(--amber-soft); stroke: var(--amber-deep); }
.flow .fl-box--fail { fill: var(--red-soft); stroke: var(--red); }
.flow .fl-box--zone { fill: none; stroke: var(--line-strong); stroke-dasharray: 4 3; }
.flow .fl-zone-lbl { font-size: 9.5px; fill: var(--ink-3); letter-spacing: 0.12em; text-transform: uppercase; }
.flow .fl-n { font-family: var(--font-display); font-size: 16px; fill: var(--amber-deep); }
.flow .fl-arrow { fill: none; stroke: var(--blue); stroke-width: 1.4; }
.flow .fl-arrow--fail { stroke: var(--red); stroke-dasharray: 4 3; }
.flow .fl-arrow--ok { stroke: var(--amber-deep); }
.flow .fl-head { fill: var(--blue); }
.flow .fl-head--fail { fill: var(--red); }
.flow .fl-head--ok { fill: var(--amber-deep); }
figure.diagram--wide svg { max-width: 800px; }
/* A diagram too detailed to shrink to phone width scrolls inside its .table-wrap instead. */
.table-wrap svg.flow--scroll { min-width: 680px; }
/* The routes diagram (ontwikkelaar.html#drools-routes) is 984 units wide: at 800px its 9.5px labels shrink below 8px,
   so it takes the width of the text column and scrolls where that is under 940px. */
figure.diagram--full svg { max-width: none; }
.table-wrap svg.flow--scroll-wide { min-width: 940px; }
/* A path uchar does not take (Drools' own codegen): grey and dotted, apart from the paths it does take. */
.flow .fl-arrow--off { stroke: var(--ink-3); stroke-dasharray: 2 3; }
.flow .fl-head--off { fill: var(--ink-3); }
