/* ==========================================================================
   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-display: "Bebas Neue", "Oswald", Impact, "Arial Narrow", sans-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, .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: one photo, the name in the middle, a way in on either side
   ========================================================================== */

/* The front page is always the dark stage, whatever the theme. */
.hero {
    --gold: oklch(0.78 0.085 85);
    --gold-hi: oklch(0.9 0.07 88);
    position: relative;
    min-height: 100svh;
    display: grid;
    isolation: isolate;
    overflow: hidden;
    color-scheme: dark;
    color: oklch(0.97 0.005 85);
    background: oklch(0.1 0.005 265);
}

/* No site chrome on the front page: just the language and theme switches. */
body:has(.hero) .site-footer,
body:has(.hero) .scroll-progress,
body:has(.hero) .brand,
body:has(.hero) .topnav { display: none; }

body:has(.hero) .topbar {
    background: none;
    backdrop-filter: none;
    justify-content: flex-end;
    --fg: oklch(0.97 0.005 85);
    --bg: oklch(0.1 0.005 265);
    --muted: oklch(0.8 0.01 265);
    --line: oklch(1 0 0 / 0.25);
}

.hero-photo {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 50% 22%;
    filter: grayscale(1) contrast(1.08) brightness(0.52);
    view-transition-name: portrait;
    transition: filter 0.9s var(--ease-out), scale 6s var(--ease-out);
}

/* Vignette plus a soft tint that leans toward whichever side is hovered. */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 45% at 50% 52%, oklch(0 0 0 / 0.35), transparent 70%),
        radial-gradient(ellipse 120% 90% at 50% 45%, transparent 45%, oklch(0 0 0 / 0.75));
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    mix-blend-mode: color;
    opacity: 0;
    background: linear-gradient(90deg, var(--tint, transparent), transparent 75%);
    transition: opacity 0.9s var(--ease-out);
}

.hero:has(.hero-link.music:is(:hover, :focus-visible))::before { --tint: var(--amber); opacity: 0.45; }
.hero:has(.hero-link.dev:is(:hover, :focus-visible))::before {
    --tint: var(--cyan);
    opacity: 0.4;
    background: linear-gradient(270deg, var(--tint), transparent 75%);
}
.hero:has(.hero-link:is(:hover, :focus-visible)) .hero-photo { filter: grayscale(1) contrast(1.08) brightness(0.62); scale: 1.03; }

.hero-stage {
    align-self: center;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 4.5rem);
    padding: 6rem calc(var(--gutter) + 3.5rem);
}

.hero-mark {
    display: grid;
    justify-items: center;
    gap: 0.6rem;
    text-align: center;
}

.hero-name {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(3rem, 1.4rem + 5.2vw, 6.75rem);
    line-height: 0.86;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-shadow: 0 2px 30px oklch(0 0 0 / 0.5);
}

.hero-name span { display: block; }
.hero-name span:first-child { font-size: 0.62em; letter-spacing: 0.32em; margin-right: -0.32em; }

.hero-tagline {
    font-family: var(--font-mono);
    font-size: clamp(0.72rem, 0.66rem + 0.2vw, 0.85rem);
    letter-spacing: 0.08em;
    color: oklch(0.85 0.01 85 / 0.85);
}

.hero-link {
    position: relative;
    justify-self: end;
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 1.2rem + 1.8vw, 3.1rem);
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--gold);
    padding-block: 0.3rem;
    text-shadow: 0 2px 18px oklch(0 0 0 / 0.6);
    transition: color 0.3s, letter-spacing 0.5s var(--ease-out);
}

.hero-link.dev { justify-self: start; }

.hero-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s var(--ease-out);
}

.hero-link.dev::after { transform-origin: left; }
.hero-link:is(:hover, :focus-visible) { color: var(--gold-hi); letter-spacing: 0.08em; }
.hero-link:is(:hover, :focus-visible)::after { transform: scaleX(1); }
.hero-link:focus-visible { outline: none; }

/* Social icons down the left edge */
.social-rail {
    position: absolute;
    left: var(--gutter);
    top: 50%;
    translate: 0 -50%;
    display: grid;
    gap: 0.9rem;
}

.social-rail a {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    color: oklch(0.97 0.005 85 / 0.8);
    border: 1px solid oklch(1 0 0 / 0.28);
    background: oklch(0 0 0 / 0.25);
    backdrop-filter: blur(4px);
    transition: color 0.2s, border-color 0.2s, background-color 0.2s, scale 0.3s var(--ease-out);
}

.social-rail a:hover, .social-rail a:focus-visible {
    color: oklch(0.12 0.01 265);
    background: var(--gold);
    border-color: var(--gold);
    scale: 1.08;
}

.social-rail svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.social-rail svg .fill { fill: currentColor; stroke: none; }

/* Static shell for deep links: a quiet loader instead of the hero. */
.shell-deep .hero-photo, .shell-deep .hero-link, .shell-deep .hero-tagline, .shell-deep .social-rail { visibility: hidden; }
.shell-deep::after { display: none; }
.shell.shell-deep .hero-mark { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }

/* Narrow screens: the name up top, the two ways in stacked at the bottom. */
@media (max-width: 52rem) {
    .hero-stage {
        align-self: stretch;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto auto;
        gap: 0.5rem;
        padding: 5rem var(--gutter) 6.5rem;
    }
    .hero-mark { grid-row: 1; align-self: end; margin-bottom: 2.5rem; }
    .hero-link, .hero-link.dev { justify-self: center; }
    .hero-photo { object-position: 58% 20%; }
    .hero::after {
        background: linear-gradient(transparent 25%, oklch(0 0 0 / 0.85) 95%),
            radial-gradient(ellipse 120% 90% at 50% 40%, transparent 45%, oklch(0 0 0 / 0.6));
    }
    .social-rail {
        top: auto;
        bottom: 1.5rem;
        left: 50%;
        translate: -50% 0;
        grid-auto-flow: column;
    }
}

/* The one portrait on the content pages (Components/Portrait.razor). */
.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.
   Each content page sets --split to its own side. */
.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);
}


/* ==========================================================================
   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: the photo fades up, the name rises, the two ways in slide in
   from their own side. Only on the static shell (the first paint), so it
   doesn't replay when Blazor takes over the same markup. */
@media (prefers-reduced-motion: no-preference) {
    .shell .hero-photo { animation: photo-in 1.6s var(--ease-out) backwards; }
    .shell .hero-mark { animation: rise 0.9s var(--ease-out) 0.2s backwards; }
    .shell .hero-link.music { animation: in-left 0.9s var(--ease-out) 0.45s backwards; }
    .shell .hero-link.dev { animation: in-right 0.9s var(--ease-out) 0.6s backwards; }
    .shell .social-rail { animation: rise 0.7s var(--ease-out) 0.8s backwards; }
}

@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); } }
@keyframes photo-in { from { opacity: 0; scale: 1.06; } }

/* 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;
    }
}

/* ---------- 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; }
