:root {
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #18181b;
  --line: #27272a;
  --line-strong: #3f3f46;
  --text: #fafafa;
  --text-2: #d4d4d8;
  --muted: #a1a1aa;
  --mark-bg: #3f3f46;
  --focus: #fafafa;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.1875rem;
  --fs-xl: 1.5rem;
  --lh: 1.55;

  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;

  --radius: 6px;
  --radius-lg: 10px;
  --max: 72rem;
  --list: 44rem;
  --dur: 120ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
}

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

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-md)/var(--lh) var(--font);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--bg) url("/static/achtergrond-1920.webp") right center / cover no-repeat;
}
@media (max-width: 48rem) {
  body::before { background-image: url("/static/achtergrond-1280.webp"); background-position: 85% center; }
}
@media (min-width: 120.01rem), (min-width: 80rem) and (min-resolution: 1.5dppx) {
  body::before { background-image: url("/static/achtergrond-3840.webp"); }
}

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

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

code, kbd { font-family: var(--mono); font-size: 0.9em; }

.visually-hidden {
  position: absolute; 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: var(--s4); top: -3rem; padding: var(--s2) var(--s3); background: var(--text); color: var(--bg); z-index: 10; }
.skip:focus { top: var(--s2); }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s5);
  padding: var(--s4);
  border-bottom: 1px solid var(--line);
}

.nav { display: flex; gap: var(--s4); font-size: var(--fs-sm); }
.nav a { color: var(--text-2); text-decoration: none; padding: var(--s2) 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: underline; }

.mark { font-weight: 650; letter-spacing: -0.01em; font-size: var(--fs-lg); text-decoration: none; }

.search { display: flex; gap: var(--s2); flex: 1 1 20rem; max-width: var(--list); }

.combo { position: relative; flex: 1; }

.combo input {
  width: 100%;
  min-height: 2.75rem;
  padding: var(--s2) 2.5rem var(--s2) var(--s4);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: inherit;
  transition: border-color var(--dur);
}
.combo input::placeholder { color: var(--muted); }
.combo input:hover { border-color: var(--muted); }
.combo input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.combo input::-webkit-search-cancel-button { filter: grayscale(1) invert(1); }

.hint {
  position: absolute; right: var(--s4); top: 50%; transform: translateY(-50%);
  padding: 0 var(--s2); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--muted); font-size: var(--fs-xs); pointer-events: none;
}
.combo input:focus + .hint { display: none; }

.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + var(--s1)); z-index: 5;
  margin: 0; padding: var(--s1) 0; list-style: none;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
}
.suggest li { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s4); cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--line); }
.suggest .afk { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }

.btn {
  min-height: 2.75rem;
  padding: 0 var(--s5);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur);
}
.btn:hover { background: var(--text-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: var(--s5) var(--s4); }
main:focus { outline: none; }

body.is-home .top { flex-direction: column; justify-content: center; border-bottom: 0; padding-top: 18vh; }
body.is-home .mark { font-size: 2.5rem; }
body.is-home .search { width: 100%; flex: 0 1 auto; }
body.is-home .nav { order: 3; }

.home { max-width: var(--list); margin: 0 auto; text-align: center; color: var(--muted); }
.lead { margin: 0 0 var(--s5); }
.examples { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); margin: 0 0 var(--s6); padding: 0; list-style: none; }
.examples a { display: inline-block; padding: var(--s1) var(--s3); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text-2); font-size: var(--fs-sm); }
.examples a:hover { border-color: var(--muted); color: var(--text); }
.syntax { display: grid; gap: var(--s2); margin: 0 auto; max-width: 26rem; text-align: left; font-size: var(--fs-sm); }
.syntax div { display: grid; grid-template-columns: 9rem 1fr; gap: var(--s3); }
.syntax dt { color: var(--text-2); }
.syntax dd { margin: 0; }

.layout { display: grid; gap: var(--s6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60rem) {
  .layout { grid-template-columns: minmax(0, var(--list)) 15rem; justify-content: space-between; }
}

.summary { margin: 0 0 var(--s4); color: var(--muted); font-size: var(--fs-sm); }

.hits { margin: 0; padding: 0; list-style: none; }
.hit { margin: 0 0 var(--s6); }
.crumb { margin: 0; color: var(--muted); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.hit h3 { margin: var(--s1) 0; font-size: var(--fs-lg); font-weight: 500; line-height: 1.3; }
.hit h3 a { text-decoration: none; }
.hit h3 a:hover { text-decoration: underline; }
.snippet { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.snippet + .snippet { margin-top: var(--s1); }
.snippet mark, .doc mark { background: var(--mark-bg); color: var(--text); font-weight: 600; padding: 0 1px; border-radius: 2px; }
.meta { margin: var(--s2) 0 0; color: var(--muted); font-size: var(--fs-xs); }
.meta span + span::before { content: "·"; margin: 0 var(--s2); }
.tag { display: inline-block; padding: 0 var(--s2); border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: var(--fs-xs); color: var(--text-2); }

.card { margin: 0 0 var(--s6); padding: var(--s4) var(--s5); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); }
.card h2 { margin: 0 0 var(--s3); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.card .hit { margin-bottom: var(--s4); }
.card .hit:last-child { margin-bottom: 0; }
.fulltext { white-space: pre-line; margin: var(--s2) 0 0; color: var(--text-2); }
.reglist { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s2); }
.reglist a { font-weight: 500; }
.reglist .meta { display: inline; margin-left: var(--s2); }

.filters details { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s3) var(--s4); }
.filters summary { cursor: pointer; font-weight: 600; }
.filters fieldset { border: 0; margin: var(--s4) 0 0; padding: 0; min-width: 0; }
.filters legend { padding: 0; margin-bottom: var(--s2); color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; }
.filters label { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s1) 0; font-size: var(--fs-sm); cursor: pointer; }
.filters label .n { margin-left: auto; color: var(--muted); }
.filters input[type="checkbox"] { accent-color: var(--text); margin-top: 0.2rem; }
.filters .reset { margin-top: var(--s4); background: none; border: 0; padding: 0; color: var(--text); text-decoration: underline; font: inherit; font-size: var(--fs-sm); cursor: pointer; }

.pager { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s5) 0 0; }
.pager a, .pager span { min-width: 2.5rem; min-height: 2.5rem; display: inline-flex; align-items: center; justify-content: center; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.pager a:hover { border-color: var(--muted); }
.pager [aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.doc { max-width: var(--list); }
.doc .back { display: inline-block; margin-bottom: var(--s4); font-size: var(--fs-sm); }
.doc h1 { margin: 0 0 var(--s2); font-size: var(--fs-xl); line-height: 1.25; }
.doc .intitule { margin: 0 0 var(--s4); color: var(--muted); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s1) var(--s4); margin: 0 0 var(--s5); font-size: var(--fs-sm); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .hash { font-family: var(--mono); font-size: var(--fs-xs); }
.toc { margin: 0 0 var(--s6); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s3) var(--s4); }
.toc summary { cursor: pointer; font-weight: 600; }
.toc ol { margin: var(--s3) 0 0; padding-left: var(--s4); font-size: var(--fs-sm); max-height: 50vh; overflow: auto; }
.toc li { padding: 2px 0; }
.unit { padding: var(--s4) 0; border-top: 1px solid var(--line); scroll-margin-top: var(--s4); }
.unit h2 { margin: 0 0 var(--s2); font-size: var(--fs-md); }
.unit .crumb { margin-bottom: var(--s2); }
.unit p { margin: 0 0 var(--s2); color: var(--text-2); overflow-wrap: anywhere; }
.unit.is-vervallen { opacity: 0.6; }
.unit.is-target { border-top-color: var(--text); }
.unit .copy { background: none; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font: inherit; font-size: var(--fs-xs); padding: 0 var(--s2); cursor: pointer; margin-left: var(--s2); vertical-align: middle; }
.unit .copy:hover { color: var(--text); border-color: var(--muted); }

.state { color: var(--muted); max-width: var(--list); }
.state.is-error { color: var(--text); border-left: 2px solid var(--text); padding-left: var(--s3); }
.loading .list { opacity: 0.55; transition: opacity var(--dur); }

.foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: var(--s1) var(--s5); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-xs); line-height: 1.4; text-align: center; }
.foot p { margin: 0; }

.scope { margin: 0 0 var(--s5); padding: var(--s3) var(--s4); border-left: 2px solid var(--line-strong); color: var(--text-2); font-size: var(--fs-sm); }
.scope p { margin: 0; }
.scope p + p { margin-top: var(--s1); }
.scope a { white-space: nowrap; }

.changes { max-width: var(--list); }
.changes h1 { margin: 0 0 var(--s2); font-size: var(--fs-xl); }
.changes .intro { margin: 0 0 var(--s4); color: var(--muted); font-size: var(--fs-sm); }
.periods { display: flex; gap: var(--s2); margin: 0 0 var(--s5); }
.periods a { padding: var(--s1) var(--s3); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: var(--fs-sm); color: var(--text-2); }
.periods a:hover { border-color: var(--muted); color: var(--text); }
.periods a[aria-current="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.day { margin: 0 0 var(--s5); }
.day h2 { margin: 0 0 var(--s2); font-size: var(--fs-sm); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.day ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.day li { display: grid; grid-template-columns: 6.5rem 1fr; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.day li .tag { justify-self: start; align-self: start; }
.day li .meta { margin: var(--s1) 0 0; }
.day li.is-vervallen a { color: var(--muted); }

.prose { max-width: var(--list); }
.prose h1 { margin: 0 0 var(--s2); font-size: var(--fs-xl); }
.prose h2 { margin: var(--s6) 0 var(--s2); font-size: var(--fs-md); }
.prose .intro { margin: 0 0 var(--s4); color: var(--text); font-size: var(--fs-lg); }
.prose p, .prose li { color: var(--text-2); }
.prose ul { padding-left: var(--s5); }
.prose li + li { margin-top: var(--s1); }
.foot a { color: var(--text-2); }
.prose .meta { margin-top: 0; }
.prose .facts { margin-top: var(--s2); }
.prose h2[id] { scroll-margin-top: var(--s4); }

.notice { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border-left: 2px solid var(--text); background: var(--surface); color: var(--text-2); }
.versions { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-items: end; margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--radius-lg); font-size: var(--fs-sm); }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.inline label { color: var(--muted); }
.versions select, .versions input { min-height: 2.25rem; max-width: 100%; padding: 0 var(--s2); background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit; }
.versions input { color-scheme: dark; }
.btn-small { min-height: 2.25rem; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.btn-small:hover { border-color: var(--muted); }
.diff-text { white-space: pre-line; color: var(--text-2); overflow-wrap: anywhere; }
del + ins, ins + del { margin-left: 0.2em; }
del { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
ins { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }
del::before, ins::before, del::after, ins::after { position: absolute; clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
del::before { content: " [weggehaald: "; }
ins::before { content: " [toegevoegd: "; }
del::after, ins::after { content: "] "; }
.legend { font-size: var(--fs-sm); color: var(--muted); }
.unit.is-verwijderd h2 { color: var(--muted); }
.teller { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.teller:empty { display: none; }
@media (min-width: 60rem) {
  .foot { flex-wrap: nowrap; justify-content: space-between; text-align: left; }
  .foot-status { white-space: nowrap; }
  .foot-info { flex: 1; text-align: center; }
  .teller { text-align: right; }
}

@media (pointer: coarse) {
  .unit .copy { min-height: 2rem; min-width: 2.75rem; padding: 0 var(--s3); }
  .back { display: inline-flex; align-items: center; min-height: 2.75rem; }
  .filters label { min-height: 2.75rem; align-items: center; padding: 0; }
  .filters input[type="checkbox"] { width: 1.25rem; height: 1.25rem; margin: 0; flex: none; }
  .toc li a, .reglist a, .periods a { display: inline-block; padding-block: var(--s2); }
  .foot a { display: inline-block; padding-block: var(--s2); }
}

body:not(.is-home)::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgb(9 9 11 / 0.9) 0%, rgb(9 9 11 / 0.82) 60%, rgb(9 9 11 / 0.55) 100%);
}

.filters .more { margin-top: var(--s1); background: none; border: 0; padding: var(--s1) 0; color: var(--text-2); font: inherit; font-size: var(--fs-sm); text-decoration: underline; cursor: pointer; }
.filters .more:hover { color: var(--text); }
@media (min-width: 60rem) {
  .filters details { position: sticky; top: var(--s4); max-height: calc(100vh - 2 * var(--s4)); overflow: auto; }
}

@media (max-width: 40rem) {
  body:not(.is-home) .top { gap: var(--s2) var(--s4); }
  body:not(.is-home) .mark { order: 1; }
  body:not(.is-home) .nav { order: 2; margin-left: auto; }
  body:not(.is-home) .search { order: 3; flex-basis: 100%; }
  .versions { display: grid; gap: var(--s3); }
  .versions .inline { display: grid; grid-template-columns: 1fr auto; gap: var(--s1) var(--s2); }
  .versions .inline label { grid-column: 1 / -1; }
  .versions .inline select:only-of-type:last-child { grid-column: 1 / -1; }
  .versions select, .versions input { width: 100%; }
}

@media (pointer: coarse) {
  .hint { display: none; }
  .combo input { padding-right: var(--s4); }
}

.reglist li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s2); }
.reglist .meta { margin: 0; }

.toast {
  position: fixed;
  right: var(--s5);
  bottom: var(--s5);
  z-index: 20;
  width: min(24rem, calc(100vw - 2 * var(--s4)));
  padding: var(--s4) var(--s5);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.55);
  font-size: var(--fs-sm);
  animation: toast-in 220ms ease-out;
}
.toast[hidden] { display: none; }
.toast h2 { margin: 0 var(--s6) var(--s2) 0; font-size: var(--fs-md); }
.toast p { margin: 0 0 var(--s2); color: var(--text-2); }
.toast .toast-how { color: var(--text); }
.toast kbd { display: inline-block; padding: 0 var(--s1); border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); font-size: var(--fs-xs); }
.toast-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s3); }
.toast-close { position: absolute; top: var(--s2); right: var(--s2); width: 2.25rem; height: 2.25rem; border: 0; border-radius: var(--radius); background: none; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.toast-close:hover { color: var(--text); background: var(--line); }
.btn-small.is-primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.btn-small.is-primary:hover { background: var(--text-2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 40rem) {
  .toast { right: var(--s4); left: var(--s4); bottom: var(--s4); width: auto; }
  .toast-actions .btn-small { flex: 1; min-height: 2.75rem; }
}
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

.nav { gap: var(--s4); }
.crumbs { margin: 0 0 var(--s3); color: var(--muted); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.crumbs a { color: var(--text-2); }
.unit h2 a.perma, .unit h2 > a { text-decoration: none; }
.unit h2 a.perma:hover, .unit h2 > a:hover { text-decoration: underline; }
.unit.is-single { border-top: 0; padding-top: 0; }
.unit.is-single p { color: var(--text); font-size: var(--fs-lg); line-height: 1.6; }
.art-nav { display: flex; justify-content: space-between; gap: var(--s4); margin: var(--s6) 0 0; padding-top: var(--s4); border-top: 1px solid var(--line); }
.art-nav a { text-decoration: none; padding: var(--s2) 0; }
.art-nav a:hover { text-decoration: underline; }
.letters { display: flex; flex-wrap: wrap; gap: var(--s1); margin: 0 0 var(--s5); }
.letters a { min-width: 2.25rem; min-height: 2.25rem; display: inline-flex; align-items: center; justify-content: center; padding: 0 var(--s2); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text-2); }
.letters a:hover { border-color: var(--muted); color: var(--text); }
.letters a[aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.reglist.az { gap: var(--s1); }
.reglist.az li { padding: var(--s1) 0; border-bottom: 1px solid var(--line); }
.regelingen { max-width: var(--list); }
@media (max-width: 40rem) {
  .nav { gap: var(--s3); font-size: var(--fs-xs); }
}

@media (pointer: coarse) {
  .unit h2 a.perma, .unit h2 > a { display: inline-block; padding-block: var(--s2); }
  .crumbs a { display: inline-block; padding-block: var(--s2); }
}

.prose .reglist { padding-left: 0; }
