/**
 * CABIN — Intro Engine Styles
 * Cinematic scroll-driven zoom-out experience
 */

/* ═══════════════════════════════════════════════════════════════════════════
   VARIABLES
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
    --intro-bg: #030303;
    --intro-amber: #f0a500;
    --intro-purple: #a855f7;
    --intro-blue: #3b82f6;
    --intro-green: #22c55e;
    --intro-red: #ff6b35;
    --intro-text: #e8e8e8;
    --intro-text-dim: rgba(255, 255, 255, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   INTRO CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */
#intro-container {
    position: relative;
    width: 100%;
    background: var(--intro-bg);
    transition: opacity 0.8s ease;
}

#intro-scroll-container {
    position: relative;
    width: 100%;
    height: 350vh; /* Shorter = faster journey */
}

#intro-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
}

#intro-canvas-container canvas {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROGRESS BAR - Ultra minimal
   ═══════════════════════════════════════════════════════════════════════════ */
#intro-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 100;
}

#intro-progress-bar {
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.4);
    transition: width 0.15s ease-out;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STAGE INDICATORS - Minimal, cinematic
   ═══════════════════════════════════════════════════════════════════════════ */
#intro-stages {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.intro-stage {
    display: flex;
    align-items: center;
    gap: 14px;
    opacity: 0.25;
    transition: all 0.5s ease;
}

.intro-stage.active {
    opacity: 1;
}

.intro-stage.past {
    opacity: 0.4;
}

.stage-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.5s ease;
}

.intro-stage.active .stage-dot {
    background: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    transform: scale(1.8);
}

.intro-stage.past .stage-dot {
    background: rgba(255, 255, 255, 0.5);
}

.stage-name {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.4);
    transition: all 0.5s ease;
}

.intro-stage.active .stage-name {
    color: rgba(255, 255, 255, 0.9);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLL HINT - Minimal, elegant
   ═══════════════════════════════════════════════════════════════════════════ */
#intro-scroll-hint {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    opacity: 1;
    transition: opacity 0.5s ease;
    animation: fadeInUp 1.2s ease 0.8s both;
}

#intro-scroll-hint span {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: rgba(255, 255, 255, 0.35);
}

.scroll-arrow {
    animation: bounceDown 2.5s ease-in-out infinite;
}

.scroll-arrow svg {
    stroke: rgba(255, 255, 255, 0.4);
    width: 20px;
    height: 20px;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(10px); opacity: 0.8; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Hide scroll hint after scrolling starts */
body.scrolled #intro-scroll-hint {
    opacity: 0;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SKIP BUTTON - Subtle, non-intrusive
   ═══════════════════════════════════════════════════════════════════════════ */
#intro-skip {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: all 0.4s ease;
}

#intro-skip:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

#intro-skip svg {
    opacity: 0.5;
    width: 14px;
    height: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3D LABELS (via CSS2DRenderer)
   ═══════════════════════════════════════════════════════════════════════════ */
.intro-label {
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.intro-label.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* FULLY HIDE past labels - clean transition */
.intro-label.past {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
    pointer-events: none;
}

.intro-label-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.intro-label-subtitle {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
    font-style: normal;
    max-width: 340px;
    line-height: 1.5;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.intro-label-small {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 9px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    white-space: nowrap;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8);
    transition: opacity 0.5s ease;
}

/* Hide small labels when scrolled past */
.intro-label-small.past {
    opacity: 0;
}

/* Stage-specific label colors - subtle, cinematic */
.thought-label .intro-label-title {
    color: var(--intro-amber);
    text-shadow: 0 0 30px rgba(240, 165, 0, 0.3);
}

.observation-label .intro-label-title {
    color: var(--intro-blue);
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.pattern-label .intro-label-title {
    color: var(--intro-purple);
    text-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
}

.aspect-label .intro-label-title {
    color: rgba(255, 255, 255, 0.9);
}

.you-label .intro-label-title {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: 0.4em;
    color: #fff;
    text-shadow: 0 0 60px rgba(240, 165, 0, 0.4);
}

.you-label .intro-label-subtitle {
    font-size: 15px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LANDING PAGE (hidden during intro)
   ═══════════════════════════════════════════════════════════════════════════ */
#landing-page {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#landing-page.visible {
    opacity: 1;
    visibility: visible;
}

/* After intro completes */
body.intro-complete #intro-container {
    display: none;
}

body.intro-complete #landing-page {
    opacity: 1;
    visibility: visible;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    #intro-stages {
        right: 16px;
        gap: 16px;
    }

    .stage-name {
        display: none;
    }

    #intro-skip {
        bottom: 16px;
        right: 16px;
        padding: 8px 12px;
        font-size: 11px;
    }

    #intro-scroll-hint {
        bottom: 32px;
    }

    #intro-scroll-hint span {
        font-size: 11px;
    }

    .intro-label-title {
        font-size: 12px;
    }

    .intro-label-subtitle {
        font-size: 11px;
        max-width: 250px;
    }

    .you-label .intro-label-title {
        font-size: 18px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CINEMATIC EFFECTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Soft vignette overlay */
#intro-canvas-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 60%,
        rgba(3, 3, 3, 0.5) 100%
    );
    pointer-events: none;
    z-index: 2;
}

/* Final transition flash - subtle white */
@keyframes transitionFlash {
    0% { opacity: 0; }
    30% { opacity: 0.15; }
    100% { opacity: 0; }
}

.transition-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    pointer-events: none;
    z-index: 1000;
    animation: transitionFlash 0.8s ease-out forwards;
}
