/* ============================================================
   HERO.CSS — Still Gallery Mosaic Hero (FIXED)
   Requires: DM Serif Display added to Google Fonts link
   Add: family=DM+Serif+Display:ital@0;1
   ============================================================ */

.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);        /* subtract fixed nav height */
    max-height: 780px;                  /* 880 - 100 nav */
    min-height: 540px;                  /* 640 - 100 nav */
    margin-top: 100px;                  /* clear the fixed nav */
    overflow: hidden;
    background-color: #0B1228;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
    background-size: 80px 80px;
    z-index: 1;
    pointer-events: none;
}

@media (min-width: 1024px) {
    .hero {
        flex-direction: row;
    }

    /* ── Expandable panels with transitions ── */
    .hero-left {
        flex: 0.9;
        transition: flex .6s cubic-bezier(.25, .46, .45, .94);
    }

    .hero-gallery {
        flex: 1.35;                      /* starts wider — gallery gets more space */
        transition: flex .6s cubic-bezier(.25, .46, .45, .94);
    }

    /* Hover left → left grows slightly, right barely shrinks */
    .hero-left:hover {
        flex: 1.05;
    }
    .hero-left:hover ~ .hero-gallery {
        flex: 1.35;
    }

    /* Hover right → right grows, left shrinks */
    .hero-gallery:hover {
        flex: 1.35;
    }
    .hero:has(.hero-gallery:hover) .hero-left {
        flex: 0.85;
    }
}

/* Corner accents */
.hero-corner {
    position: absolute;
    width: 50px; height: 50px;
    z-index: 6;
    pointer-events: none;
    opacity: .08;
}
.hero-corner--tl { top: 1.5rem; left: 1.5rem; border-top: 1px solid #fff; border-left: 1px solid #fff; }
.hero-corner--br { bottom: 1.5rem; right: 1.5rem; border-bottom: 1px solid #fff; border-right: 1px solid #fff; }

/* ═══════════════════════════════════════════════
   LEFT — CONTENT
   ═══════════════════════════════════════════════ */
.hero-left {
    display: flex;
    align-items: center;
    padding: 40px 2rem 40px;
    position: relative;
    z-index: 5;
}

@media (min-width: 1024px) {
    .hero-left {
        padding: 40px 1.25rem 40px;
        padding-left: clamp(2.5rem, 5vw, 5rem);
    }
}

.hero-content { max-width: 580px; }

/* Staggered entrance */
.hero-content > * {
    opacity: 0;
    transform: translateY(24px);
    animation: heroFadeIn .8s cubic-bezier(.22,.61,.36,1) forwards;
}
.hero-content > *:nth-child(1) { animation-delay: .1s; }
.hero-content > *:nth-child(2) { animation-delay: .25s; }
.hero-content > *:nth-child(3) { animation-delay: .4s; }
.hero-content > *:nth-child(4) { animation-delay: .55s; }
.hero-content > *:nth-child(5) { animation-delay: .7s; }
.hero-content > *:nth-child(6) { animation-delay: .85s; }

@keyframes heroFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.hero-tag {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: .68rem; font-weight: 700;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 2.5rem;
}
.hero-tag::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 1.75rem; height: 1px;
    background: var(--accent);
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(3rem, 5.5vw, 5.2rem);
    line-height: .92;
    color: #fff;
    margin-bottom: 1.5rem;
    letter-spacing: .03em;
}
.hero-content h1 em {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    color: var(--accent);
    letter-spacing: -.01em;
}

.hero-desc {
    font-family: var(--font-ui);
    font-size: .95rem; line-height: 1.7;
    color: rgba(255,255,255,.4);
    max-width: 480px;
    margin-bottom: 2rem;
    font-weight: 500;
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.hero-stats { display: flex; align-items: center; gap: 0; }

.hero-stat {
    display: flex; flex-direction: column;
    padding: 0 1.5rem;
    border-right: 1px solid rgba(255,255,255,.06);
}
.hero-stat:first-child { padding-left: 0; }
.hero-stat:last-child { border-right: none; }

.hero-stat-num {
    font-family: 'DM Serif Display', serif;
    font-size: 1.75rem; line-height: 1;
    color: #fff; letter-spacing: -.02em;
}
.hero-stat-label {
    font-family: var(--font-ui);
    font-size: .6rem; font-weight: 600;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: rgba(255,255,255,.2);
    margin-top: .3rem;
}

/* ═══════════════════════════════════════════════
   RIGHT — STILL IMAGE MOSAIC
   ═══════════════════════════════════════════════ */
.hero-gallery {
    display: none;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

@media (min-width: 1024px) {
    .hero-gallery {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 8px;
        padding: 2.5rem 2rem 2.5rem 0;
    }
}

/* ── Gallery items ── */
.hero-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: .2rem;
}

.hero-gallery-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.25,.46,.45,.94);
}

.hero-gallery-item:hover img {
    transform: scale(1.03);
}

/* Grid placement */
.hero-gallery-item:nth-child(1) { grid-column: 1 / 3; grid-row: 1 / 2; }
.hero-gallery-item:nth-child(2) { grid-column: 3 / 4; grid-row: 1 / 2; }
.hero-gallery-item:nth-child(3) { grid-column: 1 / 2; grid-row: 2 / 3; }
.hero-gallery-item:nth-child(4) { grid-column: 2 / 4; grid-row: 2 / 3; }

/* Featured badge */
.hero-gallery-item:nth-child(1)::after {
    content: '✦  FEATURED BUILD';
    position: absolute;
    top: 1rem; left: 1rem;
    z-index: 4;
    background: var(--accent);
    color: #fff;
    padding: .35rem .9rem;
    border-radius: .15rem;
    font-family: var(--font-ui);
    font-size: .62rem; font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    box-shadow: 0 4px 16px rgba(222,37,67,.35);
}

/* ── Captions ── */
.gallery-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 1rem 1.15rem .85rem;
    background: linear-gradient(to top,
        rgba(11,18,40,.8),
        rgba(11,18,40,.35) 60%,
        transparent
    );
    z-index: 3;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .4s ease, transform .4s ease;
}

.hero-gallery-item:hover .gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

.gallery-caption h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: #fff;
    letter-spacing: .04em;
    margin-bottom: .15rem;
}

.gallery-caption span {
    font-family: var(--font-ui);
    font-size: .7rem; font-weight: 600;
    color: rgba(255,255,255,.5);
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* Featured caption always visible */
.hero-gallery-item:nth-child(1) .gallery-caption {
    padding: 1.25rem 1.5rem 1rem;
    opacity: 1;
    transform: translateY(0);
}

.hero-gallery-item:nth-child(1) .gallery-caption h3 {
    font-size: 1.4rem;
}

/* ═══════════════════════════════════════════════
   SCROLL INDICATOR
   ═══════════════════════════════════════════════ */
.scroll-indicator {
    position: absolute;
    bottom: 2rem; left: 50%; transform: translateX(-50%);
    text-align: center;
    font-family: var(--font-ui);
    font-size: .6rem; font-weight: 700;
    letter-spacing: .25em;
    color: rgba(255,255,255,.15);
    z-index: 10;
    opacity: 0;
    animation: heroFadeIn .8s cubic-bezier(.22,.61,.36,1) 1.2s forwards;
}
.scroll-line {
    width: 1px; height: 28px; margin: 8px auto 0;
    background: linear-gradient(to bottom, rgba(255,255,255,.2), transparent);
    animation: scrollPulse 2.5s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes scrollPulse {
    0%, 100% { opacity: .2; transform: scaleY(1); }
    50%      { opacity: .7; transform: scaleY(1.4); }
}

/* ═══════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════ */
@media (max-width: 1023px) {
    .hero { height: auto; min-height: calc(100vh - 100px); max-height: none; }
    .hero-left {
        text-align: center;
        justify-content: center;
        padding: 60px 1.5rem 80px;
    }
    .hero-content { margin: 0 auto; }
    .hero-tag { padding-left: 0; }
    .hero-tag::before { display: none; }
    .hero-desc { margin-left: auto; margin-right: auto; }
    .buttons { justify-content: center; }
    .hero-stats { justify-content: center; }
    .hero-corner { display: none; }

    .hero-mobile-bg {
        position: absolute; inset: 0; z-index: 0; overflow: hidden;
    }
    .hero-mobile-bg img {
        width: 100%; height: 100%; object-fit: cover;
        opacity: .1; filter: saturate(.4) contrast(1.1);
    }
    .hero-left { z-index: 2; }
}

@media (min-width: 1024px) {
    .hero-mobile-bg { display: none; }
}

@media (max-width: 480px) {
    .hero-stats { flex-wrap: wrap; justify-content: center; gap: .5rem; }
    .hero-stat {
        padding: .6rem 1.25rem; border-right: none;
        border-bottom: 1px solid rgba(255,255,255,.04);
        align-items: center; flex-direction: row; gap: .75rem;
    }
    .hero-stat:last-child { border-bottom: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-content > * { animation: none; opacity: 1; transform: none; }
    .scroll-line { animation: none; }
}