/* ==========================================================================
   groenbaekpedersen.dk: "two halves of one person"
   Warm amber stage light (the musician) vs. cool cyan terminal (the developer).
   ========================================================================== */

@property --split {
    syntax: "<percentage>";
    inherits: true;
    initial-value: 50%;
}

/* ---------- Tokens ---------- */
:root {
    color-scheme: dark;
    --bg: oklch(0.17 0.012 265);
    --bg-2: oklch(0.2 0.014 265);
    --card: oklch(0.22 0.014 265 / 0.7);
    --fg: oklch(0.95 0.01 85);
    --muted: oklch(0.72 0.02 265);
    --line: oklch(0.34 0.02 265);
    --amber: oklch(0.8 0.15 70);
    --amber-deep: oklch(0.55 0.14 50);
    --cyan: oklch(0.82 0.12 205);
    --cyan-deep: oklch(0.5 0.1 230);
    --accent: var(--fg);
    --grain-opacity: 0.14;
    --shadow: 0 1px 0 oklch(1 0 0 / 0.04) inset, 0 20px 50px -20px oklch(0 0 0 / 0.6);

    --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

    --gutter: clamp(1rem, 4vw, 3rem);
    --maxw: 68rem;
    --radius: 1.25rem;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        color-scheme: light;
        --bg: oklch(0.975 0.008 85);
        --bg-2: oklch(0.945 0.012 85);
        --card: oklch(1 0 0 / 0.7);
        --fg: oklch(0.2 0.02 265);
        --muted: oklch(0.45 0.02 265);
        --line: oklch(0.86 0.015 85);
        --amber: oklch(0.58 0.15 55);
        --amber-deep: oklch(0.8 0.12 75);
        --cyan: oklch(0.5 0.11 225);
        --cyan-deep: oklch(0.82 0.08 205);
        --grain-opacity: 0.08;
        --shadow: 0 20px 40px -24px oklch(0.3 0.03 265 / 0.35);
    }
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: oklch(0.975 0.008 85);
    --bg-2: oklch(0.945 0.012 85);
    --card: oklch(1 0 0 / 0.7);
    --fg: oklch(0.2 0.02 265);
    --muted: oklch(0.45 0.02 265);
    --line: oklch(0.86 0.015 85);
    --amber: oklch(0.58 0.15 55);
    --amber-deep: oklch(0.8 0.12 75);
    --cyan: oklch(0.5 0.11 225);
    --cyan-deep: oklch(0.82 0.08 205);
    --grain-opacity: 0.08;
    --shadow: 0 20px 40px -24px oklch(0.3 0.03 265 / 0.35);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: clamp(1rem, 0.95rem + 0.2vw, 1.075rem);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code { font-family: var(--font-mono); }

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

::selection { background: var(--amber); color: oklch(0.15 0.01 265); }

/* Film grain, used on the music side */
.grain, .half-music::after, .side-music::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Top bar ---------- */
.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem var(--gutter);
    background: linear-gradient(var(--bg) 0%, color-mix(in oklch, var(--bg) 70%, transparent) 70%, transparent);
    backdrop-filter: blur(6px);
    view-transition-name: topbar;
}

.brand { text-decoration: none; display: inline-flex; }

.brand-mark {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.6rem;
    border-radius: 0.6rem;
    border: 1px solid var(--line);
    background: linear-gradient(90deg, var(--amber) 50%, var(--cyan) 50%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.topnav {
    display: flex;
    gap: 0.25rem;
    margin-inline: auto;
}

.topnav-link {
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--muted);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    transition: color 0.2s, background-color 0.2s;
}

.topnav-link:hover { color: var(--fg); }
.topnav-link.music.active { color: var(--amber); background: color-mix(in oklch, var(--amber) 12%, transparent); }
.topnav-link.dev.active { color: var(--cyan); background: color-mix(in oklch, var(--cyan) 12%, transparent); font-family: var(--font-mono); }

.topbar-tools { display: flex; align-items: center; gap: 0.5rem; }

.lang-switch {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px;
}

.lang-switch button, .icon-btn {
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 999px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}

.lang-switch button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.lang-switch button:hover:not([aria-pressed="true"]), .icon-btn:hover { color: var(--fg); }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border: 1px solid var(--line);
}

@media (max-width: 40rem) {
    .topnav { display: none; }
    .topbar-tools { margin-left: auto; }
}

/* Scroll progress: a thin amber→cyan line, driven by the scroll position. */
.scroll-progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: 2px;
    z-index: 60;
    background: linear-gradient(90deg, var(--amber), var(--cyan));
    transform-origin: 0 50%;
    transform: scaleX(0);
}

@supports (animation-timeline: scroll()) {
    .scroll-progress { animation: progress linear both; animation-timeline: scroll(root); }
}

@keyframes progress { to { transform: scaleX(1); } }

/* ==========================================================================
   Hero: the split
   ========================================================================== */
.hero {
    position: relative;
    display: flex;
    min-height: 100svh;
    isolation: isolate;
}

.half {
    position: relative;
    flex: 1 1 0;
    display: flex;
    align-items: flex-end;
    min-width: 0;
    padding: 7rem var(--gutter) clamp(2rem, 8vh, 5rem);
    text-decoration: none;
    overflow: hidden;
    transition: flex-grow 0.7s var(--ease-out);
}

.half-inner {
    position: relative;
    z-index: 2;
    max-width: 24rem;
    display: grid;
    gap: 0.75rem;
}

.half-dev { justify-content: flex-end; text-align: right; }
.half-dev .half-inner { justify-items: end; }

/* Music: stage light cone + warm grain */
.half-music {
    background:
        radial-gradient(ellipse 55% 75% at 22% -8%, color-mix(in oklch, var(--amber) 38%, transparent), transparent 70%),
        radial-gradient(ellipse 80% 50% at 10% 110%, color-mix(in oklch, var(--amber-deep) 30%, transparent), transparent 70%),
        var(--bg);
}

.half-music::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: var(--grain-opacity);
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* Dev: blueprint grid fading out + cool glow */
.half-dev {
    background:
        radial-gradient(ellipse 70% 60% at 100% 100%, color-mix(in oklch, var(--cyan) 22%, transparent), transparent 70%),
        var(--bg-2);
}

.half-dev::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(color-mix(in oklch, var(--cyan) 14%, transparent) 1px, transparent 1px) 0 0 / 2rem 2rem,
        linear-gradient(90deg, color-mix(in oklch, var(--cyan) 14%, transparent) 1px, transparent 1px) 0 0 / 2rem 2rem;
    mask-image: radial-gradient(ellipse 90% 80% at 80% 60%, #000 20%, transparent 75%);
    transition: background-position 1.2s var(--ease-out);
}

.half-dev:hover::before { background-position: 1rem 1rem, 1rem 1rem; }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.half-music .eyebrow { color: var(--amber); }
.half-dev .eyebrow { color: var(--cyan); }

.half-title {
    font-size: clamp(2.6rem, 2rem + 3vw, 5rem);
    letter-spacing: -0.02em;
}

.half-music .half-title {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 500;
    font-variation-settings: "opsz" 144;
}

.half-dev .half-title {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: clamp(2.2rem, 1.6rem + 2.6vw, 4.2rem);
    letter-spacing: -0.04em;
}

.cursor {
    display: inline-block;
    width: 0.5ch;
    height: 0.9em;
    margin-left: 0.1em;
    vertical-align: -0.08em;
    background: var(--cyan);
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.half-text { color: var(--muted); max-width: 22rem; }

.cta {
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    padding-top: 0.25rem;
}

.half-music .cta { color: var(--amber); }
.half-dev .cta { color: var(--cyan); font-family: var(--font-mono); font-size: 0.85rem; }
.cta span { transition: transform 0.4s var(--ease-out); }
.half:hover .cta span, .half:focus-visible .cta span { transform: translateX(0.35rem); }

/* Hovering/focusing one half gives it the stage. */
.hero:has(.half-music:is(:hover, :focus-visible)) .half-music,
.hero:has(.half-dev:is(:hover, :focus-visible)) .half-dev { flex-grow: 1.45; }

.hero:has(.half-music:is(:hover, :focus-visible)) { --split: 100%; }
.hero:has(.half-dev:is(:hover, :focus-visible)) { --split: 0%; }

/* Centre: portrait + name, floating over the seam */
.hero-center {
    position: absolute;
    z-index: 5;
    left: 50%;
    top: 50%;
    translate: -50% -56%;
    display: grid;
    justify-items: center;
    gap: 1rem;
    text-align: center;
    pointer-events: none;
    width: min(26rem, 34vw);
}

.portrait-frame {
    position: relative;
    width: clamp(11rem, 20vw, 17rem);
    aspect-ratio: 4 / 5;
    border-radius: 45% 45% 1.5rem 1.5rem / 35% 35% 1.5rem 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow), 0 0 0 1px var(--line);
    view-transition-name: portrait;
    transition: --split 0.8s var(--ease-out);
}

.portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 20%;
    filter: grayscale(1) contrast(1.05);
}

/* Duotone split: amber on the musician side, cyan on the developer side.
   --split slides when a half is hovered. */
.portrait-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        var(--amber) calc(var(--split) - 12%),
        var(--cyan) calc(var(--split) + 12%));
    mix-blend-mode: color;
    opacity: 0.55;
    transition: --split 0.8s var(--ease-out);
}

.hero-name {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: clamp(1.8rem, 1.2rem + 2vw, 3rem);
    letter-spacing: -0.02em;
    font-variation-settings: "opsz" 144;
}

.hero-name span { display: inline-block; }

.typed {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    width: calc(var(--chars, 24) * 1ch);
    max-width: 100%;
    border-right: 2px solid var(--cyan);
    animation: typing 1.6s steps(var(--chars, 24)) 0.4s both, caret 1s steps(1) infinite;
}

@keyframes typing { from { width: 0; } }
@keyframes caret { 50% { border-color: transparent; } }

/* Static shell for deep links: just the portrait while the runtime loads. */
.shell-deep .half, .shell-deep .hero-name, .shell-deep .typed { visibility: hidden; }
.shell-deep .portrait-frame { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.55; scale: 0.97; } }

/* Mobile hero: portrait on top, halves become stacked panels */
@media (max-width: 52rem) {
    .hero { flex-direction: column; }
    .hero-center {
        position: relative;
        left: auto;
        top: auto;
        translate: none;
        width: auto;
        padding: 5.5rem var(--gutter) 2.5rem;
        background: radial-gradient(ellipse 80% 60% at 50% 30%, color-mix(in oklch, var(--amber) 10%, transparent), transparent 70%);
    }
    .portrait-frame { width: clamp(10rem, 48vw, 14rem); }
    .half { padding: 2.5rem var(--gutter); min-height: 42svh; transition: none; }
    .half-dev { justify-content: flex-start; text-align: left; }
    .half-dev .half-inner { justify-items: start; }
    .hero:has(.half:hover) .half { flex-grow: 1; }
}

/* ==========================================================================
   Content pages
   ========================================================================== */
.page {
    position: relative;
    max-width: var(--maxw);
    margin-inline: auto;
    padding: 7rem var(--gutter) 4rem;
    display: grid;
    gap: clamp(3rem, 8vw, 6rem);
}

.side-music { --accent: var(--amber); --accent-deep: var(--amber-deep); }
.side-dev { --accent: var(--cyan); --accent-deep: var(--cyan-deep); }

/* Ambient light behind each page */
.side-music::after, .side-dev::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.side-music::after {
    background: radial-gradient(ellipse 60% 50% at 15% 0%, color-mix(in oklch, var(--amber) 16%, transparent), transparent 70%);
}

.side-music::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: calc(var(--grain-opacity) * 0.6);
    mix-blend-mode: overlay;
    pointer-events: none;
}

.side-dev::after {
    background:
        radial-gradient(ellipse 60% 50% at 90% 0%, color-mix(in oklch, var(--cyan) 14%, transparent), transparent 70%),
        linear-gradient(color-mix(in oklch, var(--cyan) 6%, transparent) 1px, transparent 1px) 0 0 / 2rem 2rem,
        linear-gradient(90deg, color-mix(in oklch, var(--cyan) 6%, transparent) 1px, transparent 1px) 0 0 / 2rem 2rem;
    mask-image: linear-gradient(#000, transparent 60%);
}

.page-head {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: clamp(1.25rem, 4vw, 3rem);
    align-items: center;
}

.portrait-frame.small { width: clamp(6.5rem, 16vw, 11rem); }
.side-music .portrait-frame { --split: 100%; }
.side-dev .portrait-frame { --split: 0%; }

.page-head-text { display: grid; gap: 0.6rem; }
.page .eyebrow { color: var(--accent); }

.page-title {
    font-size: clamp(2.6rem, 1.8rem + 4vw, 5.5rem);
    letter-spacing: -0.03em;
    view-transition-name: page-title;
}

.side-music .page-title {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 500;
    font-variation-settings: "opsz" 144;
}

.side-dev .page-title {
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: -0.05em;
}

.lead { font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem); color: var(--muted); max-width: 40rem; }

@media (max-width: 36rem) {
    .page-head { grid-template-columns: 1fr; }
}

.section { display: grid; gap: 1.75rem; }

.section-title {
    font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.3rem);
    letter-spacing: -0.02em;
    display: grid;
    gap: 0.35rem;
}

.side-music .section-title { font-family: var(--font-serif); font-weight: 500; }
.side-dev .section-title { font-weight: 650; }

.prompt {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--accent);
    letter-spacing: 0;
}

.section-lead { color: var(--muted); margin-top: -0.75rem; }

.meta { color: var(--accent); font-size: 0.9rem; font-weight: 500; }

.btn {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg);
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px var(--accent); }

.text-link { color: var(--accent); font-weight: 600; font-size: 0.9rem; text-underline-offset: 3px; }

.tbd {
    display: inline-block;
    vertical-align: middle;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
    border: 1px dashed currentColor;
    color: oklch(0.72 0.18 20);
    font-style: normal;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tags li {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    border-radius: 0.4rem;
    background: color-mix(in oklch, var(--accent) 12%, transparent);
    color: var(--accent);
}

/* ---------- Music: now playing ---------- */
.now-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: clamp(1.5rem, 5vw, 3.5rem);
    align-items: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: calc(var(--radius) * 1.5);
    background:
        radial-gradient(ellipse 70% 90% at 0% 50%, color-mix(in oklch, var(--amber) 16%, transparent), transparent 70%),
        var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.vinyl {
    width: clamp(8rem, 22vw, 14rem);
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle, transparent 0 30%, oklch(0 0 0 / 0.35) 30.5%, transparent 31%),
        repeating-radial-gradient(circle, oklch(0.16 0 0) 0 2px, oklch(0.22 0 0) 2px 3px),
        oklch(0.14 0 0);
    box-shadow: 0 20px 40px -15px oklch(0 0 0 / 0.7), inset 0 0 0 1px oklch(1 0 0 / 0.06);
    animation: spin 6s linear infinite;
    position: relative;
}

.vinyl::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 30deg, transparent 0 15%, oklch(1 0 0 / 0.1) 20%, transparent 25% 65%, oklch(1 0 0 / 0.08) 70%, transparent 75%);
}

.vinyl-label {
    width: 36%;
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle, oklch(0.14 0 0) 0 7%, var(--amber) 8%);
    color: oklch(0.2 0.02 60);
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(0.6rem, 1.2vw, 0.85rem);
    letter-spacing: 0.1em;
}

@keyframes spin { to { rotate: 360deg; } }

.now-body { display: grid; gap: 0.75rem; }

.now-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--amber);
}

.live-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: oklch(0.68 0.21 25);
    box-shadow: 0 0 0 0 oklch(0.68 0.21 25 / 0.6);
    animation: pulse 1.8s infinite;
}

@keyframes pulse { 70% { box-shadow: 0 0 0 0.6rem oklch(0.68 0.21 25 / 0); } 100% { box-shadow: 0 0 0 0 oklch(0.68 0.21 25 / 0); } }

.now-name {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: clamp(2rem, 1.5rem + 2.5vw, 3.4rem);
    letter-spacing: -0.02em;
}

.now-blurb { color: var(--muted); max-width: 38rem; }

@media (max-width: 40rem) {
    .now-card { grid-template-columns: 1fr; }
    .vinyl { justify-self: center; }
}

/* ---------- Music: timeline ---------- */
.timeline {
    position: relative;
    display: grid;
    gap: 1.5rem;
    padding-left: clamp(0rem, 2vw, 1rem);
}

.timeline::before {
    content: "";
    position: absolute;
    left: calc(clamp(0rem, 2vw, 1rem) + 5.5rem);
    top: 0.5rem;
    bottom: 0.5rem;
    width: 1px;
    background: linear-gradient(var(--amber), transparent);
}

.tl-item {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 1.75rem;
    align-items: start;
    position: relative;
}

.tl-item::before {
    content: "";
    position: absolute;
    left: calc(5.5rem - 0.35rem);
    top: 1.55rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--amber);
}

.tl-year {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--amber);
    padding-top: 1.1rem;
    padding-right: 1rem;
    text-align: right;
    line-height: 1.3;
}

.tl-card {
    container-type: inline-size;
    display: grid;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--line);
    transition: transform 0.4s var(--ease-out), border-color 0.3s;
}

.tl-card:hover { transform: translateX(0.35rem); border-color: color-mix(in oklch, var(--amber) 50%, var(--line)); }

.tl-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.45rem; }
.tl-card p:not(.meta) { color: var(--muted); }

@media (max-width: 36rem) {
    .timeline { padding-left: 0; }
    .timeline::before { left: 0.35rem; }
    .tl-item { grid-template-columns: 1fr; gap: 0.35rem; padding-left: 1.5rem; }
    .tl-item::before { left: 0; top: 0.35rem; }
    .tl-year { padding: 0; text-align: left; }
}

/* ---------- Dev: git log ---------- */
.gitlog {
    display: grid;
    gap: 0;
    position: relative;
    font-size: 0.98rem;
}

.commit {
    position: relative;
    display: grid;
    gap: 0.5rem;
    padding: 0 0 2.25rem 2.25rem;
    border-left: 2px solid color-mix(in oklch, var(--cyan) 35%, transparent);
    margin-left: 0.5rem;
}

.commit:last-child { border-left-color: transparent; padding-bottom: 0; }

.commit::before {
    content: "";
    position: absolute;
    left: -0.5rem;
    top: 0.2rem;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--cyan);
}

.commit.is-head::before { background: var(--cyan); box-shadow: 0 0 0 5px color-mix(in oklch, var(--cyan) 20%, transparent); }

.commit-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.hash { color: oklch(0.8 0.14 90); }
:root[data-theme="light"] .hash { color: oklch(0.55 0.13 80); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .hash { color: oklch(0.55 0.13 80); } }

.ref {
    padding: 0.05rem 0.5rem;
    border-radius: 0.35rem;
    border: 1px solid var(--cyan);
    color: var(--cyan);
    font-weight: 600;
}

.commit-date { color: var(--muted); }
.commit-title { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
.at { color: var(--muted); font-weight: 400; font-family: var(--font-mono); }
.commit > p { color: var(--muted); max-width: 44rem; }

/* ---------- Dev: toolbox ---------- */
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: 1rem;
}

.skill-group {
    padding: 1.25rem 1.35rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--card);
    display: grid;
    gap: 0.9rem;
    align-content: start;
}

.skill-cat {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cyan);
}

.skill-list { display: grid; gap: 0.8rem; }

.skill {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.3rem 0.75rem;
    align-items: baseline;
}

.skill-name { font-weight: 600; }
.skill-stat { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }

.skill-bar {
    grid-column: 1 / -1;
    height: 4px;
    border-radius: 99px;
    background: color-mix(in oklch, var(--cyan) 12%, transparent);
    overflow: hidden;
}

.skill-bar span {
    display: block;
    height: 100%;
    width: calc(var(--v) * 100%);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan-deep), var(--cyan));
    transform-origin: 0 50%;
}

/* ---------- Projects ---------- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
    gap: 1rem;
}

.project-card {
    container-type: inline-size;
    position: relative;
    display: grid;
    gap: 0.65rem;
    align-content: start;
    padding: 1.4rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--card);
    transition: transform 0.4s var(--ease-out), border-color 0.3s, box-shadow 0.4s;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in oklch, var(--accent) 45%, var(--line));
    box-shadow: var(--shadow);
}

.project-top { display: flex; align-items: start; justify-content: space-between; gap: 0.75rem; }
.project-name { font-size: 1.2rem; font-weight: 650; }
.project-name a { text-decoration: none; }
.project-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.project-tagline { color: var(--accent); font-weight: 500; font-size: 0.92rem; }
.project-desc { color: var(--muted); font-size: 0.95rem; }

.badge-crossover {
    flex: none;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    background: linear-gradient(90deg, color-mix(in oklch, var(--amber) 22%, transparent), color-mix(in oklch, var(--cyan) 22%, transparent));
    white-space: nowrap;
}

@container (min-width: 30rem) {
    .project-desc { font-size: 1rem; }
}

/* ---------- Switch to the other side ---------- */
.switch-side {
    display: grid;
    gap: 0.5rem;
    padding: clamp(2rem, 6vw, 4rem);
    border-radius: calc(var(--radius) * 1.5);
    text-decoration: none;
    border: 1px solid var(--line);
    overflow: hidden;
    position: relative;
    transition: border-color 0.3s;
}

.switch-side.dev {
    background: radial-gradient(ellipse 80% 120% at 100% 100%, color-mix(in oklch, var(--cyan) 22%, transparent), transparent 70%), var(--bg-2);
    text-align: right;
}

.switch-side.music {
    background: radial-gradient(ellipse 80% 120% at 0% 0%, color-mix(in oklch, var(--amber) 22%, transparent), transparent 70%), var(--bg);
}

.switch-title {
    font-size: clamp(2rem, 1.4rem + 3vw, 4rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.switch-side.dev .switch-title { font-family: var(--font-mono); font-weight: 500; color: var(--cyan); }
.switch-side.music .switch-title { font-family: var(--font-serif); font-style: italic; font-weight: 500; color: var(--amber); }
.switch-title span { display: inline-block; transition: transform 0.4s var(--ease-out); }
.switch-side:hover .switch-title span { transform: translateX(0.5rem); }

/* ---------- Not found ---------- */
.not-found { justify-items: start; gap: 1.25rem; min-height: 70svh; align-content: center; }
.not-found { --accent: var(--amber); }

.nf-code {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(5rem, 20vw, 12rem);
    line-height: 1;
    background: linear-gradient(90deg, var(--amber), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 2.5rem var(--gutter) 2rem;
    display: grid;
    gap: 1.5rem;
    max-width: calc(var(--maxw) + 2 * var(--gutter));
    margin-inline: auto;
}

.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.footer-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.2rem; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.footer-links a { text-decoration: none; font-weight: 500; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-fine { font-size: 0.8rem; }
.muted { color: var(--muted); }

/* ==========================================================================
   Motion
   ========================================================================== */

/* Scroll-driven reveal: elements rise into place as they enter the viewport. */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .reveal {
            animation: reveal linear both;
            animation-timeline: view();
            animation-range: entry 0% cover 25%;
        }
        .skill-group .skill-bar span {
            animation: fill linear both;
            animation-timeline: view();
            animation-range: entry 10% cover 35%;
        }
    }
}

@keyframes reveal {
    from { opacity: 0; transform: translateY(2.5rem) scale(0.98); }
}

@keyframes fill { from { transform: scaleX(0); } }

/* Page load: hero halves slide in from their own side. */
@media (prefers-reduced-motion: no-preference) {
    .half-music .half-inner { animation: in-left 0.9s var(--ease-out) 0.15s both; }
    .half-dev .half-inner { animation: in-right 0.9s var(--ease-out) 0.3s both; }
    .hero-name { animation: rise 0.9s var(--ease-out) both; }
}

@keyframes in-left { from { opacity: 0; transform: translateX(-2rem); } }
@keyframes in-right { from { opacity: 0; transform: translateX(2rem); } }
@keyframes rise { from { opacity: 0; transform: translateY(1rem); } }

/* View transitions between routes. The portrait and page title morph on
   their own (named); the rest slides toward the side you're heading to. */
::view-transition-group(portrait) { animation-duration: 0.65s; animation-timing-function: var(--ease-out); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.45s; animation-timing-function: var(--ease-out); }

[data-vt-direction="to-music"]::view-transition-old(root) { animation-name: vt-fade-out, vt-to-right; }
[data-vt-direction="to-music"]::view-transition-new(root) { animation-name: vt-fade-in, vt-from-left; }
[data-vt-direction="to-dev"]::view-transition-old(root) { animation-name: vt-fade-out, vt-to-left; }
[data-vt-direction="to-dev"]::view-transition-new(root) { animation-name: vt-fade-in, vt-from-right; }

@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
@keyframes vt-to-right { to { transform: translateX(3rem); } }
@keyframes vt-from-left { from { transform: translateX(-3rem); } }
@keyframes vt-to-left { to { transform: translateX(-3rem); } }
@keyframes vt-from-right { from { transform: translateX(3rem); } }

/* Theme switch: a circular wipe. */
.theme-switching::view-transition-old(root) { animation: none; }
.theme-switching::view-transition-new(root) { animation: wipe 0.6s var(--ease-out); }
@keyframes wipe { from { clip-path: circle(0% at 100% 0%); } to { clip-path: circle(150% at 100% 0%); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .typed { width: auto; border-right: 0; }
}

/* ---------- Blazor error UI ---------- */
#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 1rem 1rem 1rem;
    z-index: 100;
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    background: oklch(0.45 0.16 25);
    color: white;
    box-shadow: var(--shadow);
}

#blazor-error-ui .reload { color: white; margin-left: 0.5rem; }
#blazor-error-ui .dismiss { float: right; background: none; border: 0; color: white; font-size: 1.2rem; cursor: pointer; }
