/*
 * Homepage-only styles.
 * Stage 1 covers the cinematic hero section only. Additional homepage
 * sections will bring their own scoped rules here in later stages.
 *
 * IMPORTANT — progressive enhancement rule for this whole file:
 * no element that carries real content may ever have a permanent
 * `opacity: 0` in its base (un-animated) rule. Entrance animations are
 * added ONLY inside `@media (prefers-reduced-motion: no-preference)`
 * blocks, using `animation-fill-mode: both` so the very first (0%)
 * keyframe briefly supplies the "before" state. Everywhere else —
 * reduced motion, unsupported browsers, or if a rule is ever mistyped —
 * the element falls back to its plain, fully visible default. This is
 * also what fixes the Stage 1 bug where hero content was invisible (see
 * the diagnosis note in the project completion report).
 */

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
    padding-block: calc(var(--header-height) + 1rem) 2rem;

    /* Bright, energetic base — visible immediately, no media required. */
    background-color: var(--surface-soft);
    background-image:
        radial-gradient(ellipse 60% 50% at 85% 8%, rgba(255, 181, 46, 0.22), transparent 60%),
        radial-gradient(ellipse 70% 60% at 8% 95%, rgba(36, 107, 206, 0.16), transparent 60%),
        linear-gradient(180deg, var(--surface-warm) 0%, var(--surface-soft) 45%, var(--surface-main) 100%);
}

.hero__grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 48fr) minmax(0, 52fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
    width: 100%;
    max-width: 1320px;
}

/* ==========================================================================
   Content column
   ========================================================================== */

.hero__eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-blue-hover);
    margin-bottom: 0.75rem;
}

.hero__heading {
    /* No max-width here on purpose — the two lines are controlled by the
       explicit <br> in the markup, sized to fit the grid column at this
       font size. A char-based max-width previously forced each of those
       two lines to wrap again internally, which is what made the heading
       block unnecessarily tall. Let it fill the column naturally instead. */
    font-size: clamp(2rem, 3vw, 2.75rem);
    line-height: 1.12;
    color: var(--text-primary);
}

.hero__heading-highlight {
    color: var(--brand-primary);
}

.hero__subtext {
    margin-top: 1rem;
    max-width: 46ch;
    font-size: clamp(1rem, 1.4vw, 1.1rem);
    color: var(--text-secondary);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.hero__microline {
    margin-top: 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.hero__trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-soft);
}

.hero__trust-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.hero__trust-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--brand-primary);
}

/* ==========================================================================
   Visual column — framed media area with CSS/SVG fallback composition
   ========================================================================== */

.hero__visual {
    width: 100%;
}

.hero__media-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: calc(var(--border-radius) * 2);
    overflow: hidden;
    border: 1px solid var(--border-soft);
    box-shadow: 0 28px 56px -18px rgba(16, 36, 62, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    background-color: var(--surface-main);
}

/* Intentional CSS/SVG fallback composition. Sits underneath the media
   layer at all times, so if the video/poster files are absent or fail to
   load, this remains fully visible instead of a blank or broken box. */
.hero__fallback {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        /* faint crosshatch — an abstract nod to a practice net/ground,
           deliberately understated so it reads as texture, not imagery */
        repeating-linear-gradient(45deg, rgba(16, 36, 62, 0.05) 0 1px, transparent 1px 24px),
        repeating-linear-gradient(-45deg, rgba(16, 36, 62, 0.05) 0 1px, transparent 1px 24px),
        radial-gradient(ellipse 45% 35% at 88% 92%, rgba(58, 155, 103, 0.16), transparent 70%),
        radial-gradient(ellipse 75% 60% at 80% 4%, rgba(255, 181, 46, 0.4), transparent 60%),
        radial-gradient(ellipse 75% 65% at 8% 102%, rgba(36, 107, 206, 0.34), transparent 65%),
        linear-gradient(160deg, var(--brand-sky) 0%, var(--surface-main) 55%, var(--surface-warm) 100%);
}

.hero__fallback-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
}

.hero__fallback-blob--blue {
    width: 64%;
    aspect-ratio: 1 / 1;
    left: -18%;
    bottom: -16%;
    background: radial-gradient(circle at 35% 35%, rgba(36, 107, 206, 0.38), rgba(36, 107, 206, 0) 70%);
}

.hero__fallback-blob--warm {
    width: 48%;
    aspect-ratio: 1 / 1;
    right: -12%;
    top: -10%;
    background: radial-gradient(circle at 60% 40%, rgba(255, 181, 46, 0.46), rgba(255, 181, 46, 0) 70%);
}

.hero__fallback-blob--green {
    width: 30%;
    aspect-ratio: 1 / 1;
    right: 6%;
    bottom: -8%;
    background: radial-gradient(circle at 50% 50%, rgba(58, 155, 103, 0.32), rgba(58, 155, 103, 0) 70%);
}

.hero__fallback-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: var(--brand-blue);
    opacity: 0.35;
}

.hero__fallback-lines .hero__fallback-trajectory {
    color: var(--brand-primary);
    opacity: 1;
}

.hero__fallback-label {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(16, 36, 62, 0.1);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-primary);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.hero__fallback-label--1 {
    top: 8%;
    left: 8%;
}

.hero__fallback-label--2 {
    bottom: 9%;
    right: 8%;
}

.hero__fallback-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 70%;
    text-align: center;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(16, 36, 62, 0.08);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* Decorative inner frame — sits above the media layer too, so it still
   reads as a refined "picture frame" once real video/poster is in place. */
.hero__frame-accent {
    position: absolute;
    inset: 3%;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: calc(var(--border-radius) * 1.5);
    pointer-events: none;
}

.hero__media {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero__video,
.hero__poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ==========================================================================
   Scroll indicator
   ========================================================================== */

.hero__scroll-indicator {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.hero__scroll-indicator svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Entrance animation (progressive enhancement only — see file header note)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    .hero__eyebrow    { animation: hero-rise 650ms cubic-bezier(0.4, 0, 0.2, 1)  80ms both; }
    .hero__heading    { animation: hero-rise 700ms cubic-bezier(0.4, 0, 0.2, 1) 160ms both; }
    .hero__subtext    { animation: hero-rise 700ms cubic-bezier(0.4, 0, 0.2, 1) 240ms both; }
    .hero__actions    { animation: hero-rise 700ms cubic-bezier(0.4, 0, 0.2, 1) 320ms both; }
    .hero__microline  { animation: hero-rise 700ms cubic-bezier(0.4, 0, 0.2, 1) 380ms both; }
    .hero__trust      { animation: hero-rise 700ms cubic-bezier(0.4, 0, 0.2, 1) 440ms both; }
    .hero__visual     { animation: hero-rise 750ms cubic-bezier(0.4, 0, 0.2, 1) 200ms both; }

    .hero__video {
        transform: scale(1.02);
        animation: hero-media-settle 8s ease-out forwards;
    }

    .hero__fallback-blob--blue {
        animation: hero-blob-float 9s ease-in-out infinite;
    }

    .hero__fallback-blob--warm {
        animation: hero-blob-float 11s ease-in-out infinite reverse;
    }

    .hero__fallback-blob--green {
        animation: hero-blob-float 13s ease-in-out infinite;
    }

    .hero__scroll-indicator svg {
        animation: hero-scroll-bob 2.2s ease-in-out infinite;
    }
}

@keyframes hero-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hero-media-settle {
    from { transform: scale(1.06); }
    to { transform: scale(1.02); }
}

@keyframes hero-blob-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3%) scale(1.04); }
}

@keyframes hero-scroll-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* ==========================================================================
   Desktop height containment
   ========================================================================== */

/*
 * Root cause of the desktop overflow this block fixes: `.hero` only had a
 * `min-height` (100vh/100svh), which is a FLOOR, not a ceiling — it never
 * stops the box from growing taller than the viewport. The actual height
 * was being driven by `.hero__media-frame`'s `aspect-ratio: 4/5`, which is
 * derived from the panel's WIDTH, not the viewport's height. On common
 * laptop screens the 52%-wide visual column produced a panel taller than
 * the space actually available below the fixed header, so the hero grew
 * past the viewport and the bottom of the panel (including the
 * "MULTI-SPORT TRAINING" label) ended up below the fold.
 *
 * Fix, desktop/large-tablet only (mobile keeps its existing aspect-ratio
 * based sizing untouched below): give `.hero` a real, capped height
 * (`100dvh`, falling back to `100vh`), then let the grid row and the
 * visual column stretch to fill exactly that height, dropping the fixed
 * aspect-ratio in favour of `height: 100%` plus a sensible max/min-height
 * on the media frame itself. Real video/poster media still uses
 * `object-fit: cover` inside this frame, so it will fill whatever height
 * this produces without ever growing the panel taller.
 */
@media (min-width: 901px) {
    .hero {
        min-height: 0;
        height: 100vh;
        height: 100dvh;
    }

    .hero__grid {
        height: 100%;
        grid-template-rows: minmax(0, 1fr);
    }

    .hero__visual {
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero__media-frame {
        aspect-ratio: auto;
        width: 100%;
        height: 100%;
        max-height: 620px;
        min-height: 380px;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .hero {
        min-height: auto;
        align-items: flex-start;
        padding-block: calc(var(--header-height) + 1rem) 2rem;
    }

    .hero__grid {
        grid-template-columns: 1fr;
    }

    .hero__visual {
        margin-top: 2.5rem;
    }

    .hero__media-frame {
        aspect-ratio: 16 / 10;
    }

    .hero__scroll-indicator {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero__media-frame {
        aspect-ratio: 4 / 3;
    }

    .hero__trust {
        gap: 0.6rem 1.25rem;
    }
}

/* Reduced motion: nothing above depends on it, but make sure any residual
   motion (e.g. smooth scroll snapping to this section) stays calm. */
@media (prefers-reduced-motion: reduce) {
    .hero__video {
        transform: none;
    }
}
