/**
 * Video Showcase — the hero film + use-case gallery (#see-it)
 *
 * One player, four selectable films. Every state ends in a way to join:
 * the CTA row under the player, and an end-card that takes over the frame
 * when a film finishes.
 *
 * Depends on design-tokens.css for all colour/spacing values.
 */

/* ==========================================================================
   SECTION SHELL
   ========================================================================== */

.video-showcase {
    padding: var(--section-padding-y) 0;
    background: var(--color-background-secondary);
    position: relative;
    overflow: hidden;
}

.video-showcase::before {
    /* Soft glow anchoring the player, consistent with the hero treatment */
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    width: 900px;
    height: 900px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(34, 115, 183, 0.10) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.video-showcase-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    position: relative;
    z-index: 1;
}

.video-showcase-header {
    text-align: center;
    max-width: 780px;
    margin: 0 auto var(--space-xl);
}

.video-showcase-title {
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin: var(--space-sm) 0 var(--space-md);
    line-height: 1.15;
}

.video-showcase-subtitle {
    font-size: var(--font-size-body-lg);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ==========================================================================
   PLAYER
   ========================================================================== */

.video-showcase-stage {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-level-4), 0 0 0 1px var(--color-border);
    aspect-ratio: 16 / 9;
}

/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
    .video-showcase-stage {
        padding-top: 56.25%;
        height: 0;
    }
    .video-showcase-player {
        position: absolute;
        inset: 0;
    }
}

.video-showcase-player {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    object-fit: contain;
}

/* Big play affordance shown before first playback */
.video-showcase-poster-cta {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    border: 0;
    width: 100%;
    background: linear-gradient(180deg, rgba(10, 22, 40, 0.10) 0%, rgba(10, 22, 40, 0.55) 100%);
    color: var(--color-text);
    cursor: pointer;
    transition: background var(--transition-base, 0.25s ease);
}

.video-showcase-poster-cta:hover,
.video-showcase-poster-cta:focus-visible {
    background: linear-gradient(180deg, rgba(10, 22, 40, 0.05) 0%, rgba(10, 22, 40, 0.45) 100%);
}

.video-showcase-poster-cta[hidden] {
    display: none;
}

.video-showcase-play-icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(245, 245, 240, 0.94);
    color: var(--color-background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    padding-left: 6px; /* optical centring of the triangle */
    box-shadow: var(--shadow-level-3);
    transition: transform 0.25s ease;
}

.video-showcase-poster-cta:hover .video-showcase-play-icon {
    transform: scale(1.06);
}

.video-showcase-play-label {
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   END CARD — the conversion moment, shown when a film finishes
   ========================================================================== */

.video-showcase-endcard {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: rgba(10, 22, 40, 0.94);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.video-showcase-endcard[hidden] {
    display: none;
}

.video-showcase-endcard-title {
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin: 0;
    max-width: 20ch;
    line-height: 1.2;
}

.video-showcase-endcard-text {
    font-size: var(--font-size-body);
    color: var(--color-text-secondary);
    margin: 0;
    max-width: 46ch;
    line-height: 1.55;
}

.video-showcase-endcard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
    margin-top: var(--space-2xs);
}

/* ==========================================================================
   CTA ROW under the player
   ========================================================================== */

.video-showcase-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm) var(--space-md);
    margin-top: var(--space-lg);
}

.video-showcase-actions-note {
    flex-basis: 100%;
    text-align: center;
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
    margin: 0;
}

/* ==========================================================================
   GALLERY — the four films
   ========================================================================== */

.video-showcase-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding: 0;
    list-style: none;
}

.video-showcase-item {
    margin: 0;
}

.video-showcase-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0;
    text-align: left;
    background: var(--color-background-elevated);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    color: inherit;
    font: inherit;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.video-showcase-card:hover,
.video-showcase-card:focus-visible {
    border-color: var(--color-secondary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-level-3);
}

.video-showcase-card[aria-current="true"] {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 1px var(--color-secondary), var(--shadow-level-2);
}

.video-showcase-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--color-background);
    overflow: hidden;
}

/* Muted preview loop — the card's only visual.
   The marketing-video API serves a film and a preview clip but no still image,
   so the paused clip IS the thumbnail: video-showcase.js loads it with a #t=0.1
   media fragment so a real frame is painted, then plays it on hover or focus.
   That means it must stay visible at rest — there is no poster underneath it. */
.video-showcase-card-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.video-showcase-card-duration {
    position: absolute;
    right: var(--space-2xs);
    bottom: var(--space-2xs);
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(10, 22, 40, 0.85);
    color: var(--color-text);
    font-size: var(--font-size-micro);
    font-variant-numeric: tabular-nums;
    z-index: 1;
}

.video-showcase-card-body {
    padding: var(--space-sm) var(--space-sm) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-3xs);
    flex: 1;
}

.video-showcase-card-kicker {
    font-size: var(--font-size-micro);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-secondary-light);
    font-weight: var(--font-weight-medium);
}

.video-showcase-card-title {
    font-size: var(--font-size-h5);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin: 0;
    line-height: 1.25;
}

.video-showcase-card-text {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   INLINE "WATCH" LINKS used from other sections
   ========================================================================== */

.video-inline-cue {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-medium);
    color: var(--color-secondary-light);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.video-inline-cue:hover,
.video-inline-cue:focus-visible {
    color: var(--color-highlight);
    border-bottom-color: currentColor;
}

.video-inline-cue .fa {
    font-size: 0.9em;
}

/* A row of cues under a section header */
.content-block-cue {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm) var(--space-lg);
    margin: var(--space-sm) 0 0;
}

/* Our own price, called out against the competitor rows above it */
.pricing-competitor-price-ours {
    color: var(--color-text) !important;
    font-weight: var(--font-weight-semibold);
}

.pricing-comparison-highlight .video-inline-cue {
    margin-top: var(--space-xs);
}

/* ==========================================================================
   JOIN BAND — final conversion block
   ========================================================================== */

/* A band's heading must never be invisible.
   scroll-animations.js tags the first h2/h3 of every <section> as .section-header
   and hands it .reveal-fade-up (opacity:0), to be revealed by an IntersectionObserver
   adding .is-visible. That reveal is unreliable: verified on a preview channel, the
   existing "Seen enough? Join in about three minutes" heading sits at opacity 0 even
   after scrolling it into view, and on engine.html five of six section headings never
   revealed at all. The band then renders as body copy and a button with no title.

   0,2,0 specificity so it beats .reveal-fade-up (0,1,0). It ties .reveal-fade-up.is-visible,
   which loads later and therefore wins — but that rule also sets opacity:1, so the
   outcome is visible either way. Band body copy still animates. */
.join-band .join-band-title {
    opacity: 1;
    transform: none;
}

.join-band {
    padding: var(--space-2xl) 0;
    background: var(--color-background);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.join-band-container {
    max-width: var(--container-max-width-narrow);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.join-band-title {
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin: var(--space-sm) 0 var(--space-sm);
    line-height: 1.15;
}

.join-band-text {
    font-size: var(--font-size-body-lg);
    color: var(--color-text-secondary);
    margin: 0 auto var(--space-lg);
    max-width: 56ch;
    line-height: 1.6;
}

.join-band-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
}

.join-band-note {
    margin: var(--space-md) 0 0;
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 991px) {
    .video-showcase-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .video-showcase {
        padding: var(--section-padding-y-mobile) 0;
    }

    .video-showcase-title,
    .join-band-title {
        font-size: 1.875rem;
    }

    .video-showcase-gallery {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .video-showcase-play-icon {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }

    /* On a short player the centred play affordance lands on top of the
       browser's own control bar — lift it clear. */
    .video-showcase-poster-cta {
        padding-bottom: 44px;
        gap: var(--space-2xs);
    }

    .video-showcase-endcard-title {
        font-size: var(--font-size-h4);
    }

    .video-showcase-actions .btn,
    .video-showcase-endcard-actions .btn,
    .join-band-actions .btn {
        width: 100%;
        max-width: 320px;
    }
}

/* Users who ask for less motion keep the still frame, never a looping preview —
   video-showcase.js skips the hover binding entirely for them. */
@media (prefers-reduced-motion: reduce) {
    .video-showcase-card:hover,
    .video-showcase-card:focus-visible {
        transform: none;
    }
}
