/* ==========================================================================
   James Welland - Composer
   1. Design tokens   2. Base   3. Utilities   4. Backdrop   5. Header & nav
   6. Hero   7. Buttons   8. Sections & cards   9. Biography   10. Showreel
   11. Audio player   12. Mini player   13. Discography   14. Contact & footer
   15. Showreel dialog   16. Motion
   ========================================================================== */

/* 1. Design tokens --------------------------------------------------------- */
:root {
    /* Colour (brand black, off-white and accent are unchanged) */
    --ink-rgb: 10 10 10;
    --accent-rgb: 201 180 154;
    --color-ink: rgb(var(--ink-rgb));
    --color-text: #f1f1f1;
    --color-text-soft: #d4d0c9;
    --color-text-muted: #a9a49b;
    --color-accent: rgb(var(--accent-rgb));
    --color-accent-strong: #e2d2bd;
    --color-danger: #f0a39a;

    /* Surfaces */
    --veil: rgb(var(--ink-rgb) / 0.82);
    --surface: rgb(18 18 20 / 0.62);
    --surface-solid: rgb(18 18 20 / 0.94);
    --surface-hover: rgb(255 255 255 / 0.07);
    --border: rgb(255 255 255 / 0.1);
    --border-strong: rgb(255 255 255 / 0.22);
    --glass: blur(22px) saturate(1.15);
    --shadow-card: inset 0 1px 0 rgb(255 255 255 / 0.05), 0 24px 60px -24px rgb(0 0 0 / 0.7);

    /* Typography */
    --font-display: 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-copy: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
    --text-lede: clamp(1.5rem, 1.15rem + 1.5vw, 2.125rem);
    --text-h3: clamp(1.9rem, 1.4rem + 1.8vw, 2.75rem);
    --text-h2: clamp(2.25rem, 1.6rem + 2.8vw, 3.75rem);
    --text-h1: clamp(3.5rem, 1.6rem + 9vw, 8.5rem);
    --leading-copy: 1.7;
    --tracking-caps: 0.2em;

    /* Spacing & layout */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: clamp(1.5rem, 1rem + 2vw, 2.5rem);
    --space-section: clamp(4.5rem, 2.5rem + 8vw, 9rem);
    --card-pad: clamp(1.5rem, 0.8rem + 3.5vw, 4rem);
    --gutter: clamp(1rem, 0.4rem + 3vw, 3rem);
    --container: clamp(72rem, 62vw, 88rem); /* grows gently on very wide screens */
    --header-h: 4.25rem;

    /* Shape */
    --radius-sm: 0.5rem;
    --radius-md: 0.875rem;
    --radius-lg: clamp(1rem, 0.7rem + 1vw, 1.5rem);
    --radius-pill: 999px;

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --dur-fast: 150ms;
    --dur-base: 280ms;
    --dur-slow: 700ms;

    /* Layers */
    --z-dock: 90;
    --z-header: 100;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
    background: var(--color-ink);
    color-scheme: dark;
    scroll-padding-top: calc(var(--header-h) + 1rem);
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
html:has(dialog[open]) { overflow: hidden; }

body {
    min-height: 100vh;
    min-height: 100svh;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-soft);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; color: var(--color-text); text-wrap: balance; }
a { color: inherit; }
svg, iframe { display: block; }
iframe { border: 0; color-scheme: light; } /* keeps embedded players' transparent corners on a dark page */
button { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; cursor: pointer; }
cite { font-style: italic; }
::selection { background: rgb(var(--accent-rgb) / 0.35); color: #fff; }

:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

/* 3. Utilities ------------------------------------------------------------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.icon { flex: none; width: 1.25em; height: 1.25em; fill: currentColor; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip-link {
    position: fixed; top: 0.75rem; left: 0.75rem; z-index: 200;
    padding: 0.75rem 1.25rem; border-radius: var(--radius-pill);
    background: var(--color-accent); color: var(--color-ink);
    font-size: var(--text-sm); font-weight: 600; text-decoration: none;
    transform: translateY(-200%); transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus { transform: none; }

.eyebrow {
    display: flex; align-items: center; gap: var(--space-sm);
    font-family: var(--font-body); font-size: var(--text-xs); font-weight: 600; line-height: 1.4;
    letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--color-accent);
}
.eyebrow::before { content: ''; width: 1.75rem; height: 1px; background: currentColor; opacity: 0.7; }

/* 4. Backdrop -------------------------------------------------------------- */
/* A fixed layer (rather than background-attachment: fixed) so the photo holds still on iOS too. */
.backdrop {
    position: fixed; inset: 0 0 auto; z-index: -1;
    height: 100vh; height: 100lvh;
    overflow: hidden; pointer-events: none; background: var(--color-ink);
}
.backdrop::before, .backdrop::after {
    content: ''; position: absolute; inset: 0;
    background: url('img/background.jpg') 47% 30% / cover no-repeat;
}
/* Soft-focus copy that fades in as the hero scrolls away: a scroll-linked cross-fade with no
   movement, so it is safe under reduced motion. Browsers without scroll timelines keep the sharp photo. */
.backdrop::after { inset: -4%; filter: blur(22px); opacity: 0; }
@keyframes rack-focus { to { opacity: 1; } }
@supports (animation-timeline: scroll()) {
    .backdrop::after {
        animation: rack-focus linear both;
        animation-timeline: scroll(root block);
        animation-range: 15vh 95vh;
    }
}

/* 5. Header & navigation --------------------------------------------------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: var(--z-header); }
.site-header::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: rgb(var(--ink-rgb) / 0.66); border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
    opacity: 0; transition: opacity var(--dur-base) ease;
}
.site-header.is-scrolled::before, .site-header.is-open::before { opacity: 1; }

.site-header__inner {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg);
    width: min(100% - 2 * var(--gutter), var(--container)); height: var(--header-h); margin-inline: auto;
}

.brand {
    font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1;
    color: var(--color-text); text-decoration: none; white-space: nowrap;
    transition: opacity var(--dur-base) ease, transform var(--dur-base) var(--ease-out), visibility 0s;
}
/* The wordmark stays out of the way while the hero title is on screen. */
.js .site-header:not(.is-past-hero) .brand {
    opacity: 0; visibility: hidden; transform: translateY(0.375rem);
    transition: opacity var(--dur-base) ease, transform var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base);
}

.site-nav__list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem clamp(1rem, 0.2rem + 2vw, 2.25rem); padding: 0; list-style: none; }
.nav-link {
    position: relative; display: inline-block; padding-block: 0.5rem;
    font-size: 0.78rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
    color: var(--color-text-soft); text-shadow: 0 1px 14px rgb(0 0 0 / 0.55);
    transition: color var(--dur-base) ease;
}
.nav-link::after {
    content: ''; position: absolute; inset: auto 0 0.25rem; height: 1px; background: var(--color-accent);
    transform: scaleX(0); transform-origin: right; transition: transform 0.4s var(--ease-out);
}
.nav-link:hover, .nav-link[aria-current] { color: var(--color-text); }
.nav-link:hover::after, .nav-link[aria-current]::after { transform: scaleX(1); transform-origin: left; }

.nav-toggle {
    display: none; align-items: center; gap: 0.625rem; min-height: 2.75rem; margin-left: auto; padding-inline: 0.25rem;
    font-size: 0.78rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--color-text); text-shadow: 0 1px 14px rgb(0 0 0 / 0.55);
}
.nav-toggle__icon { position: relative; width: 1.25rem; height: 0.625rem; }
.nav-toggle__icon::before, .nav-toggle__icon::after {
    content: ''; position: absolute; left: 0; width: 100%; height: 1.5px; background: currentColor;
    transition: transform var(--dur-base) var(--ease-out);
}
.nav-toggle__icon::before { top: 0; }
.nav-toggle__icon::after { bottom: 0; }
.nav-toggle[aria-expanded='true'] .nav-toggle__icon::before { transform: translateY(0.265rem) rotate(45deg); }
.nav-toggle[aria-expanded='true'] .nav-toggle__icon::after { transform: translateY(-0.265rem) rotate(-45deg); }

@media (max-width: 47.99rem) {
    .js .nav-toggle { display: inline-flex; }
    /* Closed = display: none (out of the tab order); opening plays a short entrance animation. */
    .js .site-nav {
        display: none; position: absolute; inset: 100% 0 auto; padding: var(--space-xs) var(--gutter) var(--space-lg);
        background: rgb(var(--ink-rgb) / 0.9); border-bottom: 1px solid var(--border);
        -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
    }
    .js .site-header.is-open .site-nav { display: block; animation: menu-in var(--dur-base) var(--ease-out); }
    .js .site-nav__list { flex-direction: column; gap: 0; }
    .js .nav-link { display: block; padding-block: 0.875rem; font-size: 0.875rem; border-bottom: 1px solid var(--border); text-shadow: none; }
    .js .nav-link::after { display: none; }
    .js .nav-link[aria-current] { color: var(--color-accent-strong); }
    /* Without JS the links simply wrap under the wordmark. */
    .no-js .site-header__inner { height: auto; flex-wrap: wrap; padding-block: var(--space-sm); }
}

/* 6. Hero ------------------------------------------------------------------ */
.hero {
    position: relative; isolation: isolate;
    display: grid; align-items: end;
    min-height: 100vh; min-height: 100svh;
    padding-block: calc(var(--header-h) + 2rem) clamp(3rem, 9vh, 6.5rem);
}
/* Two scrims: one sized to the header so the nav keeps AA contrast over the brightest parts of the
   photo at any viewport height, and one that leaves the portrait clear before deepening into the veil. */
.hero {
    --scrim-nav: linear-gradient(to bottom, rgb(var(--ink-rgb) / 0.8), rgb(var(--ink-rgb) / 0.62) var(--header-h), rgb(var(--ink-rgb) / 0) calc(var(--header-h) * 3.25));
    --scrim-title: linear-gradient(to bottom, rgb(var(--ink-rgb) / 0.08) 30%, rgb(var(--ink-rgb) / 0.14) 44%, rgb(var(--ink-rgb) / 0.5) 60%, rgb(var(--ink-rgb) / 0.7) 76%, var(--veil) 100%);
}
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--scrim-nav), var(--scrim-title); }
/* Short landscape screens (phones on their side): the name overlaps the portrait, so shade the text side. */
@media (orientation: landscape) and (max-height: 30rem) {
    .hero::before {
        background:
            linear-gradient(to right, rgb(var(--ink-rgb) / 0.78), rgb(var(--ink-rgb) / 0.5) 50%, rgb(var(--ink-rgb) / 0.1) 80%),
            var(--scrim-nav), var(--scrim-title);
    }
}
/* Also capped by viewport height, so the name stays clear of the portrait on short, wide screens. */
.hero__title { font-size: min(var(--text-h1), 14vh + 1rem); line-height: 0.95; letter-spacing: -0.015em; text-shadow: 0 2px 40px rgb(0 0 0 / 0.45); }
.hero__role {
    margin-top: var(--space-md); padding-left: 0.2em;
    font-size: clamp(0.8rem, 0.72rem + 0.4vw, 1rem); font-weight: 500;
    letter-spacing: 0.46em; text-transform: uppercase; color: var(--color-accent-strong);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-xl); }
@media (max-width: 26rem) {
    /* Slightly tighter buttons so both calls to action share one row on phones. */
    .hero__actions .btn { padding-inline: 1.125rem; font-size: 0.75rem; letter-spacing: 0.1em; }
}

/* 7. Buttons --------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.625em;
    min-height: 3rem; padding: 0.75rem 1.5rem;
    border: 1px solid transparent; border-radius: var(--radius-pill);
    font-size: 0.8125rem; font-weight: 600; line-height: 1; letter-spacing: 0.12em; text-transform: uppercase;
    text-decoration: none; white-space: nowrap;
    transition: background-color var(--dur-base) ease, border-color var(--dur-base) ease, color var(--dur-base) ease, transform var(--dur-base) var(--ease-out);
}
@media (hover: hover) { .btn:hover { transform: translateY(-2px); } }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--color-accent); color: var(--color-ink); }
.btn--primary:hover { background: var(--color-accent-strong); }
.btn--ghost {
    border-color: var(--border-strong); background: rgb(255 255 255 / 0.05); color: var(--color-text);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn--ghost:hover { border-color: var(--color-accent); background: rgb(255 255 255 / 0.09); color: var(--color-accent-strong); }

.icon-btn {
    position: relative; flex: none; display: inline-grid; place-items: center;
    width: 2.75rem; height: 2.75rem; border-radius: 50%; color: var(--color-text-soft);
    transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-base) var(--ease-out);
}
.icon-btn .icon { width: 1.375rem; height: 1.375rem; }
.icon-btn--primary { background: var(--color-accent); color: var(--color-ink); }
@media (hover: hover) {
    .icon-btn:hover { background: var(--surface-hover); color: var(--color-text); }
    .icon-btn--primary:hover { background: var(--color-accent-strong); color: var(--color-ink); transform: scale(1.05); }
}
.icon-btn:active { transform: scale(0.94); }
/* Play/pause glyph swap: transport buttons follow the player state, track rows only when current. */
.icon--pause { display: none; }
[data-state='playing'] :is(.icon-btn, .is-current) .icon--play,
[data-state='loading'] :is(.icon-btn, .is-current) .icon--play { display: none; }
[data-state='playing'] :is(.icon-btn, .is-current) .icon--pause,
[data-state='loading'] :is(.icon-btn, .is-current) .icon--pause { display: block; }

/* 8. Sections & cards ------------------------------------------------------ */
.content {
    position: relative; display: grid; row-gap: var(--space-section);
    padding-top: var(--space-section); background: var(--veil);
}
.content > * { min-width: 0; }
.section__header { margin-bottom: var(--space-xl); }
.section__title { margin-top: var(--space-xs); font-size: var(--text-h2); line-height: 1.05; letter-spacing: -0.01em; }

.card {
    position: relative; border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--surface); box-shadow: var(--shadow-card);
    -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .card, .dock, .site-header::before, .js .site-nav { background: var(--surface-solid); }
}

/* 9. Biography ------------------------------------------------------------- */
/* Headline, rule and paragraphs share one width, so the body text fills the card like the headline.
   The cap only bites on very wide monitors, where it stops lines becoming unreadably long. */
.bio { --bio-measure: 65rem; padding: var(--card-pad); }
.bio__lede {
    max-width: var(--bio-measure);
    font-family: var(--font-display); font-size: var(--text-lede); font-weight: 500; line-height: 1.3;
    color: var(--color-text); text-wrap: balance;
}
/* A single rule under the headline, then plain paragraphs. */
.bio__body { max-width: var(--bio-measure); margin-top: var(--space-xl); padding-top: var(--space-xl); border-top: 1px solid var(--border); }
.bio__body p { font-size: var(--text-copy); line-height: var(--leading-copy); text-wrap: pretty; }
.bio__body p + p { margin-top: 1.15em; }
.bio b { font-weight: 600; color: var(--color-text); }
.bio a {
    color: var(--color-accent);
    text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em;
    text-decoration-color: rgb(var(--accent-rgb) / 0.45);
    transition: color var(--dur-fast) ease, text-decoration-color var(--dur-fast) ease;
}
.bio a:hover { color: var(--color-text); text-decoration-color: currentColor; }

/* 10. Showreel ------------------------------------------------------------- */
.showreel {
    position: relative; isolation: isolate; overflow: hidden;
    display: grid; place-content: center; justify-items: center; gap: var(--space-lg);
    width: 100%; min-height: 15rem; aspect-ratio: 21 / 9;
    border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
    color: var(--color-text); transition: border-color var(--dur-base) ease;
}
.showreel:focus-visible { border-color: rgb(var(--accent-rgb) / 0.55); }
/* A tight crop of the piano strings from the portrait doubles as the poster frame. */
.showreel__media {
    position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(to bottom, rgb(var(--ink-rgb) / 0.5), rgb(var(--ink-rgb) / 0.8)),
        url('img/background.jpg') 30% 100% / auto 280% no-repeat; /* sized by height: always the piano, at any panel shape */
    transition: transform 1.4s var(--ease-out);
}
.showreel__play {
    display: grid; place-items: center; width: clamp(4rem, 3rem + 3vw, 5.5rem); aspect-ratio: 1;
    border-radius: 50%; background: var(--color-accent); color: var(--color-ink);
    box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0.3);
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background-color var(--dur-base) ease;
}
.showreel__play .icon { width: 40%; height: 40%; }
@media (hover: hover) {
    .showreel:hover { border-color: rgb(var(--accent-rgb) / 0.55); }
    .showreel:hover .showreel__media { transform: scale(1.04); }
    .showreel:hover .showreel__play { transform: scale(1.06); background: var(--color-accent-strong); box-shadow: 0 0 0 0.75rem rgb(var(--accent-rgb) / 0.16); }
}
.showreel__label { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; }

/* 11. Audio player --------------------------------------------------------- */
.player { display: grid; grid-template-columns: minmax(0, 1fr); }
.player__deck { padding: var(--card-pad) clamp(1.5rem, 1rem + 2.5vw, 3rem); }
.player__list { padding: clamp(0.5rem, 0.2rem + 1.5vw, 1.25rem); border-top: 1px solid var(--border); }
.player__noscript { padding: var(--space-md); color: var(--color-text-muted); }
@media (min-width: 60rem) {
    .player { grid-template-columns: minmax(19rem, 5fr) minmax(0, 7fr); align-items: start; }
    .player__deck { position: sticky; top: calc(var(--header-h) + var(--space-md)); }
    .player__list { border-top: 0; border-left: 1px solid var(--border); }
}

.player__status {
    display: flex; align-items: center; gap: 0.625rem; min-height: 1.25rem;
    font-size: var(--text-xs); font-weight: 600; line-height: 1.4;
    letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--color-accent);
}
.player[data-state='error'] .player__status { color: var(--color-danger); letter-spacing: 0.04em; text-transform: none; font-size: var(--text-sm); }
.player[data-state='idle'] .player__status .eq, .player[data-state='error'] .player__status .eq { display: none; }
/* Room for a two-line title, so the scrubber and controls never jump between tracks.
   Between these widths the deck is wide enough for every title to sit on one line. */
.player__heading { min-height: calc(var(--text-h3) * 2.2 + 2.75rem); }
@media (min-width: 36rem) and (max-width: 59.99rem) { .player__heading { min-height: 0; } }
.player__title { margin-top: var(--space-sm); font-size: var(--text-h3); line-height: 1.1; letter-spacing: -0.005em; }
.player__meta { display: flex; flex-wrap: wrap; gap: 0 0.625rem; margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--color-text-muted); }
.player__position:not(:empty)::before { content: '·'; margin-right: 0.625rem; }

/* Equaliser: the active-playing indicator */
.eq { flex: none; display: inline-flex; align-items: flex-end; gap: 2px; width: 1rem; height: 0.875rem; }
.eq i { flex: 1; height: 100%; border-radius: 1px; background: currentColor; transform-origin: bottom; transform: scaleY(0.4); }
.eq i:nth-child(2) { transform: scaleY(0.85); }
.eq i:nth-child(3) { transform: scaleY(0.3); }
.eq i:nth-child(4) { transform: scaleY(0.65); }
/* Only the visible equalisers animate (status line + current row), and only while playing. */
[data-state='playing'] :is(.player__status, .is-current) .eq i { animation: eq 0.9s ease-in-out infinite alternate; }
[data-state='playing'] :is(.player__status, .is-current) .eq i:nth-child(2) { animation-duration: 0.7s; animation-delay: -0.35s; }
[data-state='playing'] :is(.player__status, .is-current) .eq i:nth-child(3) { animation-duration: 1.1s; animation-delay: -0.6s; }
[data-state='playing'] :is(.player__status, .is-current) .eq i:nth-child(4) { animation-duration: 0.8s; animation-delay: -0.15s; }
@keyframes eq { from { transform: scaleY(0.2); } to { transform: scaleY(1); } }

/* Scrubber: custom visuals over a real <input type="range"> for keyboard and assistive tech */
.scrubber { --progress: 0; --buffered: 0; position: relative; height: 1.75rem; margin-top: var(--space-lg); border-radius: var(--radius-sm); cursor: pointer; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.scrubber:has(.scrubber__input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.scrubber__bar {
    position: absolute; inset: 50% 0 auto; height: 4px; translate: 0 -50%;
    border-radius: var(--radius-pill); background: rgb(255 255 255 / 0.14);
    transition: height var(--dur-fast) ease;
}
.scrubber:hover .scrubber__bar, .scrubber.is-scrubbing .scrubber__bar { height: 6px; }
.scrubber__buffer, .scrubber__fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; }
.scrubber__buffer { width: calc(var(--buffered) * 100%); background: rgb(255 255 255 / 0.16); }
.scrubber__fill { width: calc(var(--progress) * 100%); background: var(--color-accent); }
.scrubber__thumb {
    position: absolute; top: 50%; left: calc(var(--progress) * 100%);
    width: 0.875rem; height: 0.875rem; margin: -0.4375rem 0 0 -0.4375rem; border-radius: 50%;
    background: var(--color-text); box-shadow: 0 0 0 0.25rem rgb(var(--accent-rgb) / 0.28);
    transform: scale(0); transition: transform var(--dur-fast) var(--ease-out);
}
.player:not([data-state='idle']) .scrubber__thumb { transform: scale(0.72); }
.scrubber:hover .scrubber__thumb, .scrubber.is-scrubbing .scrubber__thumb, .scrubber:focus-within .scrubber__thumb { transform: scale(1); }
.scrubber__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }

.player__times { display: flex; justify-content: space-between; font-size: var(--text-xs); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.player__controls { display: flex; align-items: center; justify-content: center; gap: clamp(1rem, 0.5rem + 2vw, 1.75rem); margin-top: var(--space-lg); }
.player__controls .icon-btn--primary { width: 4rem; height: 4rem; }
.player__controls .icon-btn--primary .icon { width: 1.625rem; height: 1.625rem; }
/* Loading ring around the main play button */
[data-state='loading'] .icon-btn--primary::after {
    content: ''; position: absolute; inset: -0.375rem; border-radius: 50%;
    border: 2px solid rgb(var(--accent-rgb) / 0.22); border-top-color: var(--color-accent);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }

/* Tracklist */
.tracklist__head {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem var(--space-md); padding: var(--space-sm) 0.875rem var(--space-sm);
    font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.16em;
    text-transform: uppercase; white-space: nowrap; color: var(--color-text-muted);
}
@media (max-width: 29.99rem) { .tracklist__head { font-size: 0.6875rem; letter-spacing: 0.1em; } }
.tracklist { display: grid; gap: 2px; padding: 0; list-style: none; }
.track {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto minmax(3.25rem, auto); align-items: center; column-gap: 0.875rem;
    width: 100%; min-height: 3.5rem; padding: 0.625rem 0.875rem; border-radius: var(--radius-md);
    text-align: left; color: var(--color-text-soft);
    transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.track:focus-visible { outline-offset: -2px; }
.track__index { display: grid; place-items: center; width: 2rem; height: 2rem; font-size: var(--text-sm); font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.track__index > * { grid-area: 1 / 1; transition: opacity var(--dur-fast) ease, transform var(--dur-base) var(--ease-out); }
.track__index .icon { width: 1.125rem; height: 1.125rem; color: var(--color-text); opacity: 0; transform: scale(0.7); }
.track__index .eq { color: var(--color-accent); opacity: 0; }
.track__title { font-size: 0.96875rem; font-weight: 500; line-height: 1.35; transition: transform var(--dur-base) var(--ease-out), color var(--dur-fast) ease; }
.track__category {
    padding: 0.2rem 0.625rem; border: 1px solid var(--border); border-radius: var(--radius-pill);
    font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; color: var(--color-text-muted);
}
.track__duration { text-align: right; font-size: var(--text-sm); font-variant-numeric: tabular-nums; color: var(--color-text-muted); }

/* Hover / focus: the number gives way to a play (or pause) glyph and the title nudges right.
   Hover styles are limited to devices that really hover, so they never stick after a tap. */
.track:focus-visible .track__num { opacity: 0; }
.track:focus-visible .track__index .icon { opacity: 1; transform: none; }
@media (hover: hover) {
    .track:hover { background: var(--surface-hover); color: var(--color-text); }
    .track:hover .track__num { opacity: 0; }
    .track:hover .track__index .icon { opacity: 1; transform: none; }
    .track:hover .track__title { transform: translateX(3px); }
}

/* Current track */
.is-current .track { background: rgb(var(--accent-rgb) / 0.1); color: var(--color-text); }
.is-current .track__title { color: var(--color-accent-strong); }
.is-current .track__category { border-color: rgb(var(--accent-rgb) / 0.35); color: var(--color-accent); }
/* The equaliser replaces the number once a track has actually been started. */
.player:is([data-state='playing'], [data-state='paused'], [data-state='loading']) .is-current .track__num { opacity: 0; }
.player:is([data-state='playing'], [data-state='paused'], [data-state='loading']) .is-current .track__index .eq { opacity: 1; }
.player .is-current .track:focus-visible .eq { opacity: 0; }
@media (hover: hover) { .player .is-current .track:hover .eq { opacity: 0; } }
.is-current .track::after {
    content: ''; position: absolute; inset: auto auto 0 0; height: 2px; width: calc(var(--progress, 0) * 100%);
    background: var(--color-accent); opacity: 0.85;
}
.is-unavailable .track__title { color: var(--color-text-muted); }
.is-unavailable .track__duration { color: var(--color-danger); font-size: 0.6875rem; letter-spacing: 0.04em; }

@media (max-width: 35.99rem) {
    .track { grid-template-columns: 2rem minmax(0, 1fr) auto; row-gap: 0.125rem; }
    .track__index, .track__duration { grid-row: 1 / span 2; }
    .track__title { grid-column: 2; align-self: end; }
    .track__category { grid-column: 2; grid-row: 2; align-self: start; padding: 0; border: 0; }
    .track__duration { grid-column: 3; }
}

/* 12. Mini player ---------------------------------------------------------- */
.dock {
    position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: var(--z-dock);
    display: flex; align-items: center; gap: 0.375rem; overflow: hidden;
    width: min(100% - 2rem, 38rem); padding: 0.5rem 0.625rem;
    border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
    background: rgb(18 18 20 / 0.8); box-shadow: 0 18px 50px -12px rgb(0 0 0 / 0.85);
    -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
    opacity: 0; visibility: hidden; transform: translate(-50%, calc(100% + 2rem));
    transition: transform 0.45s var(--ease-out), opacity var(--dur-base) ease, visibility 0s linear 0.45s;
}
.dock.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.dock__progress { position: absolute; inset: 0 0 auto; height: 2px; background: rgb(255 255 255 / 0.08); }
.dock__fill { display: block; height: 100%; width: calc(var(--progress, 0) * 100%); background: var(--color-accent); }
.dock__meta { flex: 1; min-width: 0; display: grid; padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); text-align: left; }
.dock__title { overflow: hidden; font-size: var(--text-sm); font-weight: 600; line-height: 1.35; white-space: nowrap; text-overflow: ellipsis; color: var(--color-text); }
.dock__sub { display: flex; gap: 0.5rem; font-size: var(--text-xs); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--color-text-muted); }
.dock__time:not(:empty)::before { content: '·'; margin-right: 0.5rem; }
.has-dock .site-footer { padding-bottom: 6.5rem; }
@media (max-width: 29.99rem) { .dock__skip { display: none; } }

/* 13. Discography ---------------------------------------------------------- */
.spotify-embeds { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: var(--space-lg); }
.spotify-embeds iframe { width: 100%; border-radius: 12px; box-shadow: var(--shadow-card); }

/* 14. Contact & footer ----------------------------------------------------- */
.contact { display: grid; justify-items: center; padding: var(--card-pad); text-align: center; }
.contact .eyebrow::before { display: none; }
.email-link {
    max-width: 100%; margin-top: var(--space-lg); padding-bottom: 0.1em;
    font-family: var(--font-display); font-size: clamp(1.5rem, 0.9rem + 3vw, 3rem); font-weight: 500; line-height: 1.2;
    color: var(--color-text); text-decoration: none; overflow-wrap: anywhere;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
    transition: color var(--dur-base) ease, background-size 0.5s var(--ease-out);
}
.email-link:hover { color: var(--color-accent-strong); background-size: 100% 1px; }
.social-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-sm); margin-top: var(--space-xl); padding: 0; list-style: none; }
.social-links .btn { font-size: var(--text-sm); letter-spacing: 0.03em; text-transform: none; } /* keeps brand casing, e.g. IMDb */

.site-footer {
    padding: var(--space-xl) var(--gutter) calc(var(--space-xl) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border); background: rgb(var(--ink-rgb) / 0.55);
    font-size: var(--text-xs); letter-spacing: 0.1em; text-align: center; color: var(--color-text-muted);
    transition: padding-bottom var(--dur-base) ease;
}

/* 15. Showreel dialog ------------------------------------------------------ */
.modal {
    width: min(100% - 2rem, 64rem, (100vh - 8rem) * 16 / 9); max-width: none; max-height: none;
    margin: auto; padding: 0; overflow: visible; border: 0; background: none; color: inherit;
}
.modal::backdrop { background: rgb(5 5 6 / 0.9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal[open] { animation: modal-in var(--dur-base) var(--ease-out); }
.modal__inner { position: relative; }
.modal__frame { overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: var(--radius-md); background: #000; box-shadow: 0 30px 80px -20px #000; }
.modal__frame iframe { width: 100%; height: 100%; }
.modal__close { position: absolute; right: 0; bottom: calc(100% + 0.5rem); background: rgb(255 255 255 / 0.1); color: var(--color-text); }
@keyframes modal-in { from { opacity: 0; transform: translateY(0.75rem) scale(0.98); } }

/* 16. Motion --------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(1.25rem); } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-0.5rem); } }
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
    .hero__title, .hero__role, .hero__actions { animation: rise 1.1s var(--ease-out) both; }
    .hero__title { animation-delay: 0.15s; }
    .hero__role { animation-delay: 0.35s; }
    .hero__actions { animation-delay: 0.55s; }
    /* Scroll-reveal: script.js adds .reveal-ready once its observer is running, so content can
       never be left hidden if the script fails to load. */
    .reveal-ready [data-reveal] { opacity: 0; transform: translateY(1.25rem); }
    .reveal-ready [data-reveal].is-visible { opacity: 1; transform: none; transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
