/* ===================================================================
   BEN SNOOK PORTFOLIO - THE ENGINEER'S TRAVERSE
   Parallax Pan Vertical Scroll Experience
   =================================================================== */

/* ===================================================================
   CSS VARIABLES - RIVIAN COLOR PALETTE
   =================================================================== */
:root {
    /* Core Colors */
    --color-sage: #A8B5A1;
    --color-slate: #6B7C8F;
    --color-sand: #D4B896;
    --color-terracotta: #C98D7B;
    --color-off-white: #F5F5F0;
    --color-black: #1A1A1A;

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'IBM Plex Mono', monospace;

    /* Spacing */
    --spacing-sm: 1rem;
    --spacing-md: 1.25rem;
    --spacing-lg: 2rem;

    /* Border */
    --border-width: 2px;
    --border-style: solid var(--color-black);
}

/* ===================================================================
   GLOBAL RESET & BASE STYLES
   =================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-body);
    color: var(--color-black);
    overflow-x: hidden;
    overflow-y: auto !important;
    line-height: 1.6;
    font-size: 0.9rem;
}

body {
    overflow-y: auto !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

/* ===================================================================
   FORCE TRANSPARENCY ON ALL STRUCTURAL CONTAINERS
   (Ensures background image shows through)
   =================================================================== */
html, body, #scroll-container, #horizontal-wrapper, .scene, .pin-spacer {
    background-color: transparent !important;
    background: transparent !important;
}

/* ===================================================================
   VERTICAL SCROLL CONTAINER (DESKTOP)
   =================================================================== */
#scroll-container {
    width: 100%;
    height: auto;
    overflow: visible;
    position: relative;
}

.bg-panorama {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: auto;
    max-width: none; /* Crucial: stops the browser from limiting width */
    min-width: 100vw;
    z-index: -1;
    display: block;
    will-change: transform;
}

#horizontal-wrapper {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    height: auto;
    overflow: visible;
}

/* ===================================================================
   SCENE BASE STYLES
   =================================================================== */
.scene {
    width: 100%;
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    padding: var(--spacing-lg) var(--spacing-md);
}

.scene-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.scene-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ===================================================================
   SCENE 1: THE ORIGIN (COASTAL)
   =================================================================== */
.coastal-bg {
    background: transparent;
}


.hero-card {
    background: rgba(245, 245, 240, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: var(--border-width) var(--border-style);
    padding: 3rem;
    max-width: 600px;
    width: 60vw;
    box-shadow: 8px 8px 0 var(--color-black);
    position: relative;
}

.hero-title {
    font-size: clamp(3.5rem, 6vw, 5.5rem);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

.hero-location {
    font-size: 1rem;
    color: var(--color-slate);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}


/* ===================================================================
   SCENE 2: THE WORKSHOP (TECHNICAL)
   =================================================================== */
.technical-bg {
    background: transparent;
}

#scene-workshop {
    justify-content: center;
    /* margin-bottom handled by .scene base class */
}

.section-title {
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    max-width: 95vw;
    margin: 0 auto;
}

.project-card {
    background: rgba(245, 245, 240, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: var(--border-width) var(--border-style);
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--color-black);
    position: relative;
}

.project-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--color-black);
}

.project-card h3 {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-sm);
    color: var(--color-black);
}

.project-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-sage);
    border: var(--border-width) var(--border-style);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-sm);
}

.project-card p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.project-card a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--color-black);
    color: var(--color-off-white);
    text-decoration: none;
    border: var(--border-width) var(--border-style);
    font-weight: 600;
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.project-card a:hover {
    transform: translate(2px, 2px);
}

/* ===================================================================
   SCENE 3: THE ADVENTURE (MOUNTAINS)
   =================================================================== */
.mountain-bg {
    background: transparent;
}

#scene-adventure {
    margin-bottom: 0; /* Last scene, no bottom margin needed */
}

.content-card {
    background: rgba(245, 245, 240, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: var(--border-width) var(--border-style);
    padding: 2.5rem;
    box-shadow: 6px 6px 0 var(--color-black);
    max-width: 700px;
    margin: 0 auto var(--spacing-lg);
}

.content-card h3 {
    font-size: 2.25rem;
    margin-bottom: var(--spacing-sm);
}

.content-card p {
    font-size: 1.15rem;
    margin-bottom: var(--spacing-md);
}

.btn-primary {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--color-terracotta);
    color: var(--color-black);
    text-decoration: none;
    border: var(--border-width) var(--border-style);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 4px 4px 0 var(--color-black);
}

.btn-primary:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--color-black);
}

/* Hobbies Grid */
.hobbies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 90vw;
    margin: 0 auto;
}

.hobby-card {
    background: rgba(212, 184, 150, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: var(--border-width) var(--border-style);
    padding: 2rem;
    text-align: center;
    box-shadow: 4px 4px 0 var(--color-black);
    transition: transform 0.2s ease;
}

.hobby-card:hover {
    transform: scale(1.05);
}

.hobby-card h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.hobby-card p {
    font-size: 1rem;
}

/* Animated Van */
.van-element {
    position: absolute;
    bottom: 10%;
    left: 10%;
    width: 200px;
    height: 120px;
    background: var(--color-terracotta);
    border: var(--border-width) var(--border-style);
    box-shadow: 6px 6px 0 var(--color-black);
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

/* ===================================================================
   MOBILE RESPONSIVE (VERTICAL STACK)
   Mobile: < 768px
   =================================================================== */
@media (max-width: 767px) {
    /* Disable horizontal scroll, enable vertical */
    body {
        overflow-y: auto;
    }

    #scroll-container {
        height: auto;
        overflow: visible;
    }

    /* Hide panoramic background on mobile */
    .bg-panorama {
        display: none;
    }

    #horizontal-wrapper {
        flex-direction: column;
        width: 100%;
        height: auto;
    }

    .scene {
        width: 100%;
        height: auto;
        min-height: 100vh;
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .scene-content {
        width: 100%;
        padding: var(--spacing-sm);
    }

    /* Restore scene backgrounds on mobile */
    .coastal-bg {
        background: linear-gradient(135deg, var(--color-slate) 0%, var(--color-sage) 100%);
    }

    .technical-bg {
        background: var(--color-off-white);
        background-image:
            linear-gradient(var(--color-sage) 1px, transparent 1px),
            linear-gradient(90deg, var(--color-sage) 1px, transparent 1px);
        background-size: 30px 30px;
        opacity: 0.8;
    }

    .mountain-bg {
        background: linear-gradient(180deg, var(--color-sage) 0%, var(--color-off-white) 100%);
    }

    /* Scene 1 adjustments */
    .hero-card {
        width: 90%;
        max-width: none;
        padding: var(--spacing-md);
        box-shadow: 4px 4px 0 var(--color-black);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    /* Scene 2 adjustments */
    .bento-grid {
        width: 100%;
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: var(--spacing-md);
    }

    /* Scene 3 adjustments */
    .hobbies-grid {
        width: 100%;
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .van-element {
        position: relative;
        left: 0;
        bottom: 0;
        margin: var(--spacing-md) auto;
    }
}

/* ===================================================================
   TABLET ADJUSTMENTS
   =================================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .scene-content {
        width: 85%;
    }

    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 4rem;
    }
}

/* ===================================================================
   UTILITY CLASSES
   =================================================================== */
.text-center {
    text-align: center;
}

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* Smooth fade-in animation class (applied via JS) */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}
