/* =============================================================
   GALLERY PAGE — gallery.css
   Brand colors: #d4af37 (gold) · #ff2fa6 (magenta) · #0e0e10 (dark)
   ============================================================= */

/* ─── Custom props ─────────────────────────────────────────── */
:root {
    --gl-gold: #d4af37;
    --gl-pink: #ff2fa6;
    --gl-dark: #0e0e10;
    --gl-dark2: #131317;
    --gl-white: #ffffff;
    --gl-white80: rgba(255, 255, 255, 0.80);
    --gl-white50: rgba(255, 255, 255, 0.50);
    --gl-white20: rgba(255, 255, 255, 0.20);
}


/* ════════════════════════════════════════════════════════════
   1. GALLERY HERO
   ════════════════════════════════════════════════════════════ */

.gl-hero {
    position: relative;
    min-height: 58vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--gl-dark);
    isolation: isolate;
}

/* Background image */
.gl-hero__bg {
    position: absolute;
    inset: -6%;
    background-image: url('/assets/img/gallery/gallery-hero.jpg');
    background-size: cover;
    background-position: center 30%;
    transform: scale(1.06);
    animation: glHeroFloat 18s ease-in-out infinite;
    z-index: 1;
}

/* Dark cinematic overlay */
.gl-hero__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom,
            rgba(14, 14, 16, 0.70) 0%,
            rgba(14, 14, 16, 0.45) 40%,
            rgba(14, 14, 16, 0.92) 100%),
        radial-gradient(ellipse at 60% 40%, rgba(255, 47, 166, 0.14) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 70%, rgba(212, 175, 55, 0.10) 0%, transparent 55%);
    z-index: 2;
}

/* Film-grain texture */
.gl-hero__grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 3;
    pointer-events: none;
}

.gl-hero .container {
    position: relative;
    z-index: 4;
}

.gl-hero__content {
    padding: clamp(130px, 18vh, 210px) 0 clamp(64px, 10vh, 110px);
    max-width: 780px;
    animation: glHeroReveal 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gl-hero__eyebrow {
    display: inline-block;
    font-size: clamp(12px, 1.1vw, 15px);
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--gl-gold);
    margin-bottom: 16px;
    opacity: 0.9;
}

.gl-hero__title {
    /* font-size: clamp(34px, 4.9vw, 64px); */
    font-weight: 700;
    line-height: 1.08;
    color: var(--gl-white);
    margin: 0 0 14px;
    text-shadow: 0 6px 30px rgba(0, 0, 0, 0.55), 0 0 24px rgba(255, 47, 166, 0.12);
}

.gl-hero__sub {
    color: var(--gl-white80);
    font-size: clamp(15px, 1.3vw, 18px);
    line-height: 1.7;
    margin: 0 0 28px;
    max-width: 560px;
}

/* Breadcrumb */
.gl-hero__crumb {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gl-white50);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.gl-hero__crumb-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--gl-white50);
    text-decoration: none;
    transition: color 0.25s;
}

.gl-hero__crumb-link:hover {
    color: var(--gl-gold);
}

.gl-hero__crumb-sep {
    color: var(--gl-pink);
}

.gl-hero__crumb-current {
    color: var(--gl-white80);
}

/* Scroll cue */
.gl-hero__scroll-cue {
    position: absolute;
    bottom: clamp(22px, 4vh, 40px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: glScrollCuePulse 2.4s ease-in-out infinite;
}

.gl-hero__scroll-text {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gl-white50);
}

.gl-hero__scroll-line {
    width: 1px;
    height: 38px;
    border-radius: 999px;
    background: linear-gradient(to bottom, var(--gl-pink), var(--gl-gold), transparent);
}

/* Hero animations */
@keyframes glHeroFloat {

    0%,
    100% {
        transform: scale(1.06) translate(0, 0);
    }

    50% {
        transform: scale(1.09) translate(0, -14px);
    }
}

@keyframes glHeroReveal {
    from {
        opacity: 0;
        transform: translateY(32px);
    }

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

@keyframes glScrollCuePulse {

    0%,
    100% {
        opacity: 0.7;
        transform: translateX(-50%) translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(6px);
    }
}

/* Hero responsive */
@media(max-width:991px) {
    .gl-hero__title {
        font-size: clamp(30px, 7vw, 50px);
        line-height: 1.1;
    }
}

@media(max-width:767px) {
    .gl-hero__title {
        font-size: clamp(28px, 9.6vw, 42px);
        line-height: 1.12;
    }

    .gl-hero__sub {
        font-size: 15px;
    }
}

@media(max-width:480px) {
    .gl-hero__title {
        font-size: clamp(24px, 10.5vw, 34px);
        line-height: 1.14;
    }
}

@media(prefers-reduced-motion: reduce) {

    .gl-hero__bg,
    .gl-hero__content,
    .gl-hero__scroll-cue {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}


/* ════════════════════════════════════════════════════════════
   2. SCROLL STACK GALLERY
   ════════════════════════════════════════════════════════════ */

.gl-stack-section {
    position: relative;
    height: var(--gl-stack-scroll-height, 1040vh);
    background:
        radial-gradient(ellipse 120% 120% at 50% 0%, rgba(255, 47, 166, 0.12) 0%, transparent 52%),
        radial-gradient(ellipse 90% 90% at 50% 100%, rgba(212, 175, 55, 0.10) 0%, transparent 58%),
        var(--gl-dark);
}

/* The sticky viewport container */
.gl-stack__sticky {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--gl-dark);
    perspective: 1400px;
    perspective-origin: center center;
}

/* Ambient radial glow behind cards */
.gl-stack__ambient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 50% 50%, rgba(255, 47, 166, 0.14) 0%, transparent 70%),
        radial-gradient(ellipse 52% 40% at 50% 82%, rgba(212, 175, 55, 0.12) 0%, transparent 62%);
    pointer-events: none;
    z-index: 0;
    animation: glAmbientShift 7s ease-in-out infinite alternate;
}

@keyframes glAmbientShift {
    from {
        opacity: 0.74;
    }

    to {
        opacity: 1;
    }
}

/* Cards container */
.gl-stack__cards {
    position: absolute;
    inset: 0;
    z-index: 1;
    transform-style: preserve-3d;
}

/* Individual card */
.gl-stack__card {
    position: absolute;
    left: 50%;
    top: 58%;
    width: min(78vw, 980px);
    aspect-ratio: 16 / 10;
    max-height: 68vh;
    will-change: transform, opacity, filter;
    transform-origin: center center;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    overflow: hidden;
    background: #101015;
    box-shadow:
        0 30px 76px rgba(0, 0, 0, 0.58),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.gl-stack__card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.14), transparent 40%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 38%);
    mix-blend-mode: screen;
}

/* Card image */
.gl-stack__card-img-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 24%, rgba(43, 58, 112, 0.38) 0%, rgba(8, 11, 24, 0.92) 62%),
        #05070f;
}

.gl-stack__card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    user-select: none;
    transition: transform 0.1s;
}

.gl-stack__card-img--bg {
    object-fit: cover;
    object-position: center;
    transform: scale(1.14);
    filter: blur(18px) brightness(0.48) saturate(0.82);
    opacity: 0.9;
}

.gl-stack__card-img--main {
    object-fit: contain;
    object-position: center center;
    transform: scale(0.985);
    z-index: 1;
}

/* Cinematic vignette */
.gl-stack__card-vignette {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom,
            rgba(14, 14, 16, 0.04) 0%,
            rgba(14, 14, 16, 0.02) 30%,
            rgba(14, 14, 16, 0.08) 64%,
            rgba(14, 14, 16, 0.54) 100%),
        radial-gradient(ellipse at center, transparent 62%, rgba(14, 14, 16, 0.34) 100%);
    pointer-events: none;
    z-index: 3;
}

/* Card caption - bottom left */
.gl-stack__card-caption {
    position: absolute;
    bottom: clamp(16px, 2.2vw, 28px);
    left: clamp(16px, 2.2vw, 28px);
    right: clamp(16px, 2.2vw, 28px);
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gl-stack__card-num {
    font-size: clamp(40px, 5.1vw, 74px);
    font-weight: 800;
    line-height: 1;
    color: rgba(255, 255, 255, 0.1);
    letter-spacing: -0.04em;
    display: block;
    margin-bottom: -12px;
    font-family: 'Georgia', serif;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.gl-stack__card-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gl-stack__card-label {
    font-size: clamp(11px, 1vw, 14px);
    letter-spacing: 0.26em;
    text-transform: uppercase;
    font-weight: 600;
}

.gl-stack__card-title {
    font-size: clamp(24px, 3.2vw, 48px);
    font-weight: 700;
    color: var(--gl-white);
    margin: 0;
    line-height: 1.14;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.52);
}

.gl-stack__card-bar {
    width: 48px;
    height: 3px;
    border-radius: 999px;
    margin-top: 10px;
}

/* HUD - right side */
.gl-stack__hud {
    position: absolute;
    right: clamp(18px, 3vw, 54px);
    bottom: clamp(22px, 4vh, 44px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
}

.gl-stack__counter {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: var(--gl-white);
    font-size: clamp(13px, 1.2vw, 16px);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.gl-stack__counter-sep {
    color: var(--gl-white20);
    font-size: 0.8em;
}

.gl-stack__counter-total {
    color: var(--gl-white50);
    font-size: 0.8em;
}

.gl-stack__progress-track {
    width: clamp(60px, 7vw, 100px);
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    overflow: hidden;
}

.gl-stack__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gl-pink), var(--gl-gold));
    border-radius: 999px;
    transform: scaleX(0);
    transform-origin: left;
    will-change: transform;
}

.gl-stack__hud-hint {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gl-white50);
    display: flex;
    align-items: center;
    gap: 6px;
}

.gl-stack__hud-hint i {
    font-size: 10px;
    animation: glHudBounce 1.8s ease-in-out infinite;
}

@keyframes glHudBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(4px);
    }
}

/* Section label - top left watermark */
.gl-stack__section-label {
    position: absolute;
    top: clamp(86px, 11vh, 124px);
    left: clamp(20px, 4vw, 72px);
    z-index: 10;
    font-size: 11px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--gl-white20);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}



/* Stack responsive */
@media(max-width: 1024px) and (min-width: 769px) {
    .gl-stack__card {
        width: min(88vw, 860px);
        max-height: 72vh;
        top: 38%;
    }
}

@media(max-width: 768px) {
    .gl-stack__card {
        width: 90vw;
        aspect-ratio: 4 / 5;
        border-radius: 18px;
        max-height: 68vh;
        top: 52%;
    }

    .gl-stack__card-title {
        font-size: clamp(22px, 7vw, 38px);
    }

    .gl-stack__card-num {
        font-size: clamp(40px, 10vw, 68px);
    }

    .gl-stack__section-label {
        display: none;
    }

    .gl-stack__hud-hint {
        display: none;
    }
}

@media(max-width: 480px) {
    .gl-stack__card-caption {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .gl-stack__hud {
        right: 16px;
        bottom: 18px;
    }
}

@media(prefers-reduced-motion: reduce) {
    .gl-stack__sticky {
        overflow: visible;
    }
}


/* ════════════════════════════════════════════════════════════
   3. GALLERY GRID SECTION
   ════════════════════════════════════════════════════════════ */

.gl-grid-section {
    background: var(--gl-dark2);
    padding: clamp(38px, 5.5vh, 74px) 0 clamp(76px, 11vh, 150px);
    position: relative;
    overflow: hidden;
}

/* Decorative top gradient divider */
.gl-grid-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gl-pink) 30%, var(--gl-gold) 70%, transparent);
    opacity: 0.5;
}

/* Section heading */
.gl-grid-section__head {
    text-align: center;
    margin-bottom: clamp(40px, 6vh, 72px);
}

.gl-grid-section__eyebrow {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gl-gold);
    margin-bottom: 12px;
}

.gl-grid-section__title {
    /* font-size: clamp(30px, 4vw, 52px); */
    font-weight: 700;
    color: var(--gl-white);
    margin: 0 0 16px;
    line-height: 1.14;
}

.gl-grid-section__divider {
    width: 52px;
    height: 3px;
    background: linear-gradient(90deg, var(--gl-pink), var(--gl-gold));
    border-radius: 999px;
    margin: 0 auto 18px;
}

.gl-grid-section__desc {
    color: var(--gl-white50);
    font-size: clamp(15px, 1.25vw, 17px);
    line-height: 1.75;
    max-width: 620px;
    margin: 0 auto;
}

/* Masonry grid — CSS Grid with dense fill */
.gl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 260px;
    grid-auto-flow: dense;
    gap: 16px;
}

/* Size variants */
.gl-grid__item--large {
    grid-column: span 2;
    grid-row: span 2;
}

.gl-grid__item--tall {
    grid-row: span 2;
}

.gl-grid__item--medium {
    grid-row: span 1;
}

.gl-grid__item--small {
    grid-row: span 1;
}

/* Item card */
.gl-grid__item {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: #1a1a20;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.72s cubic-bezier(0.22, 1, 0.36, 1), transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.gl-grid__item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.gl-grid__img-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.gl-grid__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.gl-grid__item:hover .gl-grid__img {
    transform: scale(1.08);
}

/* Hover overlay */
.gl-grid__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(14, 14, 16, 0.92) 0%,
            rgba(14, 14, 16, 0.50) 40%,
            rgba(14, 14, 16, 0.08) 70%,
            transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    padding: 22px 20px;
}

.gl-grid__item:hover .gl-grid__overlay {
    opacity: 1;
}

/* Caption inside overlay */
.gl-grid__info {
    transform: translateY(14px);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.gl-grid__item:hover .gl-grid__info {
    transform: translateY(0);
}

.gl-grid__category {
    display: block;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gl-gold);
    margin-bottom: 4px;
}

.gl-grid__label {
    font-size: clamp(17px, 2vw, 24px);
    font-weight: 700;
    color: var(--gl-white);
    margin: 0 0 10px;
    line-height: 1.2;
}

.gl-grid__divider {
    width: 32px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gl-pink), var(--gl-gold));
}

/* Grid responsive */
@media(max-width: 991px) {
    .gl-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 220px;
    }

    .gl-grid__item--large {
        grid-column: span 2;
        grid-row: span 2;
    }
}

@media(max-width: 575px) {
    .gl-grid {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 160px;
        gap: 10px;
    }

    .gl-grid__item--large,
    .gl-grid__item--tall,
    .gl-grid__item--medium,
    .gl-grid__item--small {
        grid-column: span 1;
        grid-row: span 1;
    }

    /* First item as full-width hero on mobile */
    .gl-grid__item:first-child {
        grid-column: span 2;
        grid-row: span 1;
    }

    /* Always show captions on touch devices */
    .gl-grid__overlay {
        opacity: 1;
    }

    .gl-grid__info {
        transform: translateY(0);
    }
}
