/* Scrollytelling Custom Styles for Vastira Projects */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;700&display=swap');

:root {
    --scrolly-bg: #f2f0eb; /* Warm Bone background */
    --scrolly-text-primary: #1a1a1a;
    --scrolly-text-secondary: #4a4a4a;
    --scrolly-text-muted: #8e8e8e;
    --scrolly-gold: #d4a211; /* Premium Brand Gold */
    --scrolly-glass: rgba(255, 255, 255, 0.45);
    --scrolly-border-glass: rgba(255, 255, 255, 0.35);
    --scrolly-font: 'Outfit', sans-serif;
}

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

/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--scrolly-bg);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-content {
    text-align: center;
    width: 320px;
}

.loader-logo {
    font-family: var(--scrolly-font);
    font-weight: 700;
    font-size: 2.2rem;
    letter-spacing: 8px;
    margin-bottom: 24px;
    color: var(--scrolly-text-primary);
}

.progress-container {
    height: 3px;
    background: rgba(0,0,0,0.06);
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

#progress-bar {
    position: absolute;
    height: 100%;
    background: var(--scrolly-gold);
    width: 0%;
    transition: width 0.25s ease-out;
}

#progress-text {
    margin-top: 12px;
    font-size: 0.85rem;
    font-family: var(--scrolly-font);
    font-weight: 500;
    color: var(--scrolly-text-secondary);
}

/* Scroll Progress Indicator (Left border highlight) */
.scroll-progress {
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    height: 150px;
    width: 2px;
    background: rgba(0,0,0,0.05);
    z-index: 1000;
}

.scroll-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--scrolly-gold);
}

/* Scrollytelling Main Layout Container */
#home.scrolly-main-container {
    display: flex;
    min-height: 500vh;
    background-color: var(--scrolly-bg);
    position: relative;
    z-index: 10;
}

/* Left Panel: Content stage containing sequential cards */
.content-stage {
    width: 50%;
    position: relative;
    z-index: 50;
    padding-top: 100px; /* Align nicely below navigation header */
}

.scrolly-section {
    min-height: 100vh;
    height: auto;
    display: flex;
    align-items: center;
    padding-left: 12%;
    padding-right: 12%;
    position: relative;
}

.scrolly-section.hero {
    height: calc(100vh - 100px);
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding-left: 12%;
}

/* Premium Content Cards with Soft Glassmorphism */
.content-card {
    background: var(--scrolly-glass);
    backdrop-filter: blur(32px) saturate(145%);
    -webkit-backdrop-filter: blur(32px) saturate(145%);
    border: 1px solid var(--scrolly-border-glass);
    padding: 4.5rem 3.5rem;
    max-width: 580px;
    border-radius: 90px; /* Curved luxury organic aesthetic */
    box-shadow: 0 30px 80px rgba(0,0,0,0.05);
    opacity: 0;
    transform: translateY(60px) scale(0.96);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    font-family: var(--scrolly-font);
    
    /* Gaussian feathered edge for professional appearance */
    mask-image: radial-gradient(circle at center, black 75%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 75%, transparent 100%);
}

.hero-card {
    background: transparent;
    backdrop-filter: none;
    border: none;
    padding: 0;
    opacity: 1;
    transform: none;
    max-width: 650px;
    position: relative;
    z-index: 100;
    mask-image: none;
    -webkit-mask-image: none;
}

.hero-card h1 {
    font-family: var(--scrolly-font) !important;
    font-size: clamp(2.3rem, 4.8vw, 3.8rem) !important; 
    font-weight: 700 !important;
    color: var(--scrolly-text-primary) !important;
    line-height: 1.15 !important; 
    letter-spacing: -2px !important;
    margin-bottom: 1.5rem !important;
}

.hero-card .hero-keyword {
    color: var(--scrolly-gold);
    font-weight: 700;
}

.hero-card p {
    font-family: var(--scrolly-font);
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 400;
    color: var(--scrolly-text-secondary);
    line-height: 1.6;
}

.scrolly-section h2 {
    font-family: var(--scrolly-font) !important;
    font-size: clamp(2rem, 3.5vw, 3rem) !important;
    font-weight: 700 !important;
    color: var(--scrolly-text-primary) !important;
    line-height: 1.1 !important;
    letter-spacing: -1.5px !important;
    margin-bottom: 1.2rem !important;
    border-bottom: 2px solid var(--scrolly-gold);
    display: inline-block;
    padding-bottom: 0.4rem;
}

.body-text {
    font-family: var(--scrolly-font);
    font-size: 1.15rem;
    font-weight: 300;
    line-height: 1.65;
    color: var(--scrolly-text-secondary);
}

.hero-actions {
    margin-top: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn-scrolly-primary {
    background: var(--scrolly-text-primary);
    color: #fff !important;
    text-decoration: none;
    padding: 1rem 2.2rem;
    font-family: var(--scrolly-font);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-scrolly-primary:hover {
    background: var(--scrolly-gold);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(212, 162, 17, 0.25);
}

.btn-scrolly-secondary {
    background: transparent;
    color: var(--scrolly-gold) !important;
    text-decoration: none;
    padding: 1rem 2.2rem;
    font-family: var(--scrolly-font);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 4px;
    border: 2px solid var(--scrolly-gold);
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-scrolly-secondary:hover {
    background: var(--scrolly-gold);
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(212, 162, 17, 0.25);
}

/* Right Panel: Visual Stage */
.visual-stage {
    width: 50%;
    height: 100vh;
    position: absolute;
    right: 0;
    top: 0;
    background: var(--scrolly-bg);
    overflow: hidden;
    z-index: 40;
}

.visual-container {
    width: 100%;
    height: 100%;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%);
    mask-image: linear-gradient(to right, transparent, black 10%);
}

.visual-stage video, 
.visual-stage canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#scrolly-canvas {
    opacity: 0;
    z-index: 1;
}

#hero-video {
    z-index: 2;
    transition: opacity 0.4s ease;
}

#blur-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: transparent;
}

/* Responsive Styling for Tablets and Mobiles */
@media (max-width: 1024px) {
    #home.scrolly-main-container {
        flex-direction: column;
        min-height: auto;
        padding-bottom: 4rem;
    }
    
    .content-stage {
        width: 100%;
        padding-top: 90px;
        z-index: 10;
    }
    
    .scrolly-section {
        min-height: auto;
        padding: 3.5rem 1.5rem;
        justify-content: center;
    }
    
    .scrolly-section.hero {
        height: auto;
        min-height: auto;
        padding: 5rem 1.5rem;
    }
    
    .content-card {
        padding: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 2.5rem);
        border-radius: 48px;
        max-width: 100%;
        opacity: 1 !important; /* Keep text cards always visible on mobile */
        transform: none !important;
        background: rgba(255, 255, 255, 0.78);
        backdrop-filter: blur(24px) saturate(160%);
        -webkit-backdrop-filter: blur(24px) saturate(160%);
        border: 1px solid rgba(255, 255, 255, 0.45);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.03);
        mask-image: none;
        -webkit-mask-image: none;
        transition: border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .content-card:hover {
        border-color: rgba(212, 162, 17, 0.4);
        transform: translateY(-4px) !important;
        box-shadow: 0 30px 60px rgba(212, 162, 17, 0.08);
    }
    
    .hero-card {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .hero-card:hover {
        transform: none !important;
        box-shadow: none;
    }
    
    .hero-card h1 {
        font-size: clamp(2rem, 6vw, 2.8rem) !important;
        letter-spacing: -1px !important;
    }
    
    .scrolly-section h2 {
        font-size: clamp(1.6rem, 5vw, 2.2rem) !important;
    }
    
    .visual-stage {
        position: absolute; /* Keep background video local to hero container so it scrolls away naturally */
        width: 100%;
        height: 100vh; /* Exactly viewport height on mobile to prevent stretching */
        left: 0;
        top: 0;
        z-index: 1;
        opacity: 0.18; /* Artistic visual background bleed */
        pointer-events: none;
    }
    
    .visual-container {
        -webkit-mask-image: none;
        mask-image: none;
    }
    
    #scrolly-canvas {
        display: none !important; /* Hide resource-intensive canvas on mobile */
    }
    
    #hero-video {
        opacity: 1 !important;
        display: block !important;
    }

    .scroll-buffer {
        display: none !important;
    }

    .scroll-progress {
        display: none !important;
    }
}

/* Skip Intro floating action button styling */
.skip-intro-btn {
    position: fixed;
    right: 40px;
    bottom: 40px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--scrolly-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--scrolly-border-glass);
    padding: 0.8rem 1.6rem;
    border-radius: 30px;
    color: var(--scrolly-text-secondary) !important;
    text-decoration: none;
    font-family: var(--scrolly-font);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.skip-intro-btn i {
    color: var(--scrolly-gold);
    transition: transform 0.4s ease;
}

.skip-intro-btn:hover {
    color: var(--scrolly-text-primary) !important;
    border-color: var(--scrolly-gold);
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(212, 162, 17, 0.15);
}

.skip-intro-btn:hover i {
    transform: translateY(3px);
}

/* Show the skip button only when scrollytelling is active */
.skip-intro-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Hide skip intro button in mobile viewports */
@media (max-width: 1024px) {
    .skip-intro-btn {
        display: none !important;
    }
}

/* =========================================
   NAVBAR CONTRAST & LEGIBILITY CORRECTIONS
   ========================================= */
/* Fix navbar contrast on light background when not scrolled */
.navbar:not(.scrolled) .nav-links:not(.btn-contact) {
    color: var(--scrolly-text-primary) !important;
}

.navbar:not(.scrolled) .menu-toggle .bar {
    background-color: var(--scrolly-text-primary) !important;
}

/* Ensure hovered state is also premium gold */
.navbar:not(.scrolled) .nav-links:not(.btn-contact):hover {
    color: var(--scrolly-gold) !important;
}

/* Maintain active indicator color in light menu mode */
.navbar:not(.scrolled) .nav-links:not(.btn-contact)::after {
    background: var(--scrolly-gold) !important;
}

/* =========================================
   COMPACT HEIGHT VIEWPORT OPTIMIZATIONS
   ========================================= */
/* Resizes desktop scrolly cards for smaller laptop heights (e.g. 1366x768) */
@media (max-height: 800px) and (min-width: 1025px) {
    .content-card {
        padding: 2.5rem 2rem !important;
        border-radius: 45px !important;
    }
    .scrolly-section {
        padding-top: 80px !important;
        padding-bottom: 20px !important;
    }
    .scrolly-section.hero {
        padding-top: 80px !important;
    }
    .scrolly-section h2 {
        font-size: clamp(1.6rem, 3vw, 2.2rem) !important;
        margin-bottom: 0.8rem !important;
    }
    .body-text {
        font-size: 1.05rem !important;
        line-height: 1.5 !important;
    }
    .hero-card h1 {
        font-size: clamp(2rem, 3.8vw, 3rem) !important;
        margin-bottom: 1rem !important;
    }
    .hero-actions {
        margin-top: 1.5rem !important;
    }
}
