/* brain-dev — minimalistische stijl. Geen build-stap, geen externe fonts of libraries. */

/* Geen webfonts: systeemfonts. Inter en JetBrains Mono zijn eruit gehaald omdat
   twee woff2-bestanden 88 kB van de 107 kB van een koude paginalading waren.
   De systeemstack levert op elke platform een schreefloze en een monospace
   variant, zonder download en zonder flikkering. */

:root {
  color-scheme: light dark;

  --bg: #fafafa;
  --surface: #ffffff;
  --text: #111111;
  --muted: #666666;
  --faint: #6f6f6f;   /* was #8a8a8a: dat haalde de 4,5:1 niet voor kleine tekst */
  --line: #e4e4e4;

  /* Eén functionele accentkleur, voor links, het actieve filter en focus.
     Wisselen is één regel; de rest van de interface is monochroom.
       Hacker News-oranje  #ff6600
       terminalblauw       #3b5bdb  (of klassiek #0000ee) */
  --accent: #a3c9a8;          /* pastelgroen uit het logo, alleen nog voor randen */
  --accent-strong: #3f7a4e;   /* leesbare tekstvariant op licht */

  /* Sub-tag (het project waar een stuk bij hoort) in oranje: de tweede
     functionele kleur, zodat hij niet met het type of met een tag te verwarren
     is. Contrast op deze achtergrond 4,9:1 — gelijk aan --accent-strong. */
  --subtag: #b3521c;

  --code-bg: #f3f3f3;
  --tok-kw: #2f6b41;
  --tok-str: #8a5a2b;
  --tok-num: #8a5a2b;
  --tok-com: #8a8a8a;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #171717;
    --text: #e9e9e9;
    --muted: #9b9b9b;
    --faint: #7d7d7d;
    --line: #2a2a2a;

    --accent: #a3c9a8;
    --accent-strong: #a3c9a8;

    --subtag: #e8894a;

    --code-bg: #1b1b1b;
    --tok-kw: #a3c9a8;
    --tok-str: #cbb59a;
    --tok-num: #cbb59a;
    --tok-com: #7d7d7d;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

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

/* --- Header ---------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  min-height: 56px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.wordmark .mark {
  display: block;
  width: 26px;
  height: 24px;
}

.wordmark:hover { text-decoration: none; }

.wordmark .ai {
  color: var(--accent-strong);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-left: auto;
}

.site-nav a {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
  margin-left: 14px;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: underline;
  background: none;
}

.site-nav a.is-active {
  color: var(--accent-strong);
  background: none;
}

/* --- Overzicht: zoekbalk en filters --------------------------------- */

main { padding: 26px 0 56px; }

.tagline {
  margin: 0 0 8px;
  max-width: 68ch;    /* maatregel: 760px op 14px geeft ruim 100 tekens per regel */
  color: var(--muted);
  font-size: 14px;
}

.tagline-stats {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

/* volgen-opties onder de intro: de enige plek waar de site om een terugkeer vraagt */
.tagline-links {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.tagline-links a { color: var(--muted); }

.search { position: relative; margin-bottom: 10px; }

.search input {
  width: 100%;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 7px 46px 7px 10px;
}

/* met een zoekopdracht staan er twee elementen rechts: <kbd>Esc</kbd> + wis-knop */
.search.has-query input { padding-right: 84px; }

.search input::placeholder { color: var(--faint); }

.search input:focus {
  outline: none;
  border-color: var(--accent-strong);
}

.search input::-webkit-search-cancel-button { display: none; }

.search .hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  pointer-events: none;
}

.search.has-query .hint { right: 40px; }

.search .clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 4px;
  padding: 3px 7px;
  cursor: pointer;
}

.search .clear:hover { color: var(--text); background: var(--line); }
.search .clear[hidden] { display: none; }

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

/* Filters en tags als platte tekstlinks met een dun scheidingslijntje ertussen,
   niet als pillen: de lijst is het product, niet de bediening. */
.pill {
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 0;
  padding: 3px 0;
  cursor: pointer;
}

.toolbar .pill + .pill {
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

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

.pill.is-active {
  color: var(--accent-strong);
  font-weight: 600;
}

.count {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

/* .toolbar zet display:flex, dus [hidden] moet hier expliciet terug naar none */
.toolbar[hidden] { display: none; }

.tagbar {
  margin-top: -2px;
  margin-bottom: 12px;
  gap: 6px;
}

.tagbar .pill {
  font-size: 12.5px;
  padding: 2px 0;
}

.toolbar-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  margin-right: 2px;
}

/* --- Resultatenlijst ------------------------------------------------- */

.results {
  list-style: none;
  counter-reset: rank;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

/* Rangnummer in de kantlijn, zoals in een HN-lijst: ordenend, geen beoordeling.
   De items zijn een <ol>, dus de nummering loopt mee met filteren. */
.item {
  position: relative;
  counter-increment: rank;
  padding: 12px 0 12px 30px;
  border-bottom: 1px solid var(--line);
}

.item::before {
  content: counter(rank);
  position: absolute;
  left: 0;
  top: 14px;
  width: 20px;
  text-align: right;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

/* Subtitel onder de titel: het type en (indien gezet) het sub-tag-label. */
.item-subtitle {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 4px 0 0;
}

/* Type als klein woord, niet als badge met een achtergrond.
   De sub-tag deelt die vorm en verschilt alleen in kleur. */
.badge,
.subtag {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  white-space: nowrap;
}

/* Kennis, whitepaper en software zijn naslag of het artefact zelf: hetzelfde
   accent, één functionele kleur. Alleen een blog krijgt de neutrale grijstint. */
.badge-knowledge,
.badge-whitepaper,
.badge-software { color: var(--accent-strong); }

.badge-blog { color: var(--faint); }

/* Project of status waar een stuk onder valt (indexveld `subtag`). De haken
   horen bij de vorm, niet bij de waarde: ze komen hier vandaan, zodat het
   overzicht en de artikelpagina hetzelfde label tonen. */
.subtag { color: var(--subtag); }
.subtag::before { content: '['; }
.subtag::after { content: ']'; }

/* In het overzicht is het type een knop (klik zet dat typefilter): alleen de
   knopranden en de cursor hoeven daar nog van af. */
.item-subtitle .badge {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.item-subtitle .badge:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.item-title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.item-summary {
  margin: 3px 0 0;
  max-width: 72ch;
  color: var(--muted);
  font-size: 13.5px;
}

.item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 5px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

.item-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font: inherit;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.tag:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.item-meta time { white-space: nowrap; }

/* Zonder pillen moeten tags zichzelf begrenzen, anders leest de meta als één
   woord: hetzelfde '·'-scheidingsteken dat de rest van de meta gebruikt. */
.item-tags .tag + .tag::before,
.empty-tags .tag + .tag::before {
  content: '·';
  margin-right: 6px;
  color: var(--faint);
}

/* optionele broncode-link uit het indexveld `repo` */
.item-repo {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent-strong);
  white-space: nowrap;
}

.item-repo:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.empty {
  padding: 32px 0;
  color: var(--muted);
  font-size: 15px;
}

.empty[hidden] { display: none; }

.empty-text { margin: 0; }

.empty-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.empty-tags[hidden] { display: none; }

.empty-label {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

.empty .reset {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 2px 4px;
  text-decoration: underline;
  cursor: pointer;
}

.empty .reset:hover { color: var(--text); }

/* --- Artikelpagina --------------------------------------------------- */

.article { max-width: 760px; }

.backlink {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}

.backlink:hover { color: var(--text); }

.article h1 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 30px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}

.article h2 {
  margin: 40px 0 10px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.article p { margin: 0 0 16px; }

.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; }

.article li { margin-bottom: 6px; }

.article blockquote {
  margin: 20px 0;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--line);
  color: var(--muted);
}

kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
}

.article-meta .tag { cursor: default; }
.article-meta .tag:hover { color: var(--muted); border-color: var(--line); }

/* Het type in de meta linkt naar die sectie in het overzicht. */
.article-meta a.badge { cursor: pointer; }
.article-meta a.badge:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Code ------------------------------------------------------------ */

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--code-bg);
  border-radius: 4px;
  padding: 1px 5px;
}

pre {
  margin: 0 0 20px;
  padding: 14px 16px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  font-size: 13.5px;
  line-height: 1.55;
}

.tok-kw { color: var(--tok-kw); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-com { color: var(--tok-com); font-style: italic; }

/* --- Footer ---------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 0 44px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--muted); }

@media (max-width: 560px) {
  /* hint overlapt de placeholder op smalle schermen; ruimte vrijmaken voor de wis-knop */
  .search .hint { display: none; }
  .search input { padding-right: 44px; }
  .search.has-query input { padding-right: 44px; }

  /* ruimere touch-targets, nu zonder pill-vulling */
  .site-nav { gap: 0; }
  .site-nav a { padding: 8px 0; margin-left: 16px; }
  .toolbar { gap: 8px; }
  .pill { padding: 7px 0; }
  .tagbar .pill { padding: 6px 0; }
  .item { padding-left: 26px; }
}

/* Het merkteken is zwart lijnwerk; in dark mode draaien we het om. */
@media (prefers-color-scheme: dark) {
  .wordmark .mark { filter: invert(1); }
}

/* --- Artikel: links, verwijzingen en uitklapbare blokken -------------- */

/* Een link in de lopende tekst hoort zichtbaar te zijn, niet pas bij hover:
   een kennisartikel staat of valt bij de verwijzingen ernaar. */
.article p a,
.article li a,
.article dd a,
.article dt a,
.article blockquote a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.article p a:hover,
.article li a:hover,
.article dd a:hover,
.article dt a:hover,
.article blockquote a:hover {
  text-decoration-color: var(--text);
}

/* Afkortingen: laat zien dat er een uitleg achter zit (title blijft de tooltip). */
abbr[title] {
  text-decoration: underline dotted var(--faint);
  text-underline-offset: 2px;
  cursor: help;
}

/* De inhoudsopgave als blok, niet als gewone lijst. */
.article-toc {
  margin: 0 0 30px;
  padding: 14px 18px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.article-toc h2 {
  margin: 0 0 8px;
  font-size: 13px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.article-toc ol { margin-bottom: 8px; }
.article-toc a { color: var(--text); text-decoration: none; }
.article-toc a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Begrippenlijst: term met de uitleg eronder, zonder in te springen. */
.article dl { margin: 0 0 16px; }

.article dt {
  font-weight: 600;
  margin-top: 12px;
}

.article dd {
  margin: 2px 0 0;
  padding-left: 0;
  color: var(--muted);
}

/* Uitklapbare blokken: optionele inhoud achter een klik, de hoofdstroom blijft kort. */
.article details {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.article details > summary {
  cursor: pointer;
  color: var(--muted);
}

.article details > summary:hover { color: var(--text); }

.article details[open] > summary {
  margin-bottom: 10px;
  color: var(--text);
}

.article details p:last-child { margin-bottom: 0; }

/* De tags in de meta zijn klikbaar: ze zoeken op die tag in het overzicht.
   Specifieker dan de bestaande `.article-meta .tag`, dus dit wint. */
.article-meta a.tag { cursor: pointer; }

.article-meta a.tag:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* De terugweg naar de inhoudsopgave onderaan het artikel. */
.article > p > a.backlink { margin: 24px 0 0; }

@media (max-width: 560px) {
  .article-toc { padding: 12px 14px 4px; }
  .article details { padding: 8px 11px; }
}

/* --- Artikel: tabellen ------------------------------------------------ */

/* Cijfertabel zonder rasterlijnen: alleen een kopregel en een dunne
   scheiding per rij, zodat de getallen leesbaar blijven naast de lopende
   tekst. De rechterkolom is rechts uitgelijnd op de cijfers. */
.article table {
  width: 100%;
  margin: 0 0 20px;
  border-collapse: collapse;
  font-size: 14px;
}

.article th {
  padding: 0 10px 6px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.article td {
  padding: 5px 10px 5px 0;
  border-bottom: 1px solid var(--line);
}

.article th.num,
.article td.num {
  padding-right: 0;
  text-align: right;
}

/* --- Artikel: bronnen in APA ------------------------------------------ */

/* APA vraagt een alfabetische lijst met hangende inspringing: geen
   opsommingstekens, en de tweede regel van een item springt in. */
.article ul.references {
  list-style: none;
  padding-left: 0;
}

.article ul.references li {
  padding-left: 22px;
  text-indent: -22px;
  margin-bottom: 10px;
}
