/* Premium luxury styling for Flowing Soon Coming Soon page */

:root {
    --bg-color: #070708;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --accent-color: #d4af37; /* Subtle Luxury Gold accent */
    --font-heading: 'Overpass', 'Interstate', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: var(--font-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Preloader Styles
   ========================================================================== */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 3.0s cubic-bezier(0.25, 1, 0.5, 1), 
                visibility 3.0s cubic-bezier(0.25, 1, 0.5, 1);
}

.loader-container.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Luxury Enter Overlay & Button */
.enter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                visibility 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.enter-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.enter-button {
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: #ffd700;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.35em;
    padding: 18px 40px;
    border-radius: 40px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(15px);
}

.enter-overlay.visible .enter-button {
    opacity: 1;
    transform: translateY(0);
}

.enter-button:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    letter-spacing: 0.4em;
    transform: scale(1.02);
}


.loader-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30vw;
    height: 30vw;
    min-width: 280px;
    max-width: 450px;
    aspect-ratio: 1;
    position: relative;
    z-index: 2;
    overflow: visible !important;
}

.loader-logo-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible !important;
}

.loader-svg {
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible !important;
}



/* SVG Element styling */
.bg-outline {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08); /* Static white outline */
    stroke-width: 3.5;
    transition: opacity 0.5s ease;
}

.glow-energy {
    fill: none;
    stroke: #ffffff;
    stroke-width: 4.5;
    stroke-linecap: round;
    filter: url(#white-reflective-soft);
    opacity: 0;
}

.glow-energy-intense {
    fill: none;
    stroke: #ffffff;
    stroke-width: 5.5;
    stroke-linecap: round;
    filter: url(#white-reflective-intense);
    opacity: 0;
}

/* Outer Circle Path Dash offsets */
.outer-l {
    stroke-dasharray: 628.3;
    stroke-dashoffset: 628.3;
}
.outer-r {
    stroke-dasharray: 628.3;
    stroke-dashoffset: 628.3;
}

/* Middle Circle Path Dash offsets */
.middle-l {
    stroke-dasharray: 439.8;
    stroke-dashoffset: 439.8;
}
.middle-r {
    stroke-dasharray: 439.8;
    stroke-dashoffset: 439.8;
}

/* Inner Circle Path Dash offsets */
.inner-l {
    stroke-dasharray: 251.3;
    stroke-dashoffset: 251.3;
}
.inner-r {
    stroke-dasharray: 251.3;
    stroke-dashoffset: 251.3;
}



/* Waiting / Loading state - outline pulse */
.loader-container.waiting .bg-outline {
    animation: outline-pulse 2.0s ease-in-out infinite alternate;
}

@keyframes outline-pulse {
    0% {
        stroke: rgba(255, 255, 255, 0.05);
        transform: scale(0.98);
        transform-origin: 250px 250px;
    }
    100% {
        stroke: rgba(255, 255, 255, 0.22);
        transform: scale(1.02);
        transform-origin: 250px 250px;
    }
}

/* Animating state triggers */
.loader-container.animating .outer-l {
    animation: flow-left-outer 5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.loader-container.animating .outer-r {
    animation: flow-right-outer 5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.loader-container.animating .middle-l {
    animation: flow-left-middle 5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.loader-container.animating .middle-r {
    animation: flow-right-middle 5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.loader-container.animating .inner-l {
    animation: flow-left-inner 5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.loader-container.animating .inner-r {
    animation: flow-right-inner 5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}



/* SVG Line Drawing animations */
@keyframes flow-left-outer {
    0% {
        stroke-dashoffset: 628.3;
        opacity: 0;
    }
    8% {
        opacity: 0.45;
    }
    40% {
        stroke-dashoffset: 0;
        opacity: 0.95;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0.95;
    }
}

@keyframes flow-right-outer {
    0% {
        stroke-dashoffset: 628.3;
        opacity: 0;
    }
    8% {
        opacity: 0.45;
    }
    40% {
        stroke-dashoffset: 0;
        opacity: 0.95;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0.95;
    }
}

@keyframes flow-left-middle {
    0%, 15% {
        stroke-dashoffset: 439.8;
        opacity: 0;
    }
    23% {
        opacity: 0.45;
    }
    55% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

@keyframes flow-right-middle {
    0%, 15% {
        stroke-dashoffset: 439.8;
        opacity: 0;
    }
    23% {
        opacity: 0.45;
    }
    55% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

@keyframes flow-left-inner {
    0%, 30% {
        stroke-dashoffset: 251.3;
        opacity: 0;
    }
    38% {
        opacity: 0.5;
    }
    70% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

@keyframes flow-right-inner {
    0%, 30% {
        stroke-dashoffset: 251.3;
        opacity: 0;
    }
    38% {
        opacity: 0.5;
    }
    70% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}



/* ==========================================================================
   Hero Container & Parallax
   ========================================================================== */
.hero-container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height to prevent mobile toolbar black bars */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

.canvas-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    overflow: hidden;
    background-color: var(--bg-color);
}

#parallax-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transition: opacity 3.0s cubic-bezier(0.25, 1, 0.5, 1);
}

#parallax-canvas.visible {
    opacity: 1;
}

/* Fallback background for mobile or if WebGL fails */
.fallback-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/landscape.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
    display: none;
    transform: scale(1.05);
}

.fallback-active .fallback-background {
    display: block;
    animation: ambientFloat 30s ease-in-out infinite alternate;
}

.fallback-active #parallax-canvas {
    display: none !important;
}

/* Ambient Floating Animation for Mobile / Fallback */
@keyframes ambientFloat {
    0% {
        transform: scale(1.05) translate(0, 0);
    }
    50% {
        transform: scale(1.08) translate(-1%, 0.5%);
    }
    100% {
        transform: scale(1.05) translate(0, 0);
    }
}

/* ==========================================================================
   Lighting & Vignette Overlays
   ========================================================================== */
.vignette-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(7, 7, 8, 0.1) 20%, rgba(7, 7, 8, 0.8) 95%);
    pointer-events: none;
    z-index: -2;
}

.gradient-overlay-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(7, 7, 8, 0.95) 0%, rgba(7, 7, 8, 0) 100%);
    pointer-events: none;
    z-index: -2;
}

/* ==========================================================================
   UI / Content Overlay
   ========================================================================== */
.hero-content {
    width: 100%;
    height: 100%;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
    pointer-events: none; /* Let pointer events pass through to canvas for desktop parallax */
}

/* Interactive elements inside overlay should still be clickable if added */
.hero-content a, .hero-content button, .hero-content input {
    pointer-events: auto;
}

.hero-header {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1), transform 1.0s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.hero-header.visible {
    opacity: 1;
    transform: translateY(0);
}

.header-subtitle {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.4em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Glassmorphic Audio Toggle Button */
.sound-button {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0;
}

.sound-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.sound-bar {
    display: inline-block;
    width: 2px;
    background-color: var(--text-primary);
    height: 8px;
    border-radius: 1px;
    transition: height 0.3s ease;
}

.sound-button.playing .bar-1 { animation: soundWave 0.8s ease-in-out infinite alternate; }
.sound-button.playing .bar-2 { animation: soundWave 1.1s ease-in-out infinite alternate; animation-delay: 0.15s; }
.sound-button.playing .bar-3 { animation: soundWave 0.9s ease-in-out infinite alternate; animation-delay: 0.05s; }
.sound-button.playing .bar-4 { animation: soundWave 1.2s ease-in-out infinite alternate; animation-delay: 0.2s; }

@keyframes soundWave {
    0% { height: 4px; }
    100% { height: 16px; }
}

.hero-main {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

.center-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45%;
    aspect-ratio: 1024 / 576;
    font-size: 0px;
    color: transparent;
    user-select: none;
    pointer-events: auto;
    cursor: default;
    opacity: 1;
    display: block;
    touch-action: none; /* Prevent browser scrolling/gestures during scratching */
}

.hero-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1), transform 1.0s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-footer.visible {
    opacity: 1;
    transform: translateY(0);
}

.logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 150px;
    transition: var(--transition-smooth);
}

.labyrinth-logo {
    width: 100%;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    /* Invert logo because original file is black logo on transparent, and we have a dark mode page */
    filter: invert(1) brightness(1.2) drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
    opacity: 0.8;
    transition: var(--transition-smooth);
}

.logo-wrapper:hover .labyrinth-logo {
    opacity: 1;
    filter: invert(1) brightness(1.4) drop-shadow(0 4px 15px rgba(212, 175, 55, 0.4));
    transform: scale(1.02);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeSlideDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeScaleUp {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
    .center-title {
        width: 60%;
    }
}

@media (max-width: 768px) {
    .hero-content {
        padding: 40px 24px;
    }
    
    .center-title {
        width: 80%;
        letter-spacing: 0.12em;
    }
    
    .logo-wrapper {
        max-width: 120px;
    }
    
    .sound-button {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .center-title {
        font-size: 2.2rem;
        letter-spacing: 0.08em;
    }
    
    .header-subtitle {
        font-size: 0.7rem;
        letter-spacing: 0.3em;
    }
    
    .logo-wrapper {
        max-width: 100px;
    }
}
