
:root {
    color-scheme: light dark;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #eef1f5;
    --text: #14171c;
    --muted: #5b6270;
    --border: #e1e5eb;
    --accent: #2457d6;
    --accent-soft: #e6edfc;
    --accent-text: #ffffff;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
    --radius: 14px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1015;
        --surface: #151a21;
        --surface-2: #1c222b;
        --text: #e7e9ee;
        --muted: #9aa3b2;
        --border: #262d38;
        --accent: #7aa2ff;
        --accent-soft: #1b2640;
        --accent-text: #0d1015;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    }
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2rem; margin: 0 0 1em; }
li { margin-bottom: .35em; }
li::marker { color: var(--muted); }

.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(820px, 100% - 2rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--surface); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: .5rem; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.brand-mark {
    display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px;
    background: var(--accent); color: var(--accent-text); font-family: var(--mono); font-size: .85rem;
}
.nav-links { display: flex; gap: 1.25rem; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.lang { display: flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; }
.lang a { padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.lang a[aria-current="true"] { background: var(--text); color: var(--bg); }
@media (max-width: 760px) {
    .nav { flex-wrap: wrap; gap: .5rem 1rem; padding-block: .6rem; }
    .lang { margin-left: auto; }
    .nav-links { order: 3; width: 100%; margin: 0; overflow-x: auto; gap: 1rem; padding-bottom: .2rem; scrollbar-width: none; }
}

/* Buttons & chips */
.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .7rem 1.15rem; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .95rem;
    text-decoration: none; cursor: pointer; transition: transform .15s, border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn-small { padding: .45rem .8rem; font-size: .85rem; border-radius: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.chip {
    display: inline-block; padding: .2rem .6rem; margin: 0; border-radius: 999px;
    background: var(--surface-2); color: var(--muted); font-size: .78rem; font-weight: 500;
}

/* Sections */
.section { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }
.section + .section { border-top: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 2rem; }
.section-head p { color: var(--muted); margin: 0; }
.eyebrow {
    font-family: var(--mono); font-size: .78rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--accent); margin-bottom: .75rem; display: block;
}
.subhead { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 2.5rem 0 1rem; font-weight: 600; }
.subhead:first-child { margin-top: 0; }

/* Hero */
.hero { padding-block: clamp(3.5rem, 2rem + 6vw, 7rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.hero .lead { font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); color: var(--muted); max-width: 60ch; margin-bottom: 2rem; }
.terminal {
    background: #0d1117; color: #c9d1d9; border-radius: var(--radius); box-shadow: var(--shadow);
    border: 1px solid #262d38; font-family: var(--mono); font-size: .88rem; overflow: hidden;
}
.terminal-bar { display: flex; gap: .4rem; padding: .7rem .9rem; background: #161b22; border-bottom: 1px solid #262d38; }
.terminal-bar span { width: .7rem; height: .7rem; border-radius: 50%; background: #3a414c; }
.terminal pre { margin: 0; padding: 1.1rem 1.2rem 1.3rem; white-space: pre-wrap; line-height: 1.7; font: inherit; }
.terminal .p { color: #7ee787; }
.terminal .c { color: #79c0ff; }
.terminal .m { color: #8b949e; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

/* Cards */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card {
    position: relative; display: flex; flex-direction: column; gap: .6rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.4rem; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card h3 { margin: 0; }
.card p { color: var(--muted); margin: 0; font-size: .95rem; }
.card .chips { margin-top: auto; padding-top: .5rem; }
.card-link:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-link h3 a { color: var(--text); text-decoration: none; }
.card-link h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-link:hover h3 a { color: var(--accent); }
.kicker { font-family: var(--mono); font-size: .75rem; color: var(--accent); font-weight: 600; letter-spacing: .04em; }
.card-featured { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card-featured::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: var(--radius) var(--radius) 0 0;
    background: var(--accent);
}
@media (prefers-reduced-motion: reduce) { .card, .btn { transition: none; } .card-link:hover { transform: none; } }

/* Skills */
.skill-icon { font-size: 1.5rem; line-height: 1; }
.skill-card { gap: .9rem; }
.skill-card .btn { align-self: flex-start; margin-top: auto; }

/* Background */
.two-col { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 1.25rem 1.75rem; margin: 0; }
.timeline li::before {
    content: ""; position: absolute; left: .3rem; top: .5rem; width: .6rem; height: .6rem;
    border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline li::after { content: ""; position: absolute; left: .58rem; top: 1.4rem; bottom: .2rem; width: 2px; background: var(--border); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.stack { display: grid; gap: 1.5rem; align-content: start; }

/* Callout */
.callout {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem;
    padding: 2rem; border-radius: var(--radius); background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
}
.callout h2 { margin-bottom: .3rem; font-size: 1.4rem; }
.callout p { margin: 0; color: var(--muted); max-width: 60ch; }

/* Project page */
.breadcrumb { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1.5rem; font-size: .88rem; color: var(--muted); }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; color: var(--border); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.page-head { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) 2rem; }
.page-head .lead { font-size: 1.15rem; color: var(--muted); max-width: 65ch; }
.page-head .chips { margin-top: 1.25rem; }
.prose { padding-bottom: 1rem; }
.prose section { margin-bottom: 2.5rem; }
.prose h2 { font-size: 1.35rem; margin-bottom: .8rem; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 85%, var(--muted)); }
.details-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.details-grid .card { padding: 1.25rem 1.4rem; }
.details-grid .card h3 { font-size: 1rem; }
.details-grid .card ul, .details-grid .card p { font-size: .93rem; margin: 0; }
.details-grid .card li { color: var(--muted); }
dl { margin: 0; }
dt { font-weight: 600; margin-top: .75rem; }
dt:first-child { margin-top: 0; }
dd { margin: .2rem 0 0; color: var(--muted); }
dd ul { margin: .25rem 0 0; }
.disclosure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-top: 1rem; }
.disclosure summary {
    cursor: pointer; padding: 1rem 1.4rem; font-weight: 600; list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: "+"; font-family: var(--mono); font-size: 1.2rem; color: var(--muted); }
.disclosure[open] summary::after { content: "−"; }
.disclosure-body { padding: 0 1.4rem 1.4rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.disclosure-body dd li { font-size: .92rem; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding-block: 2rem 4rem; border-top: 1px solid var(--border); margin-top: 1rem; }
.pager a { display: block; padding: 1rem 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text); }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--muted); font-size: .8rem; margin-bottom: .2rem; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }

/* Programme page */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; overflow-x: auto; scrollbar-width: none; }
.tabs button {
    background: none; border: 0; border-bottom: 2px solid transparent; padding: .75rem 1rem; margin-bottom: -1px;
    font: inherit; font-weight: 600; font-size: .95rem; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.intro { color: var(--muted); margin-bottom: 1.5rem; }
.group { margin-bottom: 2rem; }
.group h3 { font-size: 1rem; margin-bottom: .75rem; }
.group h3 .kicker { margin-right: .5rem; }
.items { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.items li { margin: 0; border-top: 1px solid var(--border); }
.items li:first-child { border-top: 0; }
.item { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 1rem; align-items: center; padding: .85rem 1.2rem; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; }
button.item { cursor: pointer; }
button.item:hover { background: var(--surface-2); }
.item .code { font-family: var(--mono); font-size: .82rem; font-weight: 600; color: var(--accent); }
.item .count { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.item.empty .code, .item.empty .label { color: var(--muted); }
@media (max-width: 560px) { .item { grid-template-columns: 1fr auto; } .item .label { grid-column: 1 / -1; grid-row: 2; } }

/* Dialog */
dialog {
    width: min(640px, 100% - 2rem); max-height: min(80vh, 720px); padding: 0;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
}
dialog::backdrop { background: rgba(10, 12, 16, .55); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { dialog[open] { animation: none; } }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.4rem; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font-size: 1.15rem; margin: 0; }
.dialog-head p { color: var(--muted); margin: .3rem 0 0; font-size: .92rem; }
.dialog-body { padding: 1rem 1.4rem 1.4rem; }
.dialog-close { flex: none; width: 2rem; height: 2rem; border-radius: 8px; border: 1px solid var(--border); background: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; line-height: 1; }
.dialog-close:hover { color: var(--text); border-color: var(--muted); }
.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.link-list li { margin: 0; }
.link-list a { display: block; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); }
.link-list a:hover { border-color: var(--accent); }
.link-list small { display: block; color: var(--muted); font-size: .85rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding-block: 2rem; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

.not-found { min-height: 60vh; display: grid; place-content: center; text-align: center; gap: 1rem; }
.not-found .code404 { font-family: var(--mono); font-size: 4rem; font-weight: 700; color: var(--accent); line-height: 1; }
