/* ============================================
   SCROLL-CONTROLLED IMAGE SEQUENCE ANIMATION v2
   Premium scroll animation with modern reveals
   ============================================ */

/* Hide React hero section when scroll animation is present */
#root section:first-child,
#root>div>section:first-child {
    display: none !important;
}

/* Outer container - controls total scroll distance */
.scroll-animation-container {
    position: relative;
    width: 100%;
    height: 800vh;
    /* 8x viewport = smooth 192 frame animation */
    background: #0a0a0a;
    z-index: 1;
}

/* Sticky inner container - pins to viewport */
.scroll-animation-sticky {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
}

/* Canvas element - full viewport coverage */
.scroll-animation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: contents;
}

/* ============================================
   LOADING OVERLAY — Minimal & Modern
   ============================================ */

.scroll-animation-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animation-loader.hidden {
    opacity: 0;
    filter: blur(10px);
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* Elegant line loader instead of spinner */
.loader-spinner {
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    border: none;
}

.loader-spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Progress text — Large, bold counter */
.loader-progress {
    font-family: 'Cormorant', Georgia, serif;
    font-size: 48px;
    font-weight: 200;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1;
}

/* ============================================
   GRADIENT OVERLAY
   ============================================ */

.scroll-animation-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top,
            rgba(10, 10, 10, 0.7) 0%,
            rgba(10, 10, 10, 0.3) 40%,
            transparent 100%);
    pointer-events: none;
    z-index: 5;
}

/* Opening brand mark: hidden on first load, appears while user scrolls opening sequence */
.opening-brand-mark {
    position: absolute;
    right: 20px;
    bottom: 8px;
    z-index: 24;
    width: clamp(70px, 8vw, 112px);
    padding: 5px 6px;
    border-radius: 9px;
    background: rgba(8, 8, 8, 0.44);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.opening-brand-mark img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    opacity: 0.98;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
}

.opening-brand-mark.is-hidden {
    opacity: 0;
    transform: translateY(6px);
}

/* Hide branding mark on iPad/tablet/mobile widths */
@media (max-width: 1100px) {
    .opening-brand-mark {
        display: none !important;
    }
}

/* ============================================
   SCROLL INDICATOR — Refined & Minimal
   ============================================ */

.scroll-indicator {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 20;
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-indicator.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.scroll-indicator-text {
    font-family: 'Cormorant', Georgia, serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

/* Animated scroll line */
.scroll-indicator-arrow {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    border: none;
    transform: none;
}

.scroll-indicator-arrow::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.7));
    animation: scrollLine 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}


@keyframes scrollLine {
    0% {
        top: -100%;
    }

    50% {
        top: 100%;
    }

    100% {
        top: 100%;
    }
}

/* Progress bar */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(255, 255, 255, 0.1) 100%);
    transform-origin: left;
    transform: scaleX(0);
    z-index: 1000;
    transition: transform 0.15s ease-out;
}


/* ============================================
   SCROLL-TRIGGERED TEXT REVEAL ANIMATIONS
   Modern, cinematic text reveals
   ============================================ */

/* Base hidden state for all reveal elements */
.reveal-hidden {
    opacity: 0;
    will-change: transform, opacity;
}

/* --- Reveal Type: Text (Split upward with mask) --- */
.reveal-text.reveal-hidden {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(8px);
}

.reveal-text.reveal-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition:
        opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reveal Type: Fade (Subtle opacity) --- */
.reveal-fade.reveal-hidden {
    opacity: 0;
    transform: translateY(20px);
}

.reveal-fade.reveal-visible {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reveal Type: Slide (Horizontal wipe) --- */
.reveal-slide.reveal-hidden {
    opacity: 0;
    transform: translateX(-30px);
}

.reveal-slide.reveal-visible {
    opacity: 1;
    transform: translateX(0);
    transition:
        opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reveal Type: Scale (Zoom in subtly) --- */
.reveal-scale.reveal-hidden {
    opacity: 0;
    transform: scale(0.92);
    filter: blur(4px);
}

.reveal-scale.reveal-visible {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
    transition:
        opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Stagger children */
.reveal-visible:nth-child(1) {
    transition-delay: 0s;
}

.reveal-visible:nth-child(2) {
    transition-delay: 0.08s;
}

.reveal-visible:nth-child(3) {
    transition-delay: 0.16s;
}

.reveal-visible:nth-child(4) {
    transition-delay: 0.24s;
}

.reveal-visible:nth-child(5) {
    transition-delay: 0.32s;
}

.reveal-visible:nth-child(6) {
    transition-delay: 0.40s;
}


/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .scroll-animation-container {
        height: 500vh;
    }

    .loader-progress {
        font-size: 36px;
    }

    .scroll-indicator {
        bottom: 28px;
    }

    .scroll-indicator-text {
        font-size: 9px;
        letter-spacing: 3px;
    }

    .scroll-indicator-arrow {
        height: 28px;
    }

    .opening-brand-mark {
        right: 10px;
        bottom: 4px;
        width: clamp(64px, 19vw, 90px);
        padding: 4px 5px;
        border-radius: 8px;
    }

    .reveal-text.reveal-hidden {
        transform: translateY(24px);
        filter: blur(4px);
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .loader-spinner::after {
        animation: none;
    }

    .scroll-indicator-arrow::after {
        animation: none;
    }

    .scroll-animation-loader,
    .scroll-animation-overlay {
        transition: none;
    }

    .reveal-text.reveal-visible,
    .reveal-fade.reveal-visible,
    .reveal-slide.reveal-visible,
    .reveal-scale.reveal-visible {
        transition: opacity 0.3s ease !important;
        transform: none !important;
        filter: none !important;
    }
}
