/* --- BRAND VARIABLES & RESETS --- */
:root {
    --obsidian: #020617;
    --deep-orange: #f97316;
    --ametrine-purple: #7c3aed;
}

* {
    /* Asset Protection: Prevent selection/dragging */
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

input,
textarea,
select,
[contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}

html {
    scroll-behavior: smooth;
    background-color: var(--obsidian);
}

/* Scopes the aggressive scroll snapping ONLY to the landing page so it doesn't break the gallery scroll events */
html:has(.hero-viewport) {
    scroll-snap-type: y mandatory !important; 
}

body {
    color: #cbd5e1;
    font-family: 'Inter', sans-serif;
    opacity: 0;
    animation: fadeInLayout 0.8s ease-in-out forwards;
    overflow-x: hidden;
}

@keyframes fadeInLayout {
    from { opacity: 0; }
    to { opacity: 1; }
}

body.menu-open,
body.lightbox-open {
    overflow: hidden;
}

/* --- NAVIGATION & FLUID SPY --- */
.nav-group {
    position: relative;
}

#nav-svg-layer {
    position: absolute;
    bottom: 22px;
    left: 0;
    width: 100%;
    height: 2px;
    pointer-events: none;
    opacity: 1;
}

#nav-indicator-rect {
    transition: x 0.5s cubic-bezier(0.77, 0, 0.175, 1), width 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

/* --- PARALLAX & HERO --- */
.hero-viewport {
    height: 100vh;
    height: 100dvh !important;
    min-height: 100vh !important;
    position: relative;
    overflow: hidden;
    background: #000;
    z-index: 10;
    
    scroll-snap-align: start !important;
    scroll-snap-stop: always !important; 
    scroll-margin-top: 0 !important;
}

.hero-viewport::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 25vh;
    background: linear-gradient(to bottom, transparent, var(--obsidian));
    pointer-events: none;
    z-index: 15;
}

.parallax-bg {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 120%;
    background-image: url('../../files/Mason-Parallax-Starrysky.jpg');
    background-size: cover;
    background-position: center;
    will-change: transform;
}

.hero-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 20%, rgba(2, 6, 23, 0.8) 80%, var(--obsidian) 100%);
    z-index: 2;
}

#eagle-wrapper {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, 0);
    z-index: 3;
    width: max(250vw, 200vh);
    max-width: none;
    will-change: transform, opacity;
}

@media (min-width: 768px) {
    #eagle-wrapper {
        top: 3vh;
        bottom: auto;
        height: auto;
        width: max(115vw, 140vh); 
        max-width: none;
    }
}

#eagle-float {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.9));
    animation: eagleSway 8s ease-in-out infinite;
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 95%);
    mask-image: linear-gradient(to bottom, black 40%, transparent 95%);
    opacity: 1; 
}

@keyframes eagleSway {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(0.5deg); }
}

#hero-text {
    z-index: 20 !important;
    opacity: 1 !important;
    transform: none !important;
}

#reveal-tagline {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s !important;
}

.invisible-wipe {
    display: inline-block;
    color: var(--deep-orange) !important; 
    font-weight: 700 !important; 
    -webkit-text-stroke: 0px transparent !important;
    opacity: 0;
    transform: none !important; 
    
    -webkit-mask-image: linear-gradient(to right, black 50%, rgba(0,0,0,0) 50%);
    mask-image: linear-gradient(to right, black 50%, rgba(0,0,0,0) 50%);
    -webkit-mask-size: 200% 100%;
    mask-size: 200% 100%;
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
    
    transition: opacity 1s ease 0.6s, -webkit-mask-position 1s ease 0.6s, mask-position 1s ease 0.6s !important; 
}

.visible .invisible-wipe,
#reveal-tagline.visible .invisible-wipe {
    opacity: 1 !important;
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
}

#reveal-tagline.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* --- GALLERY FEATURES --- */
.gallery-item {
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.scrollspy-section {
    scroll-snap-align: start;
    scroll-margin-top: 80px;
}

@media (min-width: 768px) {
    .scrollspy-section {
        scroll-margin-top: 160px;
    }
}

#portfolio-section {
    scroll-snap-align: start !important;
    scroll-snap-stop: always !important;
    scroll-margin-top: 0 !important;
    background-color: var(--obsidian) !important;
}

/* --- CAROUSEL & THUMBS --- */
.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    transition: transform 0.8s ease;
}

.sectionSwiper > .swiper-wrapper > .swiper-slide:not(.swiper-slide-active) {
    pointer-events: none !important;
}

.swiper-slide-thumb-active {
    opacity: 1 !important;
    border-color: var(--deep-orange) !important;
}

.swiper-button-next,
.swiper-button-prev {
    display: none !important;
}

.custom-scrollbar {
    display: flex;
}

/* --- LIGHTBOX TRANSITIONS --- */
#lightbox {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

#lightbox.active {
    opacity: 1;
    visibility: visible;
}

#lightbox-img {
    transition: opacity 0.5s ease-in-out, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.is-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.15), transparent);
    animation: shimmer 1.5s infinite linear;
    pointer-events: none;
    z-index: 20;
}

/* --- MOBILE LADDER --- */
#mobile-ladder {
    padding: 10px 14px 10px 10px; /* Base padding */
    z-index: 90;
    touch-action: none; 
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--ametrine-purple); /* Thinner outline */
    border-left: none;
    border-radius: 0 14px 14px 0;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), background 0.4s ease, padding 0.4s ease;
    transform: translateX(0); 
}

#mobile-ladder.idle {
    transform: translateX(calc(-100% + 20px));
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid rgba(124, 58, 237, 0.5); /* Thinner outline */
    padding: 6px 14px 6px 10px; /* Shrinks the vertical height footprint dynamically when collapsed */
}

#mobile-ladder.idle .ladder-link {
    opacity: 0;
}

#mobile-ladder.idle .ladder-item-container:not(.active) {
    height: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    transform: scale(0.5);
    pointer-events: none;
}

.ladder-item-container {
    height: 0;
    opacity: 0;
    margin: 0;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    transform-origin: left center;
    display: flex;
    align-items: center;
    width: fit-content;
    cursor: pointer;
}

.ladder-item-container.active { height: 26px; opacity: 1; margin: 4px 0; transform: scale(1.05); }
.ladder-item-container.prev-1, .ladder-item-container.next-1 { height: 20px; opacity: 0.85; margin: 2px 0; transform: scale(0.95); }
.ladder-item-container.prev-2, .ladder-item-container.next-2 { height: 16px; opacity: 0.5; margin: 1px 0; transform: scale(0.85); }
.ladder-item-container.prev-3, .ladder-item-container.next-3 { height: 12px; opacity: 0.2; margin: 0; transform: scale(0.75); }

.ladder-link {
    white-space: nowrap; 
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.9);
    pointer-events: none; 
    transition: opacity 0.3s ease; 
}

.ladder-item-container.active .ladder-link {
    color: var(--ametrine-purple);
}

/* --- CUSTOM SCROLLBAR --- */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }