/* 
   2026 Premium Immersive Web Design Trends
   Cinematic Heroes, Chromatic Mash-ups, Mixed Scroll Directions
*/

:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-muted: #888888;
    
    /* Chromatic Mashup Colors */
    --chroma-1: rgba(255, 61, 158, 0.4); /* Neon Pink */
    --chroma-2: rgba(61, 255, 239, 0.3); /* Cyan */
    
    /* Mesh Background Colors (High Vibrancy "From Roswell" Palette) */
    --mesh-1: #0A00B8; /* Deep Royal Blue */
    --mesh-2: #FF006E; /* Vibrant Hot Pink */
    --mesh-3: #FF5A00; /* Vivid Sunset Orange */
    --mesh-4: #4A00E0; /* Deep Violet */
    
    --font-sans: 'Inter', sans-serif;
    
    --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    cursor: none; /* Custom cursor used */
    overscroll-behavior: none;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: none;
}

/* 1. Chromatic Mash-up (Noise + Glow Orb) */
.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    transition: opacity 0.5s ease;
}

body.is-focusing-card .noise-overlay {
    opacity: 0;
}

/* Mesh Background (High Vibrancy Liquid Effect) */
.mesh-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    overflow: hidden;
    z-index: 0;
    background: #05002C; /* Deepest blue/purple base */
    pointer-events: none;
    opacity: 1.0; /* Full opacity per user reference */
}

.mesh-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: drift 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base colors for the orbs */
.orb-1 {
    width: 60vw; height: 60vw;
    top: -10%; left: -10%;
    background: var(--mesh-1);
    animation-duration: 25s;
}

.orb-2 {
    width: 50vw; height: 50vw;
    top: 40%; left: 60%;
    background: var(--mesh-2);
    animation-duration: 28s;
    animation-delay: -5s;
}

.orb-3 {
    width: 70vw; height: 70vw;
    top: 60%; left: -20%;
    background: var(--mesh-3);
    animation-duration: 32s;
    animation-delay: -10s;
}

.orb-4 {
    width: 40vw; height: 40vw;
    top: 10%; left: 70%;
    background: var(--mesh-4);
    animation-duration: 22s;
    animation-delay: -15s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(15vw, -10vh) scale(1.1); }
    66% { transform: translate(-10vw, 15vh) scale(0.9); }
    100% { transform: translate(-5vw, -5vh) scale(1.2); }
}

/* Interactive Glow Orb, now sits inside mesh */
.glow-orb {
    position: absolute;
    top: 50%; left: 50%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--chroma-1), transparent 60%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    filter: blur(90px);
    opacity: 0.8;
    transition: left 0.8s var(--ease-out-expo), top 0.8s var(--ease-out-expo);
    animation: none; /* Mouse driven */
}

/* 2. Custom Cursor */
.cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 6px; height: 6px;
    background-color: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: difference;
    transition: width 0.3s var(--ease-smooth), height 0.3s var(--ease-smooth), opacity 0.3s;
}

.cursor-label {
    position: fixed;
    top: 0; left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10001;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
    background: #3dffef; /* High visibility electric blue to match timeline slider */
    padding: 10px 16px;
    border-radius: 50px;
    opacity: 0;
    transition: opacity 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth);
    /* Removed mix-blend-mode entirely to ensure 100% full opacity on bright video backgrounds */
}

body.hover-active .cursor-dot {
    opacity: 0;
}
body.hover-active .cursor-label {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 3. Navigation */
.navbar {
    position: fixed;
    top: 0; width: 100%;
    padding: 2.5rem 5vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.logo span {
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 4. Cinematic Hero */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5vw;
    position: relative;
    z-index: 10;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none; /* Crucial: Let scrolling and clicks pass through to the slider and buttons natively! */
}

.hero-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    top: -5vh; /* visually balanced */
    z-index: 10;
}

/* Left Aligned UI Sidebar */
.hero-sidebar {
    position: absolute;
    left: 5vw; /* Match navbar padding exactly */
    top: 110px; /* Snug directly under the top-left JM logo */
    width: 140px; /* Reduced width to clear typography */
    display: flex;
    flex-direction: column;
    gap: 15vh; /* Large gap naturally drops controls down towards middle-screen with space all around */
    z-index: 20;
}

/* Particle UI Hint Label */
.particle-ui-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 4px;
    animation: hintFadeIn 1.5s ease 2s both;
}

.hint-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #FF5A00;
    animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

@keyframes hintFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* User Interface for Particle Typography Physics */
.particle-ui {
    width: 140px; /* Restricted width to add more negative space between buttons and typography */
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Tighter gap */
    pointer-events: auto; /* Buttons need to be clickable */
}

.mode-select select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 14px; /* Tighter padding */
    font-size: 0.7rem;
    font-family: var(--font-sans);
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: none; /* Interactive custom cursor matches */
    appearance: none;
    -webkit-appearance: none;
    padding-right: 30px; /* Adjust for caret */
    border-radius: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='rgba(255,255,255,0.6)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center; /* Caret closer to edge */
    transition: all 0.3s ease;
}

.mode-select select:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.mode-select select option {
    background: #050505;
    color: var(--text-primary);
}

.controls {
    display: flex;
    flex-direction: column; /* Stack vertically to fit the left column */
    gap: 1rem;
}

.controls button {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 10px; /* Tighter padding for smaller buttons */
    font-size: 0.65rem; /* Smaller font */
    font-family: var(--font-sans);
    letter-spacing: 1px; /* Tighter letter spacing to fit */
    text-transform: uppercase;
    cursor: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    border-radius: 8px;
    width: 100%; /* Stretch full width of the column */
    text-align: left; /* Left align text to match the column layout */
}

.controls button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.controls button.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1) inset, 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hero-lower {
    display: flex;
    flex-direction: column; /* Stack the role and location */
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* Scroll Down Indicator - Pushed to bottom of flex column */
.scroll-down-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-top: 1rem;
    opacity: 0.5;
}

.indicator-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.indicator-line {
    width: 60px;
    height: 1px;
    background: var(--text-muted);
    position: relative;
    overflow: hidden;
}

.indicator-line::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #fff;
    transform: translateX(-100%);
    animation: scrollLine 2s infinite var(--ease-smooth);
}

@keyframes scrollLine {
    0% { transform: translateX(-100%); }
    50%, 100% { transform: translateX(100%); }
}


/* 5. Mixed Scroll Directions (Horizontal Gallery) */
.horizontal-scroll-section {
    position: relative;
    /* Height dictates how long the user scrolls to reach the end of the track */
    height: 400vh; 
    background: var(--bg-color);
    z-index: 20;
}

.sticky-container {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.section-header {
    position: absolute;
    top: 9vh;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 25;
}

.section-header h2 {
    font-size: 1.2rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 5b. Interactive Timeline Navigator */
.timeline-container {
    position: absolute;
    top: 18vh; /* Spaced symmetrically between Navbar and Gallery */
    left: 5vw;
    width: 90vw; /* Spans across the view */
    z-index: 30;
    display: flex;
    flex-direction: column;
    transition: opacity 0.5s ease;
}

.timeline-labels {
    position: relative;
    width: 100%;
    height: 20px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.timeline-label {
    position: absolute;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.3s ease, text-shadow 0.3s ease;
    cursor: pointer;
    /* Adjust origin so left: 0% doesn't clip */
    transform: translateX(-50%); 
}

.timeline-label:first-child {
    transform: translateX(0);
}

.timeline-label.active {
    color: #fff;
    text-shadow: 0 0 15px rgba(255,255,255,0.8);
}

.timeline-label .short {
    display: none; /* Hide the mobile acronyms on spacious desktop displays */
}

.timeline-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 60px;
    height: 4px;
    background: #fff;
    cursor: grab;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
    transition: transform 0.2s cubic-bezier(0.19, 1, 0.22, 1), height 0.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.timeline-slider::-webkit-slider-thumb:hover {
    transform: scaleY(2);
    background: #3dffef;
    box-shadow: 0 0 15px rgba(61, 255, 239, 0.6);
}

.timeline-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scaleY(3);
    background: #3dffef;
}

body.is-focusing-card .timeline-container {
    opacity: 0;
    pointer-events: none;
}

.horizontal-track {
    display: flex;
    gap: 6vw;
    padding: 0 5vw;
    height: 80vh; /* Increased height to allow vertical shift without clipping */
    will-change: transform;
    /* Initial padding to push the first item in */
    padding-left: 20vw; 
}

.horizontal-item {
    width: 45vw; /* Fixed card width */
    min-width: 500px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    /* Delay the z-index loss on close so it doesn't clip underneath siblings while transitioning out */
    transition: z-index 0s 0.6s; 
}

.horizontal-item.is-focused {
    z-index: 100;
    transition: z-index 0s;
}

/* In-Place Focus Backdrop */
#focus-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85); /* Deep shadow, not pitch black */
    z-index: 50; /* Above the global background, but under #work */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

body.is-focusing-card #focus-backdrop {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}

/* 
   TRANSFORM CONTEXT BYPASS: 
   Because .horizontal-track uses `transform`, its children cannot break out with z-index.
   So we hoist the ENTIRE #work section above the global backdrop...
*/
#work {
    position: relative;
    z-index: 60; 
}

/* ...and then artificially darken everything inside #work EXCEPT the focused video! */
body.is-focusing-card .horizontal-item:not(.is-focused) {
    opacity: 0.15;
    filter: brightness(0.2);
    pointer-events: none;
}

body.is-focusing-card .section-header {
    opacity: 0.15;
    pointer-events: none;
}

/* Remove hover blur/scale when the video is actively in focus mode so it's pure */
.horizontal-item.is-focused .card-video-wrapper video {
    filter: none !important;
    transform: scale(1.02) !important;
    box-shadow: 0 40px 100px rgba(0,0,0,1);
    z-index: 100;
}

.horizontal-item.is-focused .card-video-wrapper::after {
    opacity: 0 !important; /* Remove colored glass tint */
}

/* Hide text so video gets 100% of the attention */
.horizontal-item.is-focused .card-info {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.card-video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9; /* Standard 1920x1080 sizing box */
    height: auto;
    overflow: hidden;
    background: #000; /* Pure black for standard padding/letterboxing */
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cinematic-img, .cinematic-video, .cinematic-iframe {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Fit entire video exactly without cutting off edges */
    transition: transform 1.5s var(--ease-out-expo), filter 1s var(--ease-out-expo);
    filter: brightness(0.8) contrast(1.1);
}

/* Specific overlay rules for video */
.cinematic-video {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2; /* Sit cleanly over the fallback img */
}

/* Strict sandbox rules for embedded HTML animations */
.cinematic-iframe {
    position: absolute;
    top: 0; left: 0;
    z-index: 2;
    border: none;
    pointer-events: none; /* Block the document from accidentally intercepting parent scroll physics */
}

.horizontal-item.is-focused .cinematic-iframe {
    pointer-events: auto; /* Restore raw interaction inside the active Focus window */
}

.horizontal-item:hover .cinematic-img,
.horizontal-item:hover .cinematic-video,
.horizontal-item:hover .cinematic-iframe {
    transform: scale(1.2); /* 20% scale effect */
    filter: brightness(1) contrast(1);
}

/* Frosted Glass Overlay */
.card-video-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 5; /* Above the video/image */
    transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
    border-radius: 8px; /* Match the parent border radius */
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0);
}

.horizontal-item:hover .card-video-wrapper::after {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.card-info {
    margin-top: 1.5rem;
}

.card-info h3 {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.2rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); /* Contrast against bright mesh */
}

.card-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.horizontal-end-spacer {
    min-width: 30vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
}

.horizontal-end-spacer h2 {
    font-size: 2rem;
    font-weight: 300;
}


/* 6. Footer */
.footer {
    position: relative;
    z-index: 10;
    padding: 10vh 5vw 5vh;
    background: var(--bg-color);
}

/* About Section */
.footer-about {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 6rem;
    margin-bottom: 8vh;
    padding-bottom: 8vh;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.about-heading {
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 400;
}

.about-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
    margin-bottom: 1.5rem;
}

.about-text:last-child {
    margin-bottom: 0;
}

.about-block {
    margin-bottom: 2rem;
}

.about-block:last-child {
    margin-bottom: 0;
}

.about-label {
    font-size: 0.7rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 400;
}

.about-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.about-list li {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.list-role {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.list-co {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.about-detail {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.about-links {
    display: flex;
    gap: 1.5rem;
}

.about-links a {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
    cursor: none;
}

.about-links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #FF5A00, #FF006E);
    transition: width 0.3s ease;
}

.about-links a:hover {
    color: #fff;
}

.about-links a:hover::after {
    width: 100%;
}

/* Stats Row */
.footer-stats {
    display: flex;
    gap: 4rem;
    margin-bottom: 8vh;
    padding-bottom: 6vh;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-stat {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer-stat .stat-value {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #FF5A00, #FF006E);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-stat .stat-label {
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.footer-content {
    margin-bottom: 8vh;
}

.footer-title {
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}

.footer-email {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--text-muted);
    transition: color 0.3s;
    text-decoration: underline;
    text-underline-offset: 8px;
}

.footer-email:hover {
    color: #fff;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
}

/* 6. Project Video Modal */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.4s, opacity 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-content {
    position: relative;
    width: 90vw;
    max-width: 1400px;
    z-index: 2;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 40px;
    right: 5vw;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    color: #fff;
    cursor: none;
    padding: 10px 24px 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 7. Contact Modal Formatting */
.contact-content {
    max-width: 500px;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 40px 100px rgba(0,0,0,0.8);
}

.contact-form-wrapper h2 {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.contact-form-wrapper p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-group textarea {
    min-height: 120px;
    resize: none;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: rgba(255, 90, 0, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.08);
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #FF5A00, #FF006E, #4A00E0);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    color: #fff;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: none;
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.3s;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.submit-btn:hover::after {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 90, 0, 0.3), 0 4px 15px rgba(255, 0, 110, 0.2);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.form-status {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(227, 255, 61, 0.1);
    border: 1px solid rgba(227, 255, 61, 0.3);
    color: #e3ff3d;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
}

/* 8. Featured Reel Reveal */
#featured-reel-section {
    position: relative;
    height: 180vh; /* Tightened scroll room for snappier unsticking */
    z-index: 5;
    pointer-events: none;
}

#featured-reel-section * {
    pointer-events: auto;
}

.sticky-reel-container {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}

.reel-content-wrapper {
    width: 90vw;
    max-width: 1400px;
    transform: scale(0.8) translateY(100px); /* Initial state before JS configures it */
    opacity: 0;
    will-change: transform, opacity;
}

.reel-frame {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    /* Simulate a floating 3D glass window feel */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 100px rgba(255,255,255,0.05), 0 50px 100px rgba(0,0,0,0.8);
    cursor: none;
}

.featured-reel-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; /* Let the wrapper handle the hover/click events */
}

/* Utils */
.fade-in {
    opacity: 0;
    animation: fadeIn 1.5s ease forwards;
}

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

@media (max-width: 768px) {
    .horizontal-track { padding-left: 5vw; gap: 4rem; }
    .horizontal-item { width: 85vw; min-width: auto; }
    .scroll-down-indicator { display: none; }
    .hero-lower { flex-direction: column; gap: 0.5rem; }
    .cursor-dot, .cursor-label { display: none; }
    body { cursor: auto; }
}

/* 12. Strict Mobile Overrides (Triggering reliably on shrunk desktop monitors) */
@media (max-width: 800px) {
    /* Reposition UI Sidebar to avoid text collisions */
    .hero-sidebar {
        top: auto;
        bottom: 5vh;
        left: 5vw;
        width: 90vw;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
        gap: 15px;
    }

    /* Convert vertical controls into a horizontal mini-grid */
    .controls {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        width: 65%;
    }
    .controls button {
        width: auto;
        flex: 1 1 45%;
        font-size: 0.55rem;
        padding: 8px 4px;
        text-align: center;
    }

    /* Lift hero content higher so it doesn't overlap bottom controls */
    .hero-content {
        top: -10vh;
    }

    /* Transform Featured Reel to stretch the absolute bounds of the narrow screen while preserving 16:9 aspect ratio */
    .reel-content-wrapper {
        width: 100vw;
    }
    .reel-frame {
        border-radius: 8px;
        border-color: rgba(255, 255, 255, 0.2);
    }

    /* Tighten scroll gap heavily for mobile so you reach the reel faster */
    #featured-reel-section {
        height: 120vh;
    }
    
    /* Lock heading to clear global top-stack bounds on narrow screens */
    .section-header {
        top: 12vh;
    }
    
    /* Shift timeline scrubber tighter */
    .timeline-container {
        top: 20vh;
    }
    
    /* Dynamically swap long titles for micro-acronyms */
    .timeline-labels {
        font-size: 0.6rem;
        letter-spacing: 0.5px;
    }
    .timeline-label .full {
        display: none;
    }
    .timeline-label .short {
        display: inline;
    }

    /* Stack footer about on mobile */
    .footer-about {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* Stack footer stats on mobile */
    .footer-stats {
        flex-direction: column;
        gap: 2rem;
    }

    /* Hide particle hint on mobile (controls are already compact) */
    .particle-ui-hint {
        display: none;
    }
}
