/*
 * .gp-hero — Performance design home hero.
 *
 * 720px tall full-bleed. Background: autoplaying muted video (poster
 * fallback). Overlays in stack order:
 *   1. <video class="gp-hero__bg">
 *   2. .gp-hero__glow   — radial gold glow at 60%/50%
 *   3. .gp-hero__scrim  — bottom darkness fade for headline legibility
 *   4. .gp-hero__rail-l — vertical text column at left
 *   5. .gp-hero__rail-r — UP NEXT thumbnail rail at right
 *   6. .gp-hero__content — eyebrow + h1 + sub + CTAs at bottom-left
 *   7. .gp-hero__scroll — SCROLL cue at bottom-left edge
 */

.gp-hero {
    position: relative;
    height: 720px;
    background: #000;
    overflow: hidden;
    color: var(--gp-text);
}

/* ── background video ────────────────────────────────────────────── */
.gp-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
}

.gp-hero__glow {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(
        ellipse 70% 60% at 60% 50%,
        rgba(255, 186, 0, 0.08) 0%,
        transparent 60%
    );
    pointer-events: none;
}

.gp-hero__scrim {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
        180deg,
        transparent 40%,
        rgba(0, 0, 0, 0.95) 100%
    );
    pointer-events: none;
}

/* ── side rails (vertical text column at left) ──────────────────── */
.gp-hero__rail-l {
    position: absolute;
    left: var(--gp-page-gutter);
    top: 60px;
    bottom: 60px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--gp-font-mono);
    font-size: var(--gp-fs-meta-sm);
    letter-spacing: var(--gp-ls-meta-widest);
    text-transform: uppercase;
    color: var(--gp-text-muted);
    pointer-events: none;
}
.gp-hero__rail-l > * { pointer-events: auto; }

/* ── UP NEXT thumbnail rail at right ────────────────────────────── */
.gp-hero__rail-r {
    position: absolute;
    right: var(--gp-page-gutter);
    top: 60px;
    width: 200px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gp-hero__rail-r-label {
    font-family: var(--gp-font-mono);
    font-size: var(--gp-fs-meta-sm);
    letter-spacing: var(--gp-ls-meta-wider);
    text-transform: uppercase;
    color: var(--gp-text-muted);
    margin-bottom: 6px;
}

.gp-upnext {
    position: relative;
    border: var(--gp-border-w-strong) solid transparent;
    cursor: pointer;
    transition: border-color var(--gp-dur-base) var(--gp-ease-standard);
    display: block;
}
.gp-upnext.is-active { border-color: var(--gp-gold); }
.gp-upnext:hover     { border-color: rgba(255, 186, 0, 0.6); }

.gp-upnext__thumb {
    aspect-ratio: 16 / 9;
    background: #1a1a1a center / cover no-repeat;
    display: block;
}
.gp-upnext__caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.6);
    font-family: var(--gp-font-display);
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--gp-text);
    text-transform: uppercase;
    line-height: 1.2;
}
.gp-upnext.is-active .gp-upnext__caption { color: var(--gp-gold); }

/* ── overlay content (eyebrow + h1 + sub + CTAs) ────────────────── */
.gp-hero__content {
    position: absolute;
    left: 100px;
    bottom: 80px;
    right: 100px;
    z-index: 5;
    pointer-events: none; /* let video clicks/etc. through; children re-enable */
}
.gp-hero__content > * { pointer-events: auto; }

.gp-hero__title {
    font-family: var(--gp-font-display);
    font-size: var(--gp-fs-h1);
    font-weight: 400;
    line-height: var(--gp-lh-display);
    letter-spacing: var(--gp-ls-display-tight);
    color: var(--gp-text);
    margin: 18px 0 0;
    max-width: 1100px;
    text-transform: uppercase;
}
.gp-hero__title-tail {
    display: inline-block;
    position: relative;
}
.gp-hero__title-aside {
    position: absolute;
    right: -120px;
    top: 30px;
    writing-mode: horizontal-tb;
    font-family: var(--gp-font-mono);
    font-size: 11px;
    letter-spacing: 0.20em;
    color: var(--gp-text-dim);
    text-transform: uppercase;
}

.gp-hero__sub {
    font-family: var(--gp-font-body);
    font-size: var(--gp-fs-body);
    line-height: var(--gp-lh-body);
    color: rgba(255, 255, 255, 0.75);
    max-width: 540px;
    margin: 28px 0 0;
}

.gp-hero__cta-row {
    display: flex;
    gap: 16px;
    margin-top: 36px;
    align-items: center;
}

/* ── bottom-left scroll cue ─────────────────────────────────────── */
.gp-hero__scroll {
    position: absolute;
    left: 100px;
    bottom: 24px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--gp-font-mono);
    font-size: var(--gp-fs-meta-sm);
    letter-spacing: var(--gp-ls-meta-wider);
    text-transform: uppercase;
    color: var(--gp-text-muted);
    animation: gpHeroScrollBob 3s ease-in-out infinite;
}
.gp-hero__scroll-rule {
    display: inline-block;
    width: 30px;
    height: 1px;
    background: var(--gp-text-muted);
    align-self: center;
}
@keyframes gpHeroScrollBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(6px); }
}
@media (prefers-reduced-motion: reduce) {
    .gp-hero__scroll { animation: none; }
}

/* ── hero chip row (mute + theater) ─────────────────────────────── */
.gp-hero__chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px;
}
.gp-hero__mute,
.gp-hero__theater {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* Fixed height + minimum width so toggling label text (TAP TO
       UNMUTE ↔ MUTE) doesn't reshuffle the row. */
    height: 40px;
    min-width: 168px;
    padding: 0 16px;
    border: 0;
    cursor: pointer;
    font-family: var(--gp-font-mono);
    font-size: 12px;
    letter-spacing: var(--gp-ls-meta-wider);
    text-transform: uppercase;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
    transition: background 160ms var(--gp-ease-out), transform 160ms var(--gp-ease-out), color 160ms var(--gp-ease-out);
    z-index: 6;
    box-sizing: border-box;
}
.gp-hero__mute {
    background: var(--gp-gold);
    color: var(--gp-text-on-gold);
}
.gp-hero__theater {
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.gp-hero__theater:hover { background: rgba(0, 0, 0, 0.85); transform: translateY(-1px); }
.gp-hero__theater[aria-pressed="true"] {
    background: #fff;
    color: #000;
    border-color: #fff;
}
.gp-hero__mute:hover { background: var(--gp-gold-deep, #d99a00); transform: translateY(-1px); }
.gp-hero__mute:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.gp-hero__mute-icon { display: inline-flex; align-items: center; justify-content: center; }
.gp-hero__mute-icon--on  { display: none; }
.gp-hero__mute.is-muted .gp-hero__mute-icon--off { display: inline-flex; }
.gp-hero__mute.is-muted .gp-hero__mute-icon--on  { display: none; }
.gp-hero__mute:not(.is-muted) .gp-hero__mute-icon--off { display: none; }
.gp-hero__mute:not(.is-muted) .gp-hero__mute-icon--on  { display: inline-flex; }
.gp-hero__mute.is-muted {
    /* Pulse to draw attention while audio is off. */
    animation: gpHeroMutePulse 2.6s ease-in-out infinite;
}
@keyframes gpHeroMutePulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(255, 186, 0, 0.55); }
    50%      { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 0 0 10px rgba(255, 186, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .gp-hero__mute.is-muted { animation: none; }
}

/* ── responsive ──────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .gp-hero__title-aside { display: none; }
    .gp-hero__rail-r { width: 160px; }
}
@media (max-width: 900px) {
    .gp-hero { height: 560px; }
    .gp-hero__rail-l, .gp-hero__rail-r { display: none; }
    .gp-hero__content { left: var(--gp-page-gutter); right: var(--gp-page-gutter); bottom: 40px; }
    .gp-hero__title { font-size: 64px; }
    .gp-hero__scroll { left: var(--gp-page-gutter); }
    .gp-hero__chip-row { margin-bottom: 16px; gap: 8px; }
    .gp-hero__mute, .gp-hero__theater { height: 36px; min-width: 148px; padding: 0 12px; font-size: 11px; }
}

/* ── Theater Mode toggle on single-video pages ──────────────────── */
.gp-detail__theater-row {
    display: flex;
    justify-content: flex-end;
    margin: 12px 0 0;
    transition: opacity 240ms var(--gp-ease-out);
}
/* Plyr's controls auto-hide after inactivity → fade the Theater Mode
   chip with them. Keep pointer-events live so :hover can bring it
   back — without that, the cursor approaching the button would clear
   the hover state and the button would dodge clicks indefinitely. */
.gp-detail__theater-row.gp-controls-hidden { opacity: 0; }
.gp-detail__theater-row.gp-controls-hidden:hover,
.gp-detail__theater-row.gp-controls-hidden:focus-within { opacity: 1; }
.gp-detail__theater-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ── Theater Mode (generic, used by hero AND single video pages) ── */

/* Original v1 ambient: four solid-color panels with heavy blur. They
   live INSIDE the stage element so they share its stacking context
   (the way they did when scoped to .gp-hero). */
.gp-theater-glow {
    position: fixed;
    z-index: 9000;
    pointer-events: none;
    opacity: 0.65;
    transition: background 600ms linear;
    filter: blur(80px) saturate(1.35);
    will-change: background;
}
.gp-theater-glow--top    { top: 0;    left: 0; right: 0; height: 28vh; background: var(--gp-theater-glow-t, transparent); }
.gp-theater-glow--bottom { bottom: 0; left: 0; right: 0; height: 28vh; background: var(--gp-theater-glow-b, transparent); }
.gp-theater-glow--left   { top: 0; left: 0;   bottom: 0; width: 28vw;  background: var(--gp-theater-glow-l, transparent); }
.gp-theater-glow--right  { top: 0; right: 0;  bottom: 0; width: 28vw;  background: var(--gp-theater-glow-r, transparent); }

/* Exit + Replay buttons. Both top-right; replay sits left of the X.
   Icon-only round chips. */
.gp-theater-exit,
.gp-theater-replay {
    position: fixed;
    top: 18px;
    z-index: 10001;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 160ms var(--gp-ease-out), transform 160ms var(--gp-ease-out);
}
.gp-theater-exit   { right: 18px; }
.gp-theater-replay { right: 72px; }
.gp-theater-exit:hover,
.gp-theater-replay:hover { background: rgba(0, 0, 0, 0.9); transform: scale(1.05); }

/* Idle auto-hide: when there's been no input for a few seconds, fade
   the close + replay buttons. Stays interactive so :hover instantly
   shows them again (cursor entering the chip's hitbox = movement). */
body.gp-theater-idle .gp-theater-exit,
body.gp-theater-idle .gp-theater-replay {
    opacity: 0;
    transition: opacity 320ms var(--gp-ease-out);
}
.gp-theater-exit:hover,
.gp-theater-replay:hover {
    opacity: 1 !important;
}
.gp-theater-exit:focus-visible,
.gp-theater-replay:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* When body has .gp-theater-mode: */
/*   - hide everything except .gp-hero (animation: fade + slight zoom out) */
/*   - promote .gp-hero to a fixed full-viewport stage */
/*   - reveal ambient glow panels + exit button */
/*   - native video controls visible */
body.gp-theater-mode { overflow: hidden; background: #000; }

/* Fading: theater-mode.js walks from the stage up to <body>, marking
   every off-path sibling with .gp-theater-faded. That avoids opacity
   inheritance — ancestors of the stage stay visible. */
body.gp-theater-mode .gp-theater-faded {
    opacity: 0 !important;
    transform: scale(0.985);
    pointer-events: none;
    transition: opacity 400ms var(--gp-ease-out), transform 400ms var(--gp-ease-out);
}

/* The active stage takes over the viewport. Black background — the
   glow panels are now CHILDREN of the stage (its stacking context),
   so they paint over the stage's #000 instead of behind it. */
body.gp-theater-mode .gp-theater-stage {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10000;
    background: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
    isolation: isolate;
}
/* Bullet-proof black backdrop behind everything inside the stage — the
   stage's own `background` can be lost to descendant repaint quirks
   on some pages (notably the home hero), so paint our own layer. */
body.gp-theater-mode .gp-theater-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 0;
    pointer-events: none;
}

/* Stage decorations on the hero — hide them. */
body.gp-theater-mode .gp-hero__glow,
body.gp-theater-mode .gp-hero__scrim,
body.gp-theater-mode .gp-hero__rail-l,
body.gp-theater-mode .gp-hero__rail-r,
body.gp-theater-mode .gp-hero__scroll,
body.gp-theater-mode .gp-hero__content {
    opacity: 0;
    pointer-events: none;
    transition: opacity 320ms var(--gp-ease-out);
}

/* The element we size + center. For the hero it's the <video> itself;
   for the single-page Plyr player it's the .plyr wrapper (which owns
   both the <video> and the .plyr__controls UI). */
/* HOME hero theater — same sizing/shadow/radius as the individual
   video page so the two look identical in theater mode. */
body.gp-theater-mode .gp-hero.gp-theater-stage video.gp-theater-stage__inner {
    position: absolute !important;
    inset: 0 !important;
    margin: auto !important;
    width: min(86vw, calc((100vh - 80px) * 16 / 9)) !important;
    height: min(calc(100vh - 80px), 86vw * 9 / 16) !important;
    max-width: 1700px;
    object-fit: contain !important;
    background: #000;
    z-index: 10000;
    box-shadow: 0 0 60px 10px rgba(0, 0, 0, 0.55);
    border-radius: 8px;
}

/* INDIVIDUAL VIDEO PAGE theater — rounded corners, aspect-matched
   wrapper so the Plyr controls hug the real video width. */
body.gp-theater-mode .gp-player.gp-theater-stage .gp-theater-stage__inner,
body.gp-theater-mode .gp-player.gp-theater-stage .plyr.gp-theater-stage__inner {
    position: absolute !important;
    inset: 0 !important;
    margin: auto !important;
    aspect-ratio: var(--gp-theater-aspect, 16 / 9);
    width: auto !important;
    height: auto !important;
    max-width: min(86vw, 1700px) !important;
    max-height: calc(100vh - 80px) !important;
    background: #000;
    z-index: 10000;
    box-shadow: 0 0 60px 10px rgba(0, 0, 0, 0.55);
    /* Win over `.gp-player .plyr { border-radius: 0 !important }`
       from player-skin.css. */
    border-radius: 8px !important;
    overflow: hidden;
}
/* Specifically for raw <video>: contain instead of stretch. */
body.gp-theater-mode video.gp-theater-stage__inner {
    object-fit: contain !important;
}
/* Plyr: make sure the <video> inside fills the resized wrapper. */
body.gp-theater-mode .plyr.gp-theater-stage__inner video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}
/* Plyr's controls render inside .plyr — keep them on top of the video. */
body.gp-theater-mode .plyr.gp-theater-stage__inner .plyr__controls {
    z-index: 10003 !important;
}

/* Mobile fallback — bigger video, side glows hidden. */
@media (max-width: 900px) {
    body.gp-theater-mode .gp-hero.gp-theater-stage video.gp-theater-stage__inner {
        width: auto !important;
        height: auto !important;
        max-width: 96vw !important;
        max-height: 72vh !important;
    }
    body.gp-theater-mode .gp-player.gp-theater-stage .gp-theater-stage__inner {
        max-width: 96vw !important;
        max-height: 72vh !important;
    }
    .gp-theater-glow--top, .gp-theater-glow--bottom { height: 18vh; }
    .gp-theater-glow--left, .gp-theater-glow--right { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .gp-hero__glow-amb,
    body.gp-theater-mode #gp-main,
    body.gp-theater-mode .gp-header,
    body.gp-theater-mode .gp-footer { transition: opacity 0ms; }
}
