/* ============================================================
   Demo Page — phl-demo-page
   Loaded only on template-demo.php.
   Inherits dark theme + CSS vars from body.phl-release-page.
   ============================================================ */

/* ── Hide site chrome on demo page ──────────────────────── */
body.phl-demo-page .phl-menu,
body.phl-demo-page .phl-footer-mini {
    display: none !important;
}

/* ── Page container ─────────────────────────────────────── */
.demo-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 56px) clamp(80px, 10vw, 140px);
    color: var(--phl-white);
    font-family: "futura-pt", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Section scaffold ───────────────────────────────────── */
.demo-section {
    margin-top: clamp(80px, 12vw, 140px);
}

.demo-section-label {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin: 0 0 clamp(24px, 3vw, 36px);
    display: flex;
    align-items: center;
    gap: 14px;
}

.demo-section-label::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 1px;
    background: var(--phl-orange);
    flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════
   1. HERO
   ════════════════════════════════════════════════════════ */
.demo-hero {
    padding-top: clamp(40px, 6vw, 72px);
}

.demo-hero-img-wrap {
    width: 100%;
    overflow: hidden;
    background: oklch(14% 0.01 35);
}

.demo-hero-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 88vh;
    object-fit: cover;
    object-position: center 20%;
}

.demo-hero-line {
    padding: clamp(32px, 5vw, 56px) 0 0;
    text-align: center;
}

.demo-hero-text {
    font-family: "futura-pt", sans-serif;
    font-weight: 400;
    font-size: clamp(18px, 2.4vw, 23px);
    letter-spacing: -0.01em;
    line-height: 1.58;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

/* ════════════════════════════════════════════════════════
   2. AUDIO — heading + large player variant
   ════════════════════════════════════════════════════════ */
.demo-audio-heading {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 800;
    font-size: clamp(36px, 6vw, 64px);
    letter-spacing: -0.01em;
    text-transform: lowercase;
    color: var(--phl-white);
    margin: 0 0 clamp(20px, 3vw, 32px);
    line-height: 1;
}

/* Large player variant for the main listen section */
.phl-player--large {
    padding: clamp(20px, 3vw, 32px) clamp(20px, 3vw, 28px);
}

.phl-player--large .phl-player-btn {
    width: 56px;
    height: 56px;
}

.phl-player--large .phl-player-btn svg {
    width: 20px;
    height: 20px;
}

.phl-player--large .phl-player-title {
    font-size: clamp(14px, 2vw, 18px);
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.phl-player--large .phl-player-bar {
    height: 4px;
    padding: 10px 0;
    margin: -10px 0;
    background-clip: content-box;
}

/* ════════════════════════════════════════════════════════
   3. STATS — compact, single row
   ════════════════════════════════════════════════════════ */
.demo-stats {
    margin-top: clamp(32px, 4vw, 48px);
    padding: clamp(18px, 2.5vw, 26px) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 10px;
}

.demo-stat-inline {
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex-shrink: 0;
}

.demo-stat-sep {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 clamp(16px, 3vw, 32px);
    align-self: center;
    flex-shrink: 0;
}

.demo-stat-num {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 800;
    font-size: clamp(17px, 2.2vw, 22px);
    letter-spacing: -0.01em;
    color: var(--phl-white);
    line-height: 1;
}

.demo-stat-label {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 700;
    font-size: clamp(10px, 1.1vw, 12px);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1;
}

@media (max-width: 520px) {
    .demo-stat-sep { display: none; }
    .demo-stats-row { gap: 10px 24px; }
}

/* ════════════════════════════════════════════════════════
   SHARED: phl-player component
   Used in tabs, STAR BABY block, and catalog overlay.
   ════════════════════════════════════════════════════════ */
.phl-player {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: oklch(16% 0.006 35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 200ms ease;
}

.phl-player:hover {
    border-color: rgba(255, 50, 10, 0.3);
}

.phl-player.is-playing {
    border-color: rgba(255, 50, 10, 0.6);
    box-shadow: 0 0 0 1px rgba(255, 50, 10, 0.18) inset;
}

.phl-player.no-src {
    opacity: 0.45;
    pointer-events: none;
}

/* Play/pause button */
.phl-player-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--phl-orange);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 180ms ease, transform 120ms ease, box-shadow 180ms ease;
}

.phl-player-btn:hover {
    background: #ff5525;
    box-shadow: 0 0 0 4px rgba(255, 50, 10, 0.22);
    transform: scale(1.06);
}

.phl-player-btn:active {
    transform: scale(0.96);
}

.phl-player-btn svg {
    width: 16px;
    height: 16px;
    display: block;
    pointer-events: none;
}

/* Show/hide play vs pause icons */
.phl-player-btn .icon-play  { display: block; }
.phl-player-btn .icon-pause { display: none; }

.phl-player.is-playing .phl-player-btn .icon-play  { display: none; }
.phl-player.is-playing .phl-player-btn .icon-pause { display: block; }

/* Player body: title + progress */
.phl-player-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.phl-player-title {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--phl-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phl-player-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.phl-player-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
    border-radius: 0;
    /* Expand hit area for mobile without changing visual size */
    padding: 9px 0;
    margin: -9px 0;
    background-clip: content-box;
}

.phl-player-bar:hover {
    background-color: rgba(255, 255, 255, 0.15);
    background-clip: content-box;
}

.phl-player-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: var(--phl-orange);
    transition: width 0.1s linear;
    pointer-events: none;
}

.phl-player-time {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    min-width: 32px;
    text-align: right;
}

/* Compact variant: no title, just progress */
.phl-player--compact .phl-player-body {
    gap: 0;
}

.phl-player--compact .phl-player-title {
    display: none;
}

.phl-player--compact {
    padding: 10px 14px;
}

.phl-player--compact .phl-player-btn {
    width: 44px;
    height: 44px;
}

.phl-player--compact .phl-player-btn svg {
    width: 14px;
    height: 14px;
}

/* Overlay variant for catalog (button only, no body) */
.phl-player--overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.72);
    border: none;
    padding: 0;
    opacity: 0;
    transition: opacity 200ms ease;
    justify-content: center;
    align-items: center;
}

.phl-player--overlay.no-src {
    display: none;
}

.phl-player--overlay .phl-player-btn {
    width: 52px;
    height: 52px;
}

.phl-player--overlay .phl-player-btn svg {
    width: 18px;
    height: 18px;
}

/* ════════════════════════════════════════════════════════
   3. AUDIO TABS
   ════════════════════════════════════════════════════════ */
.demo-audio-section {
    margin-top: clamp(48px, 7vw, 80px);
}

.demo-tabs-nav-wrap {
    position: relative;
}

/* Fade hint on the right when tabs overflow */
.demo-tabs-nav-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 1px;
    width: 48px;
    background: linear-gradient(to right, transparent, var(--phl-black, oklch(12% 0.005 35)));
    pointer-events: none;
    opacity: 1;
    transition: opacity 200ms ease;
}

.demo-tabs-nav-wrap.is-scrolled-end::after {
    opacity: 0;
}

.demo-tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    touch-action: pan-x;
}

.demo-tabs-nav::-webkit-scrollbar {
    display: none;
}

.demo-tab-btn {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 14px 20px 12px;
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease;
    margin-bottom: -1px;
    position: relative;
    min-height: 44px;
    white-space: nowrap;
}

.demo-tab-btn:hover {
    color: rgba(255, 255, 255, 0.75);
}

.demo-tab-btn.is-active {
    color: var(--phl-white);
    border-bottom-color: var(--phl-orange);
}

.demo-tab-panels {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: none;
}

.demo-tab-panel {
    display: block;
}

.demo-tab-panel[hidden] {
    display: none;
}

/* ════════════════════════════════════════════════════════
   4. STAR BABY BLOCK
   ════════════════════════════════════════════════════════ */
.demo-starbaby {
    display: grid;
    grid-template-columns: clamp(160px, 22vw, 260px) 1fr;
    gap: clamp(28px, 4vw, 52px);
    align-items: start;
    background: oklch(14% 0.01 35);
    border: 1px solid var(--phl-orange);
    padding: clamp(24px, 3.5vw, 40px);
    box-shadow: 0 0 40px rgba(255, 50, 10, 0.1);
    position: relative;
}

.demo-starbaby::before {
    content: "★";
    position: absolute;
    top: -11px;
    left: 24px;
    background: oklch(14% 0.01 35);
    color: var(--phl-orange);
    font-size: 16px;
    line-height: 1;
    padding: 0 8px;
}

.demo-starbaby-cover {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.demo-starbaby-ep-header {
    margin-bottom: clamp(20px, 3vw, 32px);
}

.demo-starbaby-warning {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--phl-orange);
    margin: 0 0 14px;
}

.demo-starbaby-ep-title {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 800;
    font-size: clamp(30px, 4.5vw, 46px);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--phl-white);
    margin: 0 0 6px;
    line-height: 1;
}

.demo-starbaby-desc {
    font-family: "futura-pt", sans-serif;
    font-weight: 400;
    font-size: clamp(13px, 1.5vw, 15px);
    line-height: 1.68;
    color: rgba(255, 255, 255, 0.58);
    margin: 0 0 clamp(18px, 2.5vw, 26px);
    padding-bottom: clamp(18px, 2.5vw, 26px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-starbaby-ep-sub {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

.demo-starbaby-track {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 14px;
    margin-top: 14px;
}

.demo-starbaby-track-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
}

.demo-starbaby-track-title {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 700;
    font-size: clamp(13px, 1.8vw, 16px);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--phl-white);
}

.demo-starbaby-track-date {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .demo-starbaby {
        grid-template-columns: 1fr;
    }
}

/* ════════════════════════════════════════════════════════
   5. CATALOG
   ════════════════════════════════════════════════════════ */
.demo-catalog-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(14px, 2vw, 24px);
}

.demo-catalog-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.demo-catalog-cover-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: oklch(16% 0.006 35);
}

.demo-catalog-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.demo-catalog-placeholder {
    width: 100%;
    height: 100%;
    background: oklch(16% 0.006 35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: flex-end;
    padding: 10px;
    box-sizing: border-box;
}

.demo-catalog-placeholder-label {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.2);
    line-height: 1.2;
}

.demo-catalog-cover-wrap {
    text-decoration: none;
    display: block;
}

.demo-catalog-cover-wrap:hover .phl-player--overlay,
.demo-catalog-cover-wrap:focus-visible .phl-player--overlay {
    opacity: 1;
}

.demo-catalog-title-link {
    text-decoration: none;
    color: inherit;
}

.demo-catalog-title-link:hover .demo-catalog-title {
    color: var(--phl-orange);
}

.demo-catalog-title {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--phl-white);
    margin: 0;
    line-height: 1.2;
}

.demo-catalog-meta {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin: 0;
}

@media (max-width: 600px) {
    .demo-catalog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ════════════════════════════════════════════════════════
   6. VISUALS
   ════════════════════════════════════════════════════════ */

/*
   Layout for exactly 4 images:
   [ 1 (tall) ] [ 2 (square) ]
   [ 1 (tall) ] [ 3 (square) ]
   [    4 (landscape, full width)    ]
*/
.demo-visuals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: clamp(6px, 1vw, 10px);
}

.demo-visual-item {
    display: block;
    padding: 0;
    border: none;
    background: oklch(14% 0.01 35);
    cursor: zoom-in;
    overflow: hidden;
    position: relative;
}

/* item 1: portrait, spans 2 rows */
.demo-visual-item:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 3;
    aspect-ratio: unset;
}

/* items 2 & 3: square, right column */
.demo-visual-item:nth-child(2),
.demo-visual-item:nth-child(3) {
    aspect-ratio: 1 / 1;
}

/* item 4: landscape, full width */
.demo-visual-item:nth-child(4) {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 7;
}

.demo-visual-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
}

.demo-visual-item:hover img,
.demo-visual-item:focus-visible img {
    transform: scale(1.03);
    opacity: 0.88;
}

@media (max-width: 540px) {
    .demo-visuals-grid {
        grid-template-columns: 1fr;
    }
    .demo-visual-item:nth-child(1),
    .demo-visual-item:nth-child(4) {
        grid-column: 1;
        grid-row: auto;
        aspect-ratio: 4 / 3;
    }
    .demo-visual-item:nth-child(2),
    .demo-visual-item:nth-child(3) {
        aspect-ratio: 4 / 3;
    }
}

/* ════════════════════════════════════════════════════════
   7. VIDEOS
   ════════════════════════════════════════════════════════ */
.demo-videos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(16px, 3vw, 32px);
}

.demo-video-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demo-video-title {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.demo-video-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    background: oklch(14% 0.01 35);
    overflow: hidden;
}

.demo-video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.demo-video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-video-placeholder-label {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.2);
    text-align: center;
    line-height: 1.6;
}

.demo-video-placeholder-label small {
    font-size: 10px;
    letter-spacing: 0.1em;
}

@media (max-width: 600px) {
    .demo-videos-grid {
        grid-template-columns: 1fr;
    }
}

/* ════════════════════════════════════════════════════════
   8. ABOUT
   ════════════════════════════════════════════════════════ */
.demo-about-body {
    max-width: 620px;
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 2.5vw, 26px);
}

.demo-about-body p {
    font-family: "futura-pt", sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.7vw, 18px);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
}

/* ════════════════════════════════════════════════════════
   9. PRESS LINK
   ════════════════════════════════════════════════════════ */
.demo-press-foot {
    margin-top: clamp(80px, 12vw, 140px);
    padding-top: clamp(24px, 3vw, 32px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.demo-press-link {
    font-family: "futura-pt-condensed", "futura-pt", sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 180ms ease;
}

.demo-press-link:hover {
    color: var(--phl-orange);
}

/* ════════════════════════════════════════════════════════
   LIGHTBOX
   ════════════════════════════════════════════════════════ */
.demo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-lightbox[hidden] {
    display: none;
}

.demo-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.92);
    cursor: zoom-out;
}

.demo-lightbox-img-wrap {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 1100px);
    max-height: 90vh;
    display: flex;
    align-items: center;
}

.demo-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.demo-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 180ms ease, border-color 180ms ease;
}

.demo-lightbox-close:hover {
    color: var(--phl-white);
    border-color: rgba(255, 255, 255, 0.5);
}

.demo-lightbox-close svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ── Focus styles ─────────────────────────────────────── */
.demo-tab-btn:focus-visible,
.phl-player-btn:focus-visible,
.demo-visual-item:focus-visible,
.demo-lightbox-close:focus-visible {
    outline: 2px solid var(--phl-orange);
    outline-offset: 2px;
}

/* ── Reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .demo-visual-item img,
    .phl-player-btn,
    .phl-player-fill {
        transition: none;
    }
}
