/* Pjotter Bolte — light/dark follows the OS setting. */

/* Self-hosted (OFL licence): no Google Fonts request, so no visitor IP sent to Google (AVG). */
@font-face {
    font-family: "Space Grotesk";
    src: url("/static/fonts/space-grotesk.woff2") format("woff2");
    font-weight: 300 700;
    font-display: swap;
}

:root {
    --bg: #ffffff;
    --surface: #f4f7f8;
    --text: #0b1220;
    --muted: #5b6676;
    --border: #e3e8ec;
    --accent: #0f766e;        /* teal, AA on white */
    --accent-soft: #e6f4f2;
    --ink: #0b1220;           /* dark block background */
    --ink-text: #e8eef2;
    --ink-accent: #5eead4;

    --font-display: "Space Grotesk", system-ui, sans-serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, monospace;
    --font-serif: "Iowan Old Style", Georgia, "Times New Roman", serif;

    --wide: 72rem;
    --measure: 42rem;
    --radius: 0.75rem;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1220;
        --surface: #111b2e;
        --text: #e8eef2;
        --muted: #94a3b8;
        --border: #1f2b3e;
        --accent: #2dd4bf;
        --accent-soft: #0f2a2e;
        --ink: #020617;
    }
}

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 1.0625rem/1.65 var(--font-body);
    -webkit-font-smoothing: antialiased;
}

.wrap {
    width: 100%;
    max-width: var(--wide);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.25rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }

/* The one highlighted word in a heading */
h1 em, h2 em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
}

a { color: var(--accent); text-underline-offset: 0.2em; }

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

/* Small mono label above sections: "01 · Lokale AI" */
.label {
    display: block;
    margin-bottom: 0.75rem;
    font: 500 0.8rem/1.4 var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.lead {
    font-size: 1.25rem;
    color: var(--muted);
    max-width: 36rem;
}

.meta { color: var(--muted); font-size: 0.9rem; }

/* Buttons */
.button {
    display: inline-block;
    padding: 0.8rem 1.4rem;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg);
    font: 600 1rem/1 var(--font-display);
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.15s;
}
.button:hover { filter: brightness(1.1); }
.button--small { padding: 0.55rem 1rem; font-size: 0.9rem; }
.button--outline { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.site-header .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 2rem;
    padding-block: 1rem;
}

.logo {
    font: 700 1.15rem/1 var(--font-display);
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}
.logo span { color: var(--accent); }

.site-header nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
}
.site-header nav a:not(.button) {
    color: var(--muted);
    text-decoration: none;
}
.site-header nav a:not(.button):hover { color: var(--text); }

/* Active page: each template sets data-page on <body> */
body[data-page="over-mij"] nav a[href="/over-mij"],
body[data-page="blog"]     nav a[href="/blog"],
body[data-page="model"]    nav a[href="/model"] {
    color: var(--text);
    box-shadow: inset 0 -2px var(--accent);
}

main { flex: 1; }

/* Sections */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section + .section { border-top: 1px solid var(--border); }

.hero { padding-block: clamp(4rem, 12vw, 8rem); }
.hero h1 { max-width: 14ch; }
.hero .button { margin-top: 1.5rem; }

/* Topic grid */
.topics {
    list-style: none;
    padding: 0;
    margin: 2.5rem 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1.25rem;
}
.topics li {
    padding: 1.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.topics p { margin: 0; color: var(--muted); }

/* Numbered steps */
.steps {
    list-style: none;
    padding: 0;
    margin: 2.5rem 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 2rem;
    counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
    content: counter(step, decimal-leading-zero);
    display: block;
    margin-bottom: 0.75rem;
    font: 500 0.9rem var(--font-mono);
    color: var(--accent);
}
.steps p { margin: 0; color: var(--muted); }

/* Dark signup block */
.signup {
    background: var(--ink);
    color: var(--ink-text);
    border-radius: calc(var(--radius) * 2);
    padding: clamp(2rem, 6vw, 4rem);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 2.5rem;
}
.signup .label, .signup .lead { color: #94a3b8; }
.signup h2 em { color: var(--ink-accent); }

form { display: grid; gap: 1rem; }

label { display: grid; gap: 0.35rem; font-size: 0.95rem; }

input[type="text"], input[type="email"], select {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    background: #0f172a;
    color: var(--ink-text);
    font: inherit;
}
input::placeholder { color: #64748b; }
input:focus-visible, select:focus-visible { outline-color: var(--ink-accent); }

.consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.85rem; color: #94a3b8; }
.consent input { margin-top: 0.3rem; accent-color: var(--ink-accent); }

.signup .button { background: var(--ink-accent); color: var(--ink); justify-self: start; }
.signup .button:disabled { opacity: 0.6; cursor: wait; }
.signup a:not(.button) { color: var(--ink-accent); }

/* Honeypot for spam bots: hidden from people and screen readers */
.hp { position: absolute; left: -9999px; }

/* Article pages (over mij, blog, post) */
.prose { max-width: var(--measure); }
.prose h1 { font-size: clamp(2.2rem, 5vw, 3.25rem); }
.prose h2 { font-size: 1.6rem; margin-top: 2.5rem; }

.post-list { list-style: none; padding: 0; margin: 2rem 0 0; }
.post-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 1.5rem;
    padding-block: 1.1rem;
    border-bottom: 1px solid var(--border);
}
.post-list time {
    flex: 0 0 7rem;
    font: 0.85rem var(--font-mono);
    color: var(--muted);
}
.post-list a {
    font: 600 1.15rem/1.3 var(--font-display);
    color: var(--text);
    text-decoration: none;
}
.post-list a:hover { color: var(--accent); }

.back { margin-top: 3rem; }
.back a { text-decoration: none; }

/* Code — for the technical posts */
code, pre { font-family: var(--font-mono); font-size: 0.88em; }
:not(pre) > code { background: var(--surface); padding: 0.1em 0.35em; border-radius: 0.3em; }
pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    line-height: 1.5;
}
blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--accent); color: var(--muted); }
img, video { max-width: 100%; height: auto; border-radius: var(--radius); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { padding-block: 2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
