@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #030303;
    --bg-card: rgba(10, 10, 15, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.35);
    --accent-blue: #00f0ff;
    --accent-glow: rgba(0, 240, 255, 0.15);
    --accent-glow-strong: rgba(0, 240, 255, 0.4);
    --font-display: 'Outfit', sans-serif;
    --font-sans: 'Inter', sans-serif;
    --cursor-size: 8px;
    --cursor-ring-size: 36px;
}

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

html, body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow-x: hidden;
    scroll-behavior: auto; /* Managed by Lenis */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.9);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.4);
}

/* Base Canvas */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    outline: none;
}

/* Custom Cursor */
.custom-cursor {
    width: var(--cursor-size);
    height: var(--cursor-size);
    background-color: var(--text-primary);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.custom-cursor-ring {
    width: var(--cursor-ring-size);
    height: var(--cursor-ring-size);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9998;
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1), 
                height 0.3s cubic-bezier(0.25, 1, 0.5, 1), 
                border-color 0.3s, 
                background-color 0.3s;
}

/* Custom cursor hover states */
body.hovering-link .custom-cursor {
    width: 4px;
    height: 4px;
    background-color: var(--accent-blue);
}

body.hovering-link .custom-cursor-ring {
    width: 60px;
    height: 60px;
    border-color: var(--accent-blue);
    background-color: rgba(0, 240, 255, 0.05);
}

/* Layout */
#scroll-container {
    position: relative;
    z-index: 2;
    pointer-events: none;
    width: 100%;
}

section {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 8%;
}

/* UI Elements - Enable clicks on items explicitly */
.interactive {
    pointer-events: auto;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    padding: 2rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.glass-panel:hover {
    border-color: rgba(0, 240, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 240, 255, 0.05);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 2rem;
    left: 5%;
    right: 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: none;
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
}

.logo span {
    color: var(--accent-blue);
    text-shadow: 0 0 10px var(--accent-glow-strong);
}

nav {
    display: flex;
    gap: 1.5rem;
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.3s, text-shadow 0.3s;
    text-transform: uppercase;
}

nav a:hover, nav a.active {
    color: var(--text-primary);
    text-shadow: 0 0 8px var(--accent-glow-strong);
}

.header-actions button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.header-actions button:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

/* Hero Section */
.hero-content {
    max-width: 550px;
    opacity: 1;
    transform: translateY(0);
}

.hero-tagline {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-blue);
    margin-bottom: 1rem;
    font-weight: 600;
    text-shadow: 0 0 8px var(--accent-glow-strong);
}

h1 {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
    background: linear-gradient(135deg, #ffffff 40%, rgba(255, 255, 255, 0.5) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cta-button {
    background: var(--text-primary);
    color: var(--bg-dark);
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.25);
    background: #e5e5e5;
}

.cta-button svg {
    transition: transform 0.3s;
}

.cta-button:hover svg {
    transform: translateX(3px);
}

/* Narrative Story Sections */
.narrative-card {
    max-width: 480px;
    position: relative;
}

.narrative-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-blue), transparent);
    border-radius: 4px 0 0 4px;
}

.narrative-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-blue);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.narrative-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Alignments for narrative sections (alternating sides for visual rhythm) */
.section-left {
    justify-content: flex-start;
}

.section-right {
    justify-content: flex-end;
}

/* Statistics Section Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    width: 480px;
}

.stat-item {
    padding: 1.5rem;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: baseline;
}

.stat-number span {
    color: var(--accent-blue);
    text-shadow: 0 0 10px var(--accent-glow-strong);
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* 2D Projected Floating City Cards (HTML elements projected over the WebGL Globe) */
#marker-cards-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.city-info-card {
    position: absolute;
    transform: translate(-50%, calc(-100% - 20px)); /* Draw centered above the city marker */
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 240, 255, 0.25);
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.1);
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    pointer-events: auto;
    color: var(--text-primary);
    opacity: 0;
    visibility: hidden;
    transform-origin: bottom center;
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

.city-info-card.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, calc(-100% - 20px)) scale(1);
}

.city-info-card::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: rgba(5, 5, 8, 0.85);
    border-right: 1px solid rgba(0, 240, 255, 0.25);
    border-bottom: 1px solid rgba(0, 240, 255, 0.25);
}

.city-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.city-timezone {
    font-size: 0.65rem;
    color: var(--accent-blue);
    text-transform: uppercase;
    font-weight: 500;
}

.city-stat {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    margin-top: 0.3rem;
    gap: 1.5rem;
}

.city-stat span:first-child {
    color: var(--text-muted);
}

/* Footer / Control overlay */
footer {
    position: fixed;
    bottom: 2rem;
    left: 5%;
    right: 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: none;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mouse-wheel {
    width: 20px;
    height: 32px;
    border: 1.5px solid var(--text-muted);
    border-radius: 10px;
    position: relative;
}

.mouse-wheel::before {
    content: '';
    width: 3px;
    height: 6px;
    background-color: var(--accent-blue);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollMouseWheel 1.5s infinite;
}

@keyframes scrollMouseWheel {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 8px); opacity: 0; }
}

.instructions-panel {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instructions-panel span {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile responsive fixes */
@media (max-width: 991px) {
    section {
        padding: 0 5%;
    }
    
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .stats-grid {
        width: 100%;
        grid-template-columns: 1fr;
    }
    
    header nav, .header-actions {
        display: none;
    }
    
    footer {
        display: none;
    }
}

/* Accessibility: reduce motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-delay: 0s !important;
        animation-duration: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0s !important;
        scroll-behavior: auto !important;
    }
    .custom-cursor, .custom-cursor-ring, .mouse-wheel::before {
        display: none !important;
    }
    body {
        cursor: auto !important;
    }
}
