/* DreamSequence - Unified Styles */

html {
    scroll-behavior: smooth;
    background-color: #1a1a1a;
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(-1deg);
    }

    50% {
        transform: translateY(-10px) rotate(1deg);
    }

    100% {
        transform: translateY(0px) rotate(-1deg);
    }
}

.float-slow {
    animation: float 8s ease-in-out infinite;
}

@keyframes grain-shift {
    0% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-1%, -1%);
    }

    20% {
        transform: translate(-2%, 1%);
    }

    30% {
        transform: translate(1%, -2%);
    }

    40% {
        transform: translate(-1%, 3%);
    }

    50% {
        transform: translate(-2%, 1%);
    }

    60% {
        transform: translate(3%, 0);
    }

    70% {
        transform: translate(0, 2%);
    }

    80% {
        transform: translate(-3%, 1%);
    }

    90% {
        transform: translate(1%, 2%);
    }

    100% {
        transform: translate(1%, -1%);
    }
}

/* Base Styles */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 72px;
    background-color: #1a1a1a;
    transition: background-color 0.5s ease;
    /* Prevent layout shifts from scrollbar appearing/disappearing */
    overflow-y: scroll;
    min-height: 100vh;
}

@media (min-width: 768px) {
    body {
        padding-top: 80px;
    }
}

/* Layout Stability Containers */
#main-header {
    /* No min-height needed — body padding-top handles the fixed header offset */
}

#main-footer {
    background-color: #1a1613;
}

/* Optimize Carousel Stability */
.carousel-container {
    min-height: 400px; /* Aligned with JS injection heights */
    contain: layout;
    display: flex;
    overflow-x: auto;
    gap: 2rem;
}

img {
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    display: block;
    max-width: 100%;
    height: auto;
    /* Prevent layout shift before image loads */
    aspect-ratio: attr(width) / attr(height);
}

.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-portrait { aspect-ratio: 3 / 4; }
.aspect-album { aspect-ratio: 1 / 1; }

/* Fluid Typography */
h1 {
    font-size: clamp(2.5rem, 8vw, 6rem);
    line-height: 0.95;
}

.text-8xl {
    font-size: clamp(3rem, 12vw, 8rem);
}

.text-7xl {
    font-size: clamp(2.5rem, 10vw, 7rem);
}

.text-6xl {
    font-size: clamp(2.25rem, 8vw, 6rem);
}

.text-5xl {
    font-size: clamp(2rem, 6vw, 5rem);
}

/* Custom Utilities */
.text-glow {
    text-shadow: 0 0 10px rgba(214, 158, 46, 0.3), 0 0 20px rgba(192, 86, 33, 0.2);
}

.crt-overlay {
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 3px 100%;
}

.btn-vintage {
    background: linear-gradient(135deg, #d69e2e 0%, #b35900 100%);
    border: 1px solid #8a4200;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-vintage:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 20px rgba(214, 158, 46, 0.4);
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.bandcamp-btn {
    background-color: #629aa9;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bandcamp-btn:hover {
    background-color: #72abbb;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(98, 154, 169, 0.3);
}

/* Photo Frames */
.photo-frame {
    border: 1px solid rgba(141, 110, 99, 0.3);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.photo-frame:hover {
    border-color: #d69e2e;
    transform: scale(1.02) rotate(-1deg);
}

/* Professional Nav */
.nav-link {
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    font-weight: 700;
    text-transform: uppercase;
}

/* Better Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #12100e;
}

::-webkit-scrollbar-thumb {
    background: #2a221b;
    border: 2px solid #12100e;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d69e2e;
}

/* Safe Area Utility */
.safe-area-inset {
    padding-top: max(12rem, env(safe-area-inset-top));
    padding-bottom: max(4rem, env(safe-area-inset-bottom));
}

#mobile-menu {
    background-color: #0c0c0c !important;
}

#mobile-menu a {
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

#mobile-menu a:hover,
#mobile-menu a:focus {
    letter-spacing: 0.1em;
    padding-left: 2rem;
    color: #fef9c3;
}

/* Layout Reveal Enhancements */
.reveal {
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important;
    opacity: 0;
    transform: translateY(10px);
    will-change: opacity, transform;
}

.menu-open {
    overflow: hidden;
    height: 100vh;
}

/* CRT Scanline Effect (Professional) */
.crt-scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 4px, 4px 100%;
    pointer-events: none;
    z-index: 9998;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.photo-frame-dark {
    border: 1px solid rgba(214, 158, 46, 0.15);
    background-color: #0c0c0c;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-frame-dark:hover {
    border-color: rgba(214, 158, 46, 0.6);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    transform: translateY(-8px) !important;
}

.archive-photo {
    filter: grayscale(100%);
    opacity: 0.7;
    transition: filter 0.6s ease, opacity 0.6s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: filter, opacity, transform;
}

.group:hover .archive-photo {
    filter: grayscale(0%) brightness(1.1);
    opacity: 1;
    transform: scale(1.05);
}

.reveal-hidden {
    opacity: 0;
    transform: translateY(10px);
    transition: none !important;
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scroll Snap for Collection Page */
.scroll-container {
    scroll-snap-type: y proximity;
}

.scroll-section {
    scroll-snap-align: start;
}

/* Oscilloscope Divider - Header Style */
.oscilloscope-container {
    padding: 30px 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.4;
    pointer-events: none;
}

.oscilloscope-box {
    width: 100%;
    max-width: 800px;
    height: 40px;
    background-color: transparent;
    position: relative;
    overflow: hidden;
}

.wave-layer {
    position: absolute;
    inset: 0;
    width: 200%;
    height: 100%;
}

.oscilloscope-wave-1 {
    stroke: #eab308;
    stroke-width: 1;
    fill: none;
    opacity: 0.6;
    animation: wave-slide-slow 15s linear infinite;
}

.oscilloscope-wave-2 {
    stroke: #eab308;
    stroke-width: 0.8;
    fill: none;
    opacity: 0.3;
    animation: wave-slide-fast 10s linear infinite;
}

@keyframes wave-slide-slow {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes wave-slide-fast {
    from { transform: translateX(-50%); }
    to { transform: translateX(0); }
}

/* Retro Visitor Counter Styles */
.retro-counter-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(12, 12, 12, 0.8);
    border: 1px solid rgba(214, 158, 46, 0.2);
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.retro-counter-display {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background-color: #050505;
    border-radius: 2px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 1);
    border: 1px solid #1a1a1a;
}

.retro-counter-digit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 36px;
    background: linear-gradient(to bottom, #111 0%, #000 50%, #111 100%);
    color: #eab308;
    font-family: 'Space Mono', monospace;
    font-size: 1.25rem;
    font-weight: 900;
    text-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
    border: 1px solid rgba(234, 179, 8, 0.1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.retro-counter-digit::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 2px;
    pointer-events: none;
}

.retro-counter-label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #d69e2e;
    opacity: 0.6;
}

/* Visual Archive Folders */
.archive-folder {
    border-top: 1px solid rgba(214, 158, 46, 0.2);
    padding-top: 4rem;
    margin-bottom: 8rem;
    position: relative;
}

.archive-folder::before {
    content: "CLASSIFIED";
    position: absolute;
    top: 2rem;
    right: 0;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: rgba(239, 68, 68, 0.6);
    font-family: 'Space Mono', monospace;
    transform: rotate(15deg);
    border-radius: 2px;
}

.archive-text-block {
    max-width: 400px;
}

.archive-id {
    font-family: 'Space Mono', monospace;
    margin-bottom: 1rem;
    display: inline-block;
}

.scattered-photos {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-scatter-item {
    position: absolute;
    width: 280px;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

.photo-scatter-item:hover {
    z-index: 10;
    transform: scale(1.1) rotate(0deg) !important;
}

.photo-scatter-1 { transform: rotate(-3deg) translate(-40px, -20px); }
.photo-scatter-2 { transform: rotate(4deg) translate(60px, 10px); }
.photo-scatter-3 { transform: rotate(-6deg) translate(-10px, 80px); }
.photo-scatter-4 { transform: rotate(2deg) translate(90px, -90px); }

@media (max-width: 768px) {
    .scattered-photos {
        min-height: auto;
        flex-direction: column;
        gap: 2rem;
        padding-bottom: 2rem;
    }
    .photo-scatter-item {
        position: relative;
        transform: none !important;
        width: 100%;
        max-width: 320px;
    }
}

/* --- GALLERY SPECIFIC STYLES --- */
.tech-mono {
    font-family: 'Space Mono', monospace;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #00ffee;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #00ffee;
    margin-right: 8px;
}

.archive-card {
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px;
    transition: all 0.4s ease;
    cursor: pointer;
}

.archive-card:hover {
    border-color: #cca73d;
    box-shadow: 0 0 30px rgba(204, 167, 61, 0.1);
}

.img-container {
    position: relative;
    background: #000;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.2) contrast(1.1);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    backface-visibility: hidden;
}

.archive-card:hover .img-container img {
    transform: scale(1.05);
    filter: grayscale(0);
}

.btn-tech {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: #00ffee;
    border: 1px solid rgba(0, 255, 238, 0.3);
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

.btn-tech:hover {
    background: rgba(0, 255, 238, 0.1);
    border-color: #00ffee;
}

.section-separator {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 4rem 0 2rem 0;
    display: flex;
    justify-content: center;
}

.section-tag {
    background: #080808;
    padding: 0 20px;
    margin-top: -10px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #888;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.carousel-container {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding-bottom: 2rem;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    will-change: scroll-position;
}

.carousel-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
}
.carousel-wrapper {
    position: relative;
    width: 100%;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid rgba(214, 158, 46, 0.4);
    color: #eab308;
    display: none; /* Controlled by is-active and hover */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    border-radius: 4px;
    opacity: 0;
}

.carousel-btn:hover {
    background: rgba(214, 158, 46, 0.3);
    border-color: #eab308;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.4);
    transform: translateY(-50%) scale(1.1);
}

@media (min-width: 768px) {
    .carousel-btn.is-active {
        display: flex;
        opacity: 0.3;
    }
    .carousel-wrapper:hover .carousel-btn.is-active {
        opacity: 1;
    }
}

/* Mobile: show more clearly if active */
@media (max-width: 767px) {
    .carousel-btn.is-active {
        display: flex;
        opacity: 0.8;
        width: 36px;
        height: 36px;
        background: rgba(10, 10, 10, 0.7);
    }
}

.carousel-btn.btn-left {
    left: -10px;
}

.carousel-btn.btn-right {
    right: -10px;
}

.carousel-btn .material-symbols-outlined {
    font-size: 28px;
}
