/* Soundtrack pages (The Sphere, The Legend of Skye, Lost Key).
   Builds on styles.css. Each page sets a theme class on <html> that swaps the
   color tokens: the game tints the ground and the accent, the layout stays the same. */

/* The Sphere: deep space blue, first contact green */
html.theme-sphere {
    --bg: #080b16;
    --surface: #0c1122;
    --surface_2: #111833;
    --line: #1d2438;
    --line_strong: rgba(230, 236, 245, 0.4);
    --text: #e6ecf5;
    --text_2: #c3cede;
    --muted: #a9b4c6;
    --accent: #8be37a;
    --on_accent: #0b1a08;
}

/* The Legend of Skye: canopy green and sky */
html.theme-skye {
    --bg: #0b1719;
    --surface: #0f2023;
    --surface_2: #13292b;
    --line: #1f3a3e;
    --line_strong: rgba(228, 236, 224, 0.4);
    --text: #e4ece0;
    --text_2: #c2d0c4;
    --muted: #9fb7b4;
    --accent: #a3d16b;
    --on_accent: #1f3509;
}

/* Lost Key: near black, blood red, glowing copper */
html.theme-lostkey {
    --bg: #0d0607;
    --surface: #170a0b;
    --surface_2: #1f0e0f;
    --line: #3a1c1b;
    --line_strong: rgba(240, 228, 210, 0.4);
    --text: #f0e4d2;
    --text_2: #d4c3ad;
    --muted: #b89a80;
    --accent: #e0906f;
    --on_accent: #2a1204;
}

.siteNav.navBar { border-bottom: 1px solid var(--line); }

/* ─── Header ──────────────────────────────────────────────────────────────── */
.stHeader { padding: 88px 0; }

.stHeaderGrid {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 64px;
    align-items: end;
}

/* The cover keeps its own aspect ratio, so titles and logos are never cropped */
.stCover {
    overflow: hidden;
    border-radius: 2px;
    background: var(--surface);
}

.stCover img {
    display: block;
    width: 100%;
    height: auto;
}

.stHeaderText {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.stHeaderText .eyebrow { margin: 0; }

.stTitle {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(56px, 7vw, 96px);
    line-height: 0.95;
    color: var(--text);
    margin: 0;
}

.stCredit { margin: 0; font-size: 17px; color: var(--text); }

.stDescription {
    margin: 0;
    max-width: 560px;
    color: var(--text_2);
}

.stHeaderText .buttonRow { align-items: center; margin-top: 8px; }

/* ─── Highlights ("Start here") ───────────────────────────────────────────── */
.highlightGrid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}

.highlight {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.highlight:hover { border-top-color: var(--accent); }

.highlightTitle {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--serif);
    font-size: 30px;
    line-height: 1.1;
}

.highlightTitle svg { flex: none; color: var(--accent); }

.highlight .muted { font-size: 14px; }

/* ─── Track list ──────────────────────────────────────────────────────────── */
.trackHead {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 24px;
}

.trackHead .sectionTitle { font-size: 44px; }

.trackList {
    border-top: 1px solid var(--line);
}

.trackList.trackListThemes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
}

.track {
    width: 100%;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto 64px;
    gap: 16px;
    align-items: center;
    padding: 18px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.track:hover { background: var(--surface); }

.trackNum {
    font-size: 14px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.trackTitle { font-size: 17px; color: var(--text); }

.trackType {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.trackTime {
    font-size: 14px;
    color: var(--muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.track.isCurrent { background: var(--surface_2); }
.track.isCurrent .trackTitle { color: var(--accent); }
.track.isCurrent .trackNum { color: var(--accent); }

/* ─── Adaptive demo (The Sphere) ──────────────────────────────────────────── */
.demoHead {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 32px;
    margin-bottom: 32px;
}

.demoHead > div { max-width: 640px; }
.demoHead p:not(.eyebrow) { margin: 14px 0 0; color: var(--text_2); }

.demoButtons { display: flex; flex-wrap: wrap; gap: 12px; }

.adaptiveDemoProgress {
    height: 2px;
    background: var(--line);
    margin-bottom: 24px;
}

.adaptiveDemoProgress div {
    height: 100%;
    width: 0%;
    background: var(--accent);
}

.adaptiveDemoStages {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.demoStage {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 14px;
    border-top: 2px solid var(--line);
    opacity: 0.75;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.demoStage.isDone { opacity: 0.5; }
.demoStage.isActive { opacity: 1; border-top-color: var(--accent); }
.demoStage.isQueued { opacity: 1; border-top-style: dashed; border-top-color: var(--accent); }

.demoStageType {
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.demoStageName { font-size: 17px; color: var(--text); }
.demoStage.isActive .demoStageName { color: var(--accent); }

.demoStageHint { font-size: 13px; color: var(--muted); line-height: 1.4; }

.demoStatusLine {
    margin: 28px 0 0;
    min-height: 1.6em;
    font-size: 14px;
    color: var(--text_2);
}

/* ─── Videos on soundtrack pages ──────────────────────────────────────────── */
.stVideos .videoGrid { margin-top: 0; }
.stVideos .videoTitle { font-size: 24px; }

/* ─── Player bar ──────────────────────────────────────────────────────────── */
.playerBar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    border-top: 1px solid var(--line);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.playerBar.isVisible { transform: none; }

body.hasPlayer { padding-bottom: 76px; }

.playerInner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.playerToggle {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on_accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.playerToggle .iconPause { display: none; }
.playerBar.isPlaying .playerToggle .iconPause { display: block; }
.playerBar.isPlaying .playerToggle .iconPlay { display: none; }

.playerNow {
    display: flex;
    flex-direction: column;
    min-width: 160px;
    max-width: 260px;
    line-height: 1.35;
}

.playerNow strong {
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playerNow span { font-size: 12px; color: var(--muted); }

.playerSeek {
    flex: 1 1 240px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.playerSeek input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 18px;
    background: transparent;
    cursor: pointer;
}

.playerSeek input[type="range"]::-webkit-slider-runnable-track {
    height: 2px;
    background: linear-gradient(var(--text), var(--text)) 0 / var(--pct, 0%) 100% no-repeat, var(--line);
}

.playerSeek input[type="range"]::-moz-range-track {
    height: 2px;
    background: var(--line);
}

.playerSeek input[type="range"]::-moz-range-progress {
    height: 2px;
    background: var(--text);
}

.playerSeek input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    margin-top: -5px;
    border-radius: 50%;
    background: var(--text);
}

.playerSeek input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: var(--text);
}

/* ─── Small screens ───────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .stHeader { padding: 32px 0 64px; }

    .stTitle { font-size: 44px; }

    .stHeaderGrid {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    /* Keep the play button within the first screen */
    .stCover { max-width: 160px; }

    .stHeaderText .buttonRow { flex-direction: column; align-items: stretch; }

    .highlightGrid { grid-template-columns: minmax(0, 1fr); gap: 24px; }

    .trackHead .sectionTitle { font-size: 36px; }

    .trackList.trackListThemes { grid-template-columns: minmax(0, 1fr); }

    .track {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        gap: 12px;
    }

    .track .trackType { display: none; }

    .demoButtons { width: 100%; }
    .demoButtons .btn { flex: 1; }

    .adaptiveDemoStages { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    body.hasPlayer { padding-bottom: 112px; }

    .playerInner {
        flex-wrap: wrap;
        gap: 10px 16px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .playerNow { flex: 1; max-width: none; min-width: 0; }
    .playerSeek { order: 3; flex: 1 1 100%; }
    .playerCTA { font-size: 13px; padding: 9px 14px; }
}
