/* ─── Cinematic Intro Animation Overlay ──────────────────────────────────────
   intro-animation.css
   Self-contained. Does NOT touch any existing page styles.
   All animation is driven by GSAP (transform + opacity only).
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Overlay shell ────────────────────────────────────────────────────────── */
#intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    /* above page-transition (9999) */
    background: #080808;
    display: flex;
    align-items: stretch;
    justify-content: stretch;

    /* Always visible; GSAP takes over immediately on first visit;
       element is never in the DOM on subsequent visits so this is safe */
    opacity: 1;
    pointer-events: all;
    will-change: opacity;
}

/* ── 3×3 Grid ─────────────────────────────────────────────────────────────── */
#intro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    gap: 3px;
    will-change: transform, opacity;
}

/* ── Individual tile ──────────────────────────────────────────────────────── */
.intro-tile {
    position: relative;
    overflow: hidden;
    background: #111111;
    will-change: transform, opacity;
}

/* ── Image inside tile ────────────────────────────────────────────────────── */
.intro-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    /* slight initial scale removed by CSS — GSAP handles all scale/position */
}

/* ── Center tile — text ─────────────────────────────────────────────────────
   Grid center = row 2, col 2 → index 5 → .intro-tile:nth-child(5)
   ─────────────────────────────────────────────────────────────────────────── */
.intro-tile--center {
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.4em;
}

/* Dark vignette overlay on image tiles */
.intro-tile:not(.intro-tile--center)::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.25) 0%,
            rgba(0, 0, 0, 0.05) 50%,
            rgba(0, 0, 0, 0.30) 100%);
    pointer-events: none;
}

/* ── Center tile text ─────────────────────────────────────────────────────── */
.intro-center-title {
    font-family: 'Clash Display', 'Arial Black', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 4.5vw, 3.5rem);
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
    user-select: none;
}

.intro-center-title span {
    color: #ff2020;
}

.intro-center-sub {
    font-family: 'Clash Display', 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.58rem, 1.1vw, 0.9rem);
    color: rgba(255, 255, 255, 0.38);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    user-select: none;
}

/* ── Thin decorative border on center tile ────────────────────────────────── */
.intro-tile--center::before {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE  ≤ 767px  —  2×2 pure-image grid + floating brand text
   Desktop layout is completely untouched above this block.
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    /* 2×2 grid — all 4 tiles are images, no embedded text cell */
    #intro-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 2px;
    }

    /* Safety: hide any stray desktop-only tiles */
    #intro-grid .intro-tile:nth-child(n+5) {
        display: none;
    }
}

/* ── Floating brand text — mobile only ───────────────────────────────────────
   Absolutely centered over the overlay, above the grid.
   GSAP drives opacity; starts hidden.
   ─────────────────────────────────────────────────────────────────────────── */
.intro-mobile-brand {
    display: none;
    /* hidden on desktop — JS only creates it on mobile */
}

@media (max-width: 767px) {
    .intro-mobile-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.45em;

        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 2;
        /* above the image grid */

        pointer-events: none;
        opacity: 0;
        /* GSAP animates this in */
        will-change: opacity, transform;

        /* Soft dark halo so text reads against any image */
        text-shadow:
            0 2px 32px rgba(0, 0, 0, 0.85),
            0 0 80px rgba(0, 0, 0, 0.55);
    }

    .intro-mobile-brand .intro-center-title {
        font-family: 'Clash Display', 'Arial Black', sans-serif;
        font-weight: 700;
        font-size: clamp(2rem, 9.5vw, 3.2rem);
        color: #ffffff;
        letter-spacing: -0.02em;
        line-height: 1;
        white-space: nowrap;
        user-select: none;
    }

    .intro-mobile-brand .intro-center-title span {
        color: #ff2020;
    }

    .intro-mobile-brand .intro-center-sub {
        font-family: 'Clash Display', 'Inter', sans-serif;
        font-weight: 400;
        font-size: clamp(0.6rem, 3vw, 0.9rem);
        color: rgba(255, 255, 255, 0.55);
        letter-spacing: 0.26em;
        text-transform: uppercase;
        user-select: none;
    }
}

/* ── Image preload wait indicator ─────────────────────────────────────────────
   Injected by JS into the overlay while waiting for images to load.
   Removed automatically before the GSAP timeline begins.
   ─────────────────────────────────────────────────────────────────────────── */
.intro-loader {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.intro-loader span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 32, 32, 0.75);
    animation: intro-dot-pulse 0.85s ease-in-out infinite;
}

.intro-loader span:nth-child(2) {
    animation-delay: 0.17s;
}

.intro-loader span:nth-child(3) {
    animation-delay: 0.34s;
}

@keyframes intro-dot-pulse {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(0.75);
    }

    50% {
        opacity: 1;
        transform: scale(1.25);
    }
}