:root {
    --color-primary: #A8E86C;
    --color-secondary: #86CFA9;
    --color-accent: #D4A24C;
    --color-warm: #CF8686;
    --color-cool: #B8D4E3;
    --color-dark: #0B1F17;
    --color-dark-alt: #152E22;
    --color-dark-alt-2: #113427;
    --color-dark-alt-3: #1F4A33;
    --color-light: #D4E8DC;
    --color-1a3d2b: #1A3D2B;
    
    --font-display: 'Barlow Condensed', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Space Mono', monospace;
    
    --hud-panel-size: clamp(180px, 22vw, 320px);
    --transit-bar-height: clamp(60px, 8vh, 100px);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-dark);
    color: var(--color-light);
    overflow-x: hidden;
}

/* === BACKGROUND SCENES === */

.scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.scene.active {
    opacity: 1;
}

.canopy-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0B1F17 0%, #1A3D2B 40%, #152E22 100%);
    clip-path: polygon(
        0% 100%,
        2% 85%, 5% 75%, 8% 80%, 12% 70%, 15% 78%, 18% 68%,
        22% 75%, 25% 65%, 28% 72%, 32% 62%, 35% 70%, 38% 60%,
        42% 68%, 45% 58%, 48% 65%, 52% 55%, 55% 62%, 58% 52%,
        62% 60%, 65% 50%, 68% 58%, 72% 48%, 75% 55%, 78% 45%,
        82% 52%, 85% 42%, 88% 50%, 92% 40%, 95% 48%, 98% 45%,
        100% 50%, 100% 100%
    );
}

.bio-lights {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 15% 40%, rgba(168, 232, 108, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 45% 55%, rgba(134, 207, 169, 0.12) 0%, transparent 25%),
        radial-gradient(circle at 75% 35%, rgba(184, 212, 227, 0.1) 0%, transparent 22%),
        radial-gradient(circle at 25% 70%, rgba(207, 134, 134, 0.08) 0%, transparent 20%),
        radial-gradient(circle at 85% 75%, rgba(212, 162, 76, 0.1) 0%, transparent 18%);
    animation: biolights 8s ease-in-out infinite;
}

@keyframes biolights {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Scene-specific variations */
.scene-1 .canopy-layer {
    background: linear-gradient(180deg, #0B1F17 0%, #113427 40%, #152E22 100%);
}

.scene-2 .canopy-layer {
    background: linear-gradient(180deg, #152E22 0%, #1A3D2B 40%, #0B1F17 100%);
}

.scene-3 .canopy-layer {
    background: linear-gradient(180deg, #113427 0%, #152E22 40%, #1A3D2B 100%);
}

.scene-4 .canopy-layer {
    background: linear-gradient(180deg, #0B1F17 0%, #1A3D2B 40%, #113427 100%);
}

.scene-5 .canopy-layer {
    background: linear-gradient(180deg, #1A3D2B 0%, #113427 40%, #152E22 100%);
}

/* === HUD OVERLAY === */

.hud-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
}

.hud-panel {
    position: fixed;
    backdrop-filter: blur(8px);
    border: 2px solid var(--color-primary);
    background: rgba(26, 61, 43, 0.4);
    padding: clamp(12px, 2vw, 20px);
    font-family: var(--font-display);
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.hud-panel.visible {
    opacity: 1;
}

.panel-label {
    font-size: clamp(0.65rem, 1.2vw, 0.85rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--color-primary);
    text-transform: uppercase;
    margin-bottom: clamp(8px, 1vw, 12px);
    border-bottom: 1px solid rgba(168, 232, 108, 0.3);
    padding-bottom: 6px;
}

.panel-content {
    font-size: clamp(0.75rem, 1.1vw, 0.9rem);
    line-height: 1.5;
    color: var(--color-light);
}

/* Panel Positions */
.panel-station {
    top: clamp(20px, 3vh, 40px);
    left: clamp(20px, 3vw, 40px);
    width: var(--hud-panel-size);
}

.panel-departures {
    top: clamp(20px, 3vh, 40px);
    right: clamp(20px, 3vw, 40px);
    width: var(--hud-panel-size);
}

.panel-map {
    bottom: clamp(140px, 18vh, 220px);
    left: clamp(20px, 3vw, 40px);
    width: var(--hud-panel-size);
}

.panel-status {
    bottom: clamp(140px, 18vh, 220px);
    right: clamp(20px, 3vw, 40px);
    width: var(--hud-panel-size);
}

/* Station Panel */
.station-name {
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.station-coords {
    font-size: clamp(0.65rem, 0.95vw, 0.75rem);
    color: var(--color-secondary);
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

/* Departures Panel */
.departure-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(168, 232, 108, 0.15);
}

.departure-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.dest {
    color: var(--color-light);
    font-weight: 500;
}

.time {
    color: var(--color-accent);
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    font-weight: 600;
}

/* Map Panel */
.route-diagram {
    width: 100%;
    height: auto;
    max-height: 80px;
}

.station-dot {
    filter: drop-shadow(0 0 4px rgba(168, 232, 108, 0.6));
}

/* Status Panel */
.status-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.status-row:last-child {
    margin-bottom: 0;
}

.status-row .label {
    font-size: clamp(0.65rem, 0.95vw, 0.75rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-secondary);
    min-width: 80px;
}

.status-bar {
    flex: 1;
    height: 6px;
    background: rgba(168, 232, 108, 0.2);
    border: 1px solid rgba(168, 232, 108, 0.4);
    border-radius: 3px;
    overflow: hidden;
}

.status-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-primary) 100%);
    transition: width 0.8s ease;
}

/* === TRANSIT BAR === */

.transit-bar {
    position: fixed;
    bottom: clamp(20px, 3vh, 40px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 101;
    background: rgba(26, 61, 43, 0.5);
    backdrop-filter: blur(8px);
    border: 2px solid var(--color-primary);
    padding: clamp(10px, 1.5vw, 16px) clamp(15px, 2vw, 24px);
    border-radius: 4px;
    max-width: 90vw;
    width: auto;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    pointer-events: auto;
}

.transit-bar.visible {
    opacity: 1;
}

.transit-label {
    font-family: var(--font-display);
    font-size: clamp(0.7rem, 1vw, 0.8rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 8px;
}

.transit-stations {
    display: flex;
    gap: clamp(8px, 2vw, 16px);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.transit-station {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.station-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(168, 232, 108, 0.3);
    border: 1px solid var(--color-secondary);
    transition: all 0.4s ease;
}

.transit-station.active .station-indicator {
    width: 12px;
    height: 12px;
    background: var(--color-primary);
    box-shadow: 0 0 12px rgba(168, 232, 108, 0.8);
}

.station-label {
    font-family: var(--font-display);
    font-size: clamp(0.6rem, 0.9vw, 0.7rem);
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--color-light);
    text-transform: uppercase;
    text-align: center;
    opacity: 0.6;
    transition: opacity 0.4s ease;
}

.transit-station.active .station-label {
    color: var(--color-primary);
    opacity: 1;
}

/* === SCROLL INDICATOR === */

.scroll-indicator {
    position: fixed;
    top: 50%;
    right: clamp(20px, 3vw, 40px);
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.scroll-indicator.visible {
    opacity: 1;
}

.indicator-label {
    font-family: var(--font-display);
    font-size: clamp(0.6rem, 0.9vw, 0.7rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--color-secondary);
    text-transform: uppercase;
    text-align: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.indicator-bar {
    width: 3px;
    height: clamp(60px, 12vh, 120px);
    background: rgba(168, 232, 108, 0.2);
    border: 1px solid var(--color-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.indicator-progress {
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, var(--color-secondary) 0%, var(--color-primary) 100%);
    transition: height 0.3s ease;
}

/* === CONTENT SECTIONS === */

.content-section {
    position: relative;
    width: 100%;
    height: 100vh;
    z-index: 1;
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
    .hud-panel {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .panel-station {
        width: clamp(160px, 45vw, 240px);
    }
    
    .panel-departures {
        width: clamp(160px, 45vw, 240px);
    }
    
    .panel-map {
        width: clamp(160px, 45vw, 240px);
        bottom: auto;
        top: clamp(160px, 30vh, 240px);
    }
    
    .panel-status {
        width: clamp(160px, 45vw, 240px);
        bottom: auto;
        top: clamp(160px, 30vh, 240px);
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .transit-bar {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .hud-panel {
        padding: 8px;
    }
    
    .panel-station {
        width: 100vw;
        left: 0 !important;
        right: 0;
        transform: translateX(0);
    }
    
    .panel-departures {
        display: none;
    }
    
    .panel-map {
        display: none;
    }
    
    .panel-status {
        width: 100vw;
        left: 0 !important;
        right: 0;
    }
    
    .transit-bar {
        bottom: 10px;
        width: calc(100vw - 20px);
    }
}

/* === ANIMATIONS === */

@keyframes panel-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hud-panel.visible {
    animation: panel-fade-in 0.6s ease-out;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(168, 232, 108, 0.3);
    }
    50% {
        box-shadow: 0 0 16px rgba(168, 232, 108, 0.6);
    }
}

.hud-panel {
    animation: pulse-glow 4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
