/* Hoofdstijl: Niels' main style for new projects. design.nielskorte.nl/hoofdstijl
   Taken from the task board (tasks.nielskorte.nl): same token names and values, made general.
   Graphite accent, neutral surfaces, colour only for meaning. Light and dark are equals.
   Use: <link rel="stylesheet" href="https://design.nielskorte.nl/hoofdstijl/hoofdstijl.css">
   or copy this file into the project. Add class="reading" on <body> for a website (16 px body text). */

/* ── tokens: light */
:root {
  color-scheme: light;
  --bg: #f6f6f8; --panel: #fafafb; --surface: #ffffff; --raised: #ffffff;
  --text: #1c1c24; --muted: #6b6b7c; --faint: #9c9cac;
  --line: #e8e8ee; --line-strong: #d9d9e3; --hover: #efeff3; --press: #e7e7ed;
  --accent: #24242e; --accent-ink: #ffffff; --accent-soft: #ececf1; --accent-line: #cdcdd8;
  --danger: #c93a3a; --danger-soft: #fdecec; --ok: #23875a; --ok-soft: #e6f5ee; --info: #3d63dd; --info-soft: #eaf0ff;
  --shadow: 0 1px 2px rgba(20, 20, 40, .05); --shadow-lg: 0 12px 40px rgba(20, 20, 40, .16), 0 2px 8px rgba(20, 20, 40, .06);

  /* categorical colours (the task board's board colours): dots, tags, chart series. Never behind text. */
  --c1: #6b5bd6; --c2: #2f6fde; --c3: #1a9c8f; --c4: #2f9e6b; --c5: #c9a227; --c6: #d2544a; --c7: #c7559b; --c8: #7a7a8c;

  /* type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --fs-xs: 11px; --fs-sm: 12.5px; --fs: 13.5px; --fs-md: 16px; --fs-lg: 19px; --fs-xl: 24px; --fs-2xl: 32px; --fs-3xl: 44px;

  /* space, radius */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px;
  --r-sm: 6px; --r: 8px; --r-lg: 10px; --r-xl: 12px; --r-pill: 999px;

  /* motion */
  --ease: cubic-bezier(.2, .8, .2, 1); --dur-fast: .12s; --dur: .16s; --dur-slow: .22s;
}
/* ── tokens: dark (system setting, unless the page forces light) */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #111116; --panel: #14141a; --surface: #1a1a22; --raised: #20202a;
  --text: #ececf2; --muted: #9b9bae; --faint: #6a6a7e;
  --line: #26262f; --line-strong: #33333f; --hover: #20202a; --press: #282833;
  --accent: #ececf2; --accent-ink: #15151b; --accent-soft: #2a2a35; --accent-line: #4a4a5c;
  --danger: #ff7b72; --danger-soft: #3a1b1b; --ok: #5fcf96; --ok-soft: #14301f; --info: #8aa5ff; --info-soft: #1a2244;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .3);
} }
/* ── tokens: dark (forced with data-theme="dark" on <html>) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111116; --panel: #14141a; --surface: #1a1a22; --raised: #20202a;
  --text: #ececf2; --muted: #9b9bae; --faint: #6a6a7e;
  --line: #26262f; --line-strong: #33333f; --hover: #20202a; --press: #282833;
  --accent: #ececf2; --accent-ink: #15151b; --accent-soft: #2a2a35; --accent-line: #4a4a5c;
  --danger: #ff7b72; --danger-soft: #3a1b1b; --ok: #5fcf96; --ok-soft: #14301f; --info: #8aa5ff; --info-soft: #1a2244;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .3);
}

/* ── base */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs)/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body.reading { font-size: var(--fs-md); line-height: 1.6; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--accent-line); }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.015em; font-weight: 650; }
h1 { font-size: var(--fs-2xl); letter-spacing: -.025em; }
h2 { font-size: var(--fs-xl); letter-spacing: -.02em; }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs); font-weight: 600; }
body.reading h1 { font-size: var(--fs-3xl); }
body.reading h2 { font-size: var(--fs-2xl); }
body.reading h3 { font-size: var(--fs-xl); }
body.reading h4 { font-size: var(--fs-lg); }
p { margin: 0 0 .8em; }
.eyebrow { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.muted { color: var(--muted); } .faint { color: var(--faint); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.mono, code, kbd { font-family: var(--mono); font-size: .88em; letter-spacing: -.01em; }
code { background: var(--hover); padding: 1px 4px; border-radius: 4px; }
kbd { font-size: 10.5px; color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
svg.ic { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-6) 0; }
[hidden] { display: none !important; }

/* ── buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 550; white-space: nowrap; box-shadow: var(--shadow); text-decoration: none; transition: background var(--dur-fast), border-color var(--dur-fast); }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: none; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.small { height: 26px; padding: 0 8px; font-size: var(--fs-sm); }
.btn.large { height: 40px; padding: 0 16px; font-size: 15px; border-radius: var(--r); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 28px; height: 28px; border-radius: var(--r-sm); display: inline-grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.segs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 2px; background: var(--surface); }
.segs button { padding: 3px 12px; border-radius: var(--r-sm); font-weight: 550; color: var(--muted); font-size: var(--fs-sm); height: 24px; }
.segs button:hover { color: var(--text); }
.segs button.on, .segs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ── form controls */
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
label.f > :is(input, select, textarea) { display: block; margin-top: 4px; font-weight: 400; color: var(--text); }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
input.text, select.text { width: 100%; height: 30px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); padding: 0 9px; outline: 0; }
select.text { appearance: none; -webkit-appearance: none; padding-right: 24px; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 13px) 13px, calc(100% - 9px) 13px; background-size: 4px 4px; background-repeat: no-repeat; }
textarea.area { width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); padding: 8px 10px; outline: 0; resize: vertical; min-height: 64px; display: block; line-height: 1.45; }
:is(input.text, select.text, textarea.area):focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
:is(input.text, textarea.area)::placeholder { color: var(--faint); }
input.text[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.switch { position: relative; display: inline-block; width: 34px; height: 20px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 10px; background: var(--line-strong); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── labels */
.pill { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 10.5px; font-weight: 650; padding: 1px 7px; border-radius: 9px; letter-spacing: .01em; background: var(--accent-soft); color: var(--accent); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill .pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: hs-pulse 1.4s ease-in-out infinite; }
@keyframes hs-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); font-size: var(--fs-sm); color: var(--muted); }
.tag i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.led { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.led.ok { background: var(--ok); } .led.danger { background: var(--danger); } .led.info { background: var(--info); }

/* ── containers */
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.card { padding: 10px 12px; border-radius: var(--r); }
a.card { display: block; color: inherit; text-decoration: none; transition: border-color var(--dur-fast); }
a.card:hover { border-color: var(--line-strong); }
.panel { padding: 14px 16px; }
.inset { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 12px 14px 11px; }
.tile .tl { color: var(--muted); font-size: var(--fs-sm); }
.tile .tv { font-size: 30px; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile .ts { color: var(--faint); font-size: 11.5px; margin-top: 1px; }
.callout { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.callout.info { background: var(--info-soft); border-color: transparent; }
.callout.info > svg { color: var(--info); }
.callout.ok { background: var(--ok-soft); border-color: transparent; }
.callout.ok > svg { color: var(--ok); }
.callout.danger { background: var(--danger-soft); border-color: transparent; }
.callout.danger > svg { color: var(--danger); }
.callout > svg { margin-top: 2px; }
.dialog { width: min(480px, 100%); background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 18px; }
.dialog h2 { margin: 0 0 4px; font-size: 16px; }
.dialog .lead { color: var(--muted); margin: 0 0 14px; font-size: 13px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--r); box-shadow: var(--shadow-lg); font-weight: 550; display: inline-flex; gap: 8px; align-items: center; animation: hs-pop var(--dur) var(--ease); }
@keyframes hs-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ── navigation */
.nav-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border-radius: var(--r-sm); color: var(--muted); text-align: left; min-height: 28px; text-decoration: none; }
.nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-item.on, .nav-item[aria-current="page"] { background: var(--press); color: var(--text); font-weight: 550; }
.nav-item .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.nav-head { padding: 14px 8px 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }

/* ── table */
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs); }
.tbl th { text-align: left; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 6px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── motion off when asked */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
