/* =========================================================
   Breinruimte — global styles (single source of truth)
   Dark mode: Tokyo Night (Omarchy palette), higher contrast
   Pink borders: Okabe-Ito rose #CC79A7 (colorblind-safe)
   Dark-mode highlights: muted mustard #c9a24b
   Light mode: paired warm off-white
   ========================================================== */

/* ---------- design tokens ---------- */
:root {
  /* dark (default) — Tokyo Night, boosted contrast */
  --bg:          #1a1b26;
  --bg-elevated: #26283d;
  --fg:          #d4d4f0;
  --fg-muted:    #9ea3c5;
  --fg-dim:      #74799a;
  --accent:      #7aa2f7;
  --accent-soft: #344873;
  --border:      #454a6e;
  --border-accent: #CC79A7;   /* content borders (cards, dividers, code) */
  --highlight:   #c9a24b;     /* dark-mode highlight (muted mustard) */
  --highlight-bg: rgba(201, 162, 75, 0.12);
  --card-bg:     #222438;

  --maxw: 68ch;
  --radius: 6px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, monospace;

  --nav-h: 3rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:          #f7f5f0;
    --bg-elevated: #ffffff;
    --fg:          #1f2330;
    --fg-muted:    #5b6178;
    --fg-dim:      #888d9f;
    --accent:      #3458c5;
    --accent-soft: #d6e0f5;
    --border:      #e0dbd2;
    --card-bg:     #ffffff;
  }
}

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

html {
  color-scheme: dark light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ---------- selection ---------- */
::selection {
  background: var(--accent-soft);
  color: var(--fg);
}

/* ---------- focus ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* =========================================================
   toegankelijkheid: skip link
   ========================================================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 0 0 6px 0;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--bg);
  outline-offset: 2px;
}

/* =========================================================
   navigatie
   ========================================================== */

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  gap: 0.25rem;
}

nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 0 0.25rem;
  transition: color 0.15s ease;
}

nav a:hover { color: var(--fg); }

nav a[aria-current="page"] {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--accent-soft);
}

/* =========================================================
   main
   ========================================================== */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

h1, h2, h3 {
  color: var(--fg);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 { font-size: 2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.4rem; margin-top: 2rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.15rem; margin-top: 1.25rem; margin-bottom: 0.25rem; }

p { margin: 0 0 1rem; }

.muted {
  color: var(--fg-muted);
  font-size: 0.92rem;
}

/* =========================================================
   layout signature — left accent bar (Tokyo Night blue)
   ========================================================== */

main::before {
  content: "";
  position: fixed;
  top: var(--nav-h);
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 1;
  z-index: 0;
}

/* =========================================================
   homepage
   ========================================================== */

h1 + p { max-width: 46ch; }

/* =========================================================
   blog index
   ========================================================== */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.card:hover {
  border-color: var(--border-accent);
  background: var(--bg-elevated);
}

.card h2 { margin: 0; }

.card h2 a {
  color: var(--fg);
  text-decoration: none;
}

.card h2 a:hover { color: var(--accent); }

main > p:only-child {
  color: var(--fg-muted);
  font-style: italic;
}

/* =========================================================
   blog post
   ========================================================== */

article.post {
  max-width: 54ch;
}

article.post > header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-accent);
}

article.post h1 {
  font-size: 1.75rem;
  margin-bottom: 0.4rem;
}

article.post .muted {
  font-size: 0.88rem;
}

article.post .post-body {
  color: var(--fg);
}

.post-body p { margin-bottom: 1rem; }
.post-body strong { color: var(--fg); font-weight: 600; }
.post-body em { font-style: italic; }

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  color: var(--accent);
}

/* =========================================================
   terug-naar-blog link (post-pagina)
   ========================================================== */

.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 1rem;
  transition: color 0.15s ease;
}

.back-to-blog:hover { color: var(--fg); }

.back-to-blog:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* =========================================================
   highlights — dark mode only (muted mustard)
   ========================================================== */

mark,
.highlight {
  background: var(--highlight-bg);
  color: var(--highlight);
  border-radius: 2px;
  padding: 0.05em 0.15em;
}

.hl-tag {
  display: inline-block;
  background: var(--highlight-bg);
  color: var(--highlight);
  border-radius: 4px;
  padding: 0.1rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 500;
}

/* =========================================================
   software pagina
   ========================================================== */

section.card {
  background: var(--card-bg);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem;
  margin-bottom: 1.5rem;
}

section.card h3 {
  color: var(--accent);
  margin-top: 0;
}

section.card + h2 { margin-top: 1.5rem; }
section.card ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

section.card li {
  margin-bottom: 0.6rem;
}

section.card li strong { color: var(--fg); }

/* =========================================================
   footer
   ========================================================== */

footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 1.5rem 1.25rem;
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
  color: var(--fg-dim);
  font-size: 0.85rem;
  text-align: center;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }
