/* ===================================
   Design System & CSS Variables
   =================================== */
:root {
    /* Colors */
    --bg-primary: #0a0e27;
    --bg-secondary: #12172e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-gaming: linear-gradient(135deg, #fa709a 0%, #fee140 100%);

    /* Accent Colors */
    --accent-cyan: #00f2fe;
    --accent-purple: #667eea;
    --accent-pink: #f093fb;
    --accent-orange: #fee140;

    /* Text Colors */
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.4);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Outfit', var(--font-primary);
}

/* ===================================
   Base Styles & Reset
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ===================================
   Canvas Background for 3D Wireframe
   =================================== */
#polygonCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, rgba(13, 115, 119, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(45, 27, 78, 0.08) 0%, transparent 50%);
    animation: backgroundMove 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundMove {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(5%, 5%);
    }
}

/* ===================================
   Typography
   =================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: var(--spacing-md);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: var(--spacing-md);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: var(--spacing-sm);
}

p {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

/* ===================================
   Container & Layout
   =================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

section {
    padding: var(--spacing-3xl) 0;
    position: relative;
    z-index: 10;
}

/* ===================================
   Navigation
   =================================== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 14, 39, 0.7) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 9999;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: 80px;
    transition: all 0.4s ease;
}

#model-viewer {
    background: transparent !important;
}

nav.scrolled {
    background: rgba(5, 7, 20, 0.9) !important;
    border-bottom: 1px solid rgba(0, 242, 254, 0.2);
}

/* Visibility Utilities */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: flex !important;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
    height: 80px;
}

.logo {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 900;
    font-family: var(--font-display);
    background: linear-gradient(135deg, #fff 0%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.3));
    transition: transform 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
    list-style: none;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Block 3D Viewer link during loading */
body.is-loading-map .nav-links a[href="#model-viewer"] {
    pointer-events: none;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10001;
}

.mobile-menu-btn span {
    width: 100%;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Media Queries for Responsiveness */
@media (max-width: 1024px) {
    .nav-links {
        gap: var(--spacing-md);
    }
}

@media (max-width: 860px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(10, 14, 39, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--spacing-xl);
        z-index: 10000;
        padding-top: 120px;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        border-left: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-lang-item.mobile-only {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-top: 20px;
        padding-top: 30px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        width: 80%;
    }

    .lang-label {
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 2px;
        color: var(--text-muted);
        font-weight: 700;
    }

    .desktop-only {
        display: none !important;
    }

    .nav-links.active {
        right: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* Hamburger Animation */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: translateY(9.5px) rotate(45deg);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: translateY(-9.5px) rotate(-45deg);
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.3rem;
    }

    .lang-switch {
        gap: 8px;
    }

    .lang-btn img {
        width: 20px;
        height: 15px;
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    justify-self: end;
}

/* Language Switcher */
.lang-switch {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-self: end;
}

.lang-btn {
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s ease;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn img {
    display: block;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.lang-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.lang-btn.active {
    opacity: 1;
    filter: drop-shadow(0 0 4px var(--accent-cyan));
    transform: scale(1.1);
}

/* ===================================
   Hero Section
   =================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
    background: transparent;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(5%, -5%) scale(1.1);
    }
}

/* Noise Texture Overlay */
.hero-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.05;
    pointer-events: none;
    z-index: 3;
    mix-blend-mode: overlay;
}

.hero-content {
    position: relative;
    z-index: 5;
    animation: heroAppear 0.4s ease-out;
}

@keyframes heroAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

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

.hero h1 {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 0.95;
    background: linear-gradient(to bottom, #fff 20%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.1));
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.8vw, 1.4rem);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-2xl);
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
    letter-spacing: 0.01em;
    opacity: 0.9;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 1.2rem 3rem;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    text-decoration: none;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0, 242, 254, 0.3);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 0 0 rgba(0, 242, 254, 0);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 242, 254, 0.2), transparent);
    transition: left 0.6s ease;
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: rgba(0, 242, 254, 0.8);
    background: rgba(0, 242, 254, 0.1);
    box-shadow: 0 10px 30px rgba(0, 242, 254, 0.2), 0 0 15px rgba(0, 242, 254, 0.4);
}

.cta-button:hover::before {
    left: 100%;
}

/* Scroll Down Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.desktop-indicator,
.mobile-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.6;
}

.scroll-indicator span {
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Mouse Animation */
.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 2px;
    height: 6px;
    background-color: var(--accent-cyan);
    border-radius: 1px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

/* Touch/Swipe Animation */
.touch-gesture {
    width: 30px;
    height: 45px;
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 15px;
}

.finger {
    width: 12px;
    height: 12px;
    background: var(--accent-cyan);
    border-radius: 50%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    filter: blur(1px);
    box-shadow: 0 0 10px var(--accent-cyan);
    animation: swipeFinger 2s infinite;
}

@keyframes scrollWheel {
    0% {
        transform: translate(-50%, 0);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        transform: translate(-50%, 15px);
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

@keyframes swipeFinger {
    0% {
        transform: translate(-50%, 0);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        transform: translate(-50%, 25px);
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

/* Responsive Logic for Indicators */
.mobile-indicator {
    display: none;
}

.desktop-indicator {
    display: flex;
}

@media (max-width: 768px) {
    .desktop-indicator {
        display: none;
    }

    .mobile-indicator {
        display: flex;
    }
}