/* Scrollytelling Hero Styles */
:root {
    --hero-bg: #1C2226; /* Final Awwwards-ready background */
    --hero-text-primary: rgba(255, 255, 255, 0.9);
    --hero-text-secondary: rgba(255, 255, 255, 0.6);
    --hero-text-muted: rgba(255, 255, 255, 0.4);
    --hero-accent: rgba(255, 255, 255, 0.15); 
}

/* Ensure global dark mode matches hero if desired, but locally scoped for now */
/* Global wrapper strictly non-clickable */
.scrolly-hero-wrapper {
    background-color: var(--hero-bg);
    color: var(--hero-text-primary);
    position: relative;
    z-index: 10;
    font-family: 'Inter', sans-serif;
    pointer-events: none; /* Disable all clicks by default */
}

/* Default internal elements to none too */
.scrolly-hero-wrapper * {
    pointer-events: none;
}

/* 200vh container: Reduced from 300vh to make the 40 frames play smoother (less scroll distance per frame) */
.scrolly-container {
    height: 200vh;
    position: relative;
}

/* Sticky wrapper to hold canvas and text in place */
.sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The Tank Frame - Constrained "Window" */
/* The Tank Frame - Constrained "Window" */
.tank-frame {
    position: relative;
    width: calc(100% - 40px); /* Fill width with breathing room */
    height: calc(100vh - 40px); /* Fill height with breathing room */
    max-width: none; /* Remove constraint */
    aspect-ratio: auto; /* Allow filling the screen */
    border-radius: 30px; 
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 0 100px rgba(0, 0, 0, 0.5);
    background: var(--hero-bg);
    overflow: hidden; /* Clip everything to the tank */
    z-index: 1;
}

/* Fallback Image */
.hero-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 0; 
    /* removed pointer-events: none to allow interaction */
    /* Apply same mask for consistency if needed, but usually image is full */
     -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
    mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
    transition: opacity 0.5s ease;
}

/* Bottom Fade Gradient to blend into next section */
.sticky-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40vh; /* Significantly increased for a long, seamless blend */
    background: linear-gradient(to bottom, transparent 0%, var(--hero-bg) 100%);
    z-index: 5;
    pointer-events: none;
    border-radius: 0 0 40px 40px; /* Match container */
}

/* Ambient Glow to fill empty space */
.sticky-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150vw;
    height: 150vh;
    background: radial-gradient(circle, 
        rgba(0, 109, 109, 0.15) 0%, /* Primary Teal with low opacity */
        rgba(0, 0, 0, 0) 60%
    );
    z-index: 0;
    pointer-events: none;
    animation: glowPulse 8s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    0% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

/* The Canvas - Fills the Tank */
#hero-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    display: block;
    /* Vignette Mask to blend image background (#020B0A) into site background (#1C2226) */
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
    mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
    pointer-events: none; /* Let events pass through to fallback if needed */
}

/* Loader */
.hero-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent; /* Allow fallback image to be seen */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--hero-text-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Text Overlays */
.scroll-text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through to canvas if needed, mostly for scroll */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.scroll-text-step {
    position: absolute;
    width: 100%;
    padding: 0 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    will-change: opacity, transform;
}

.scroll-text-step.active {
    opacity: 1;
    transform: translateY(0);
}

/* Step specific positioning */
/* 0% - Center Intro */
.step-intro {
    text-align: center;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
}

.step-intro h1 {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    
    /* Gradient Text Matching Page Style */
    background: linear-gradient(135deg, #FFFFFF 0%, hsl(var(--primary)) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    
    margin-bottom: 0.5rem;
    /* Removed text-shadow as it conflicts with background-clip: text */
    filter: drop-shadow(0 4px 30px rgba(0,0,0,0.5)); /* Use filter for shadow on gradient text */
}

.brand-location {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: white !important;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: inline-block;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.5s;
    animation: bounce 2s infinite;
    pointer-events: none;
    z-index: 20;
}

.mouse-icon {
    width: 24px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    position: relative;
}

.mouse-wheel {
    width: 4px;
    height: 8px;
    background: white;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: scrollWheel 2s infinite;
}

.scroll-text {
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);}
    40% {transform: translateX(-50%) translateY(-10px);}
    60% {transform: translateX(-50%) translateY(-5px);}
}

@keyframes scrollWheel {
    0% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(12px); opacity: 0; }
}

/* 30% - Left Detail */
.step-detail {
    top: 50%;
    transform: translateY(-50%);
    left: 10%;
    max-width: 400px;
    text-align: left;
}

.step-detail p {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 600;
    line-height: 1.2;
    color: white; 
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* 60% - Right Trust */
.step-trust {
    top: 50%;
    transform: translateY(-50%);
    right: 10%;
    max-width: 400px;
    text-align: right;
    left: auto; 
}

.step-trust p {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 600;
    line-height: 1.2;
    color: white;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* 90% - Center CTA */
.step-cta {
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    width: 100%;
}

.hero-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    background: hsl(var(--accent));
    color: white;
    border-radius: 99px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    pointer-events: auto; /* Enable clicks */
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 10px 20px hsla(var(--accent)/0.3);
    border: 1px solid hsla(255, 255, 255, 0.2);
}

.hero-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px hsla(var(--accent)/0.5);
    background: hsl(var(--accent));
    filter: brightness(1.1);
    border-color: rgba(255,255,255,0.4);
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    /* Adjust tank frame for mobile margins */
    .tank-frame {
        width: calc(100% - 20px);
        height: 55vh; /* Reduced height to strictly frame the landscape image */
        margin: 0 auto;
        border-radius: 20px;
    }

    #hero-canvas {
        object-fit: contain; /* Ensure it stays inside */
    }
    
    /* Center all text steps on mobile */
    .step-detail, .step-trust {
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%) !important;
        text-align: center;
        width: 90%;
        max-width: none;
    }

    /* Adjust text sizes */
    .step-intro h1 {
        font-size: 3rem;
    }
    
    .step-detail p, .step-trust p {
        font-size: 1.5rem;
        text-shadow: 0 4px 10px rgba(0,0,0,1); /* Stronger shadow for mobile readability */
    }
    
    .hero-cta-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
}
