/* Kippie het Paard - shared design system: tokens, base, header, buttons, cards. */
/* Self-hosted variable fonts (see assets/fonts/LEES-MIJ.txt). */
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-opsz.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* Kept for later: only loaded when a page asks for this font. */
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  /* Colour triples feed rgba(var(--x), alpha) everywhere, so one switch re-tints the site. */
  --ink: 20, 19, 18;
  --ink-deep: 11, 10, 10;
  --panel-rgb: 33, 31, 29;
  --raised-rgb: 44, 41, 38;
  --panel-2-rgb: 54, 50, 46;
  --line-rgb: 255, 238, 220;
  --accent-rgb: 230, 181, 102;
  --terracotta-rgb: 217, 119, 74;
  --photo-blur: 8px;

  --bg: #141312;
  --surface: rgba(var(--panel-rgb), 0.82);
  --surface-solid: #211f1d;
  --surface-2: rgba(var(--panel-2-rgb), 0.7);
  --raised: #2c2926;
  --line: rgba(var(--line-rgb), 0.12);
  --line-strong: rgba(var(--line-rgb), 0.24);
  --text: #f4f0e9;
  --muted: #c8c0b4;
  --faint: #a29a8e;
  --accent: #e6b566;
  --accent-ink: #2a1a08;
  --terracotta: #d9774a;
  --ok: #9fcf8a;
  --warn: #ecb85b;
  --bad: #ec7f6f;
  --info: #8ec5d6;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(var(--ink-deep), 0.38);
  --gutter: clamp(16px, 4vw, 32px);
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: var(--font-body);
}

/* Look choices (assets/theme.js sets these attributes on <html>). ---------- */
html[data-bg="warm"] {
  --ink: 23, 17, 13; --ink-deep: 11, 7, 4; --panel-rgb: 38, 29, 22; --raised-rgb: 47, 36, 27; --panel-2-rgb: 58, 44, 33;
  --line-rgb: 255, 226, 188; --bg: #17110d; --surface-solid: #261d16; --raised: #2f241b;
}
html[data-bg="midnight"] {
  --ink: 14, 18, 26; --ink-deep: 6, 9, 14; --panel-rgb: 22, 28, 40; --panel-2-rgb: 40, 50, 68; --raised-rgb: 31, 39, 54;
  --line-rgb: 214, 228, 255; --bg: #0e121a; --surface-solid: #161c28; --raised: #1f2736;
}
html[data-bg="forest"] {
  --ink: 14, 22, 18; --ink-deep: 6, 12, 9; --panel-rgb: 22, 34, 28; --panel-2-rgb: 40, 58, 48; --raised-rgb: 30, 46, 38;
  --line-rgb: 218, 244, 228; --bg: #0e1612; --surface-solid: #162219; --raised: #1e2e26;
}
html[data-accent="terracotta"] { --accent: #e0845a; --accent-rgb: 224, 132, 90; --accent-ink: #2a1208; }
html[data-accent="sage"] { --accent: #a9d18e; --accent-rgb: 169, 209, 142; --accent-ink: #14240a; }
html[data-accent="sky"] { --accent: #8ec5e6; --accent-rgb: 142, 197, 230; --accent-ink: #0b1e2b; }
html[data-accent="rose"] { --accent: #eb8fa8; --accent-rgb: 235, 143, 168; --accent-ink: #2c0d17; }
html[data-head="newsreader"] { --font-display: "Newsreader", "Iowan Old Style", Georgia, serif; }
html[data-head="sans"] { --font-display: var(--font-body); }
html[data-body="system"] { --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
html[data-num="serif"] { --font-num: var(--font-display); }
html[data-photo="sharp"] { --photo-blur: 0px; }
html[data-photo="soft"] { --photo-blur: 4px; }

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Blurred Kippie photo (or video once it plays) under a warm overlay. */
body::before {
  content: "";
  position: fixed;
  inset: -18px;
  z-index: -3;
  pointer-events: none;
  background: #151413 url("/images/kippie-background-still.jpg") center / cover no-repeat;
  filter: blur(var(--photo-blur)) saturate(0.9) brightness(0.68);
  transform: scale(1.03);
}

.background-video {
  position: fixed;
  inset: -18px;
  z-index: -2;
  width: calc(100% + 36px);
  height: calc(100% + 36px);
  pointer-events: none;
  object-fit: cover;
  object-position: 50% center;
  filter: blur(var(--photo-blur)) saturate(0.9) brightness(0.68);
  transform: scale(1.03);
  opacity: 0;
  transition: opacity 900ms ease;
}

.background-video.is-ready { opacity: 1; }

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(var(--accent-rgb), 0.10), transparent 45%),
    radial-gradient(ellipse at 90% 30%, rgba(var(--terracotta-rgb), 0.05), transparent 45%),
    linear-gradient(to bottom, rgba(var(--ink), 0.4), rgba(var(--ink), 0.78));
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; margin: 0; }
[hidden] { display: none !important; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Header and navigation ------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: calc(10px + var(--safe-top)) calc(var(--gutter) + var(--safe-right)) 10px calc(var(--gutter) + var(--safe-left));
  background: linear-gradient(to bottom, rgba(var(--ink), 0.94), rgba(var(--ink), 0.72));
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  border-radius: 12px;
}

.brand img { width: 38px; height: 38px; border-radius: 11px; }

.brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 650;
  line-height: 1.05;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.site-nav a:hover { color: var(--text); background: var(--surface-2); }

.site-nav a[aria-current="page"] {
  color: var(--accent-ink);
  background: var(--accent);
}

.site-nav svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-nav svg { display: none; }

.site-nav .nav-mono {
  display: none;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border: 1.6px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 1000px) and (min-width: 761px) {
  .site-nav a { padding: 0 11px; font-size: 0.9rem; }
}

/* Status colours -------------------------------------------------------- */
[data-state="ok"] { --tone: var(--ok); }
[data-state="warn"] { --tone: var(--warn); }
[data-state="bad"] { --tone: var(--bad); }
[data-state="info"] { --tone: var(--info); }
[data-state="idle"], [data-state="loading"] { --tone: var(--faint); }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--tone, var(--faint));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone, var(--faint)) 22%, transparent);
}

.dot[data-state="ok"] { animation: dot-breathe 3.2s ease-in-out infinite; }

@keyframes dot-breathe {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 22%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--tone) 8%, transparent); }
}

/* Buttons, chips, cards ------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn:hover { border-color: var(--accent); background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn-primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 84%, #fff); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--tone, var(--faint)) 38%, transparent);
  border-radius: 999px;
  color: var(--tone, var(--muted));
  background: color-mix(in srgb, var(--tone, var(--faint)) 12%, transparent);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(var(--line-rgb), 0.06);
}

.eyebrow {
  margin: 0;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--line-rgb), 0.1);
}

.meter > i {
  display: block;
  width: var(--v, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--tone, var(--accent));
  transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1), background 240ms ease;
}

/* Small screens: the menu becomes a tab bar -------------------------------- */
@media (max-width: 760px) {
  body { padding-bottom: calc(92px + var(--safe-bottom)); }
  /* A backdrop-filter would make the header the containing block of the fixed tab bar. */
  .site-header {
    gap: 12px;
    background: rgba(var(--ink), 0.94);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .site-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + var(--safe-bottom));
    z-index: 60;
    margin: 0;
    padding: 6px;
    gap: 2px;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: rgba(var(--panel-rgb), 0.94);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  }
  .site-nav a {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 54px;
    padding: 6px 4px;
    border-radius: 18px;
    font-size: 0.72rem;
  }
  .site-nav svg { display: block; }
  .site-nav .nav-mono { display: grid; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 6px 0; font-size: 0.64rem; min-width: 0; }
}

/* "Minder beweging" from the system. */
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="on"]) { scroll-behavior: auto; }
  html:not([data-motion="on"]) *, html:not([data-motion="on"]) *::before, html:not([data-motion="on"]) *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html:not([data-motion="on"]) .background-video { display: none; }
}

/* Page heading shared by every page -------------------------------------- */
.page-head { margin-bottom: 28px; }
.page-head h1 { margin-top: 8px; font-size: clamp(2.2rem, 5vw, 3.5rem); }
.page-lede { max-width: 60ch; margin: 12px 0 0; color: var(--muted); font-size: 1.05rem; }

/* Sliding marker behind the active menu tab (assets/theme.js adds .nav-pill). ----------- */
@media (min-width: 761px) { .site-nav { position: relative; } }
.nav-pill {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  height: var(--pill-h, 100%);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 6px 22px rgba(var(--accent-rgb), 0.28);
  pointer-events: none;
  opacity: 0;
  transition: transform 520ms cubic-bezier(0.34, 1.4, 0.4, 1), width 520ms cubic-bezier(0.34, 1.4, 0.4, 1), opacity 200ms ease;
}
.nav-pill.is-ready { opacity: 1; }
.site-nav.has-pill a { position: relative; z-index: 1; }
.site-nav.has-pill a[aria-current="page"] { background: transparent; color: var(--accent-ink); }

html[data-nav="underline"] .nav-pill { height: 3px; margin-top: calc(var(--pill-h, 40px) - 5px); background: var(--accent); box-shadow: none; border-radius: 3px; }
html[data-nav="underline"] .site-nav.has-pill a[aria-current="page"], html[data-nav="underline"] .site-nav a[aria-current="page"] { background: transparent; color: var(--accent); }
html[data-nav="glass"] .nav-pill { background: rgba(var(--accent-rgb), 0.16); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.5); }
html[data-nav="glass"] .site-nav.has-pill a[aria-current="page"], html[data-nav="glass"] .site-nav a[aria-current="page"] { background: transparent; color: var(--accent); }

@media (max-width: 760px) {
  .nav-pill { border-radius: 18px; }
}

/* Cards: a soft glow follows the pointer; home cards also tilt a little. ------------------ */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(var(--accent-rgb), 0.13), transparent 62%);
  opacity: 0;
  transition: opacity 300ms ease;
}
@media (hover: hover) { .card:hover::before { opacity: 1; } }
.card > * { position: relative; z-index: 1; }

/* Soft accent fill behind the line icons */
svg .soft { fill: rgba(var(--accent-rgb), 0.16); }

/* Phones: a slimmer menu bar, so more of the photo shows */
@media (max-width: 760px) {
  .site-nav { left: 16px; right: 16px; bottom: calc(8px + var(--safe-bottom)); padding: 4px; border-radius: 20px; }
  .site-nav a { min-height: 44px; padding: 4px 0; gap: 2px; font-size: 0.6rem; border-radius: 15px; }
  .site-nav svg { width: 18px; height: 18px; }
  .site-nav .nav-mono { width: 18px; height: 18px; font-size: 0.62rem; }
}

/* "Over ons": a tab on wide screens, a small link in the header on phones */
.header-about { display: none; }
@media (max-width: 760px) {
  .site-nav a.nav-about { display: none; }
  .header-about {
    display: inline-flex; align-items: center; margin-left: auto; min-height: 36px; padding: 0 14px;
    border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
    color: var(--muted); font-size: 0.85rem; font-weight: 650; text-decoration: none;
  }
  .header-about[aria-current="page"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
}
