/* ========================================
   DESIGN TOKENS — White & Silver Edition
   ======================================== */

:root {
    /* Colors - White Main, Silver Accent */
    --color-primary: #F5F5F2;
    --color-primary-hover: #FFFFFF;
    --color-background: #050608;
    --color-background-surface: #0A0B10;
    --color-background-surface-hover: #12141C;
    --color-white: #F5F5F2;
    --color-electric: #C0C7D1;
    --color-muted: rgba(245, 245, 242, 0.55);
    --color-border: rgba(245, 245, 242, 0.06);
    --color-border-hover: rgba(245, 245, 242, 0.14);
    
    /* Aurora Colors - Early Dawn */
    --aurora-1: rgba(245, 245, 242, 0.04);
    --aurora-2: rgba(192, 199, 209, 0.03);
    --aurora-3: rgba(174, 183, 197, 0.02);
    --aurora-4: rgba(26, 42, 74, 0.02);
    
    /* Typography */
    --font-family: 'Oxanium', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* Font sizes - clamp(min, preferred, max) */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
    --text-3xl: clamp(1.875rem, 1.6rem + 1.375vw, 2.5rem);
    --text-4xl: clamp(2.25rem, 1.9rem + 1.75vw, 3rem);
    --text-5xl: clamp(3rem, 2.5rem + 2.5vw, 4.5rem);
    --text-6xl: clamp(3.75rem, 3rem + 3.75vw, 6rem);
    --text-7xl: clamp(4.5rem, 3.5rem + 5vw, 7.5rem);
    
    /* Line heights */
    --line-height-tight: 1.05;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.7;
    
    /* Letter spacing */
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: -0.01em;
    --letter-spacing-wide: 0.02em;
    
    /* Spacing - 8-point system */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 40px;
    --space-6: 48px;
    --space-7: 64px;
    --space-8: 80px;
    --space-9: 96px;
    --space-10: 128px;
    --space-11: 160px;
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Container */
    --container-max: 1200px;
    --container-padding: var(--space-4);
    
    /* Transitions - Smoother */
    --transition-duration-fast: 250ms;
    --transition-duration-base: 450ms;
    --transition-duration-slow: 700ms;
    --transition-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --transition-ease-out: cubic-bezier(0, 0, 0.2, 1);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-index */
    --z-preloader: 9999;
    --z-navigation: 1000;
    --z-mobile-nav: 2000;
    --z-overlay: 500;
    --z-above: 100;
    --z-behind: -1;
    
    /* Glow Effects */
    --glow-primary: 0 0 60px rgba(245, 245, 242, 0.04);
    --glow-subtle: 0 0 80px rgba(245, 245, 242, 0.02);
}

/* ========================================
   RESET & BASE — Refined
   ======================================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    background: var(--color-background);
}

body {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
    color: var(--color-white);
    background-color: var(--color-background);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   AURORA EFFECT — Early Dawn
   ======================================== */

#aurora-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.8s ease;
}

#aurora-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Subtle grain texture overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: var(--z-behind);
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ========================================
   TYPOGRAPHY — Elegant
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-white);
}

h1 {
    font-size: var(--text-7xl);
    font-weight: var(--font-weight-extrabold);
}
h2 {
    font-size: var(--text-5xl);
}
h3 {
    font-size: var(--text-3xl);
}
h4 {
    font-size: var(--text-2xl);
}
h5 {
    font-size: var(--text-xl);
}
h6 {
    font-size: var(--text-lg);
}

p {
    font-size: var(--text-base);
    line-height: var(--line-height-relaxed);
    color: var(--color-muted);
}

a {
    color: var(--color-white);
    text-decoration: none;
    transition: color var(--transition-duration-fast) var(--transition-smooth);
}

a:hover {
    color: var(--color-electric);
}

/* ========================================
   CONTAINER
   ======================================== */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ========================================
   SECTION TITLES — Refined
   ======================================== */

.section-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-weight-extrabold);
    letter-spacing: var(--letter-spacing-tight);
    margin-bottom: var(--space-6);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-white), var(--color-electric));
    border-radius: var(--radius-full);
    opacity: 0.4;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ========================================
   GRID SYSTEM
   ======================================== */

.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-4);
}

/* ========================================
   PRELOADER — Open, Spacious Network
   ======================================== */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: #050608;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.8s cubic-bezier(0.65, 0, 0.35, 1);
    pointer-events: all;
}

#preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

#preloader-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    background: #050608;
}

.preloader-text {
    position: relative;
    z-index: 10;
    font-family: var(--font-family);
    font-size: var(--text-xs);
    color: var(--color-muted);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    opacity: 0.4;
    animation: preloaderPulse 2.5s ease-in-out infinite;
    margin-top: var(--space-9);
}

@keyframes preloaderPulse {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.6; }
}

/* ========================================
   NAVIGATION — Liquid Glass
   ======================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-navigation);
    padding: var(--space-3) 0;
    background: transparent;
    transition: all var(--transition-duration-base) var(--transition-smooth);
}

/* Liquid Glass effect when scrolled - More Transparent */
.site-header.scrolled {
    background: rgba(5, 6, 8, 0.35);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border-bottom: 1px solid rgba(245, 245, 242, 0.04);
    box-shadow: 
        0 4px 40px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(245, 245, 242, 0.02);
}

/* Glass glow at the top edge - More Subtle */
.site-header.scrolled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(245, 245, 242, 0.03) 20%,
        rgba(245, 245, 242, 0.06) 50%,
        rgba(245, 245, 242, 0.03) 80%,
        transparent 100%
    );
    pointer-events: none;
}

/* Subtle glow behind header - More Transparent */
.site-header.scrolled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -20px;
    background: radial-gradient(
        ellipse at 50% 0%,
        rgba(245, 245, 242, 0.015) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: -1;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-text {
    font-size: 24px;
    font-weight: var(--font-weight-extrabold);
    color: var(--color-white);
    letter-spacing: var(--letter-spacing-tight);
    font-family: var(--font-family);
}

/* Desktop Navigation */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--space-4);
    align-items: center;
}

.nav-list a {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-muted);
    padding: var(--space-1) 0;
    position: relative;
    transition: color var(--transition-duration-fast) var(--transition-smooth);
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: linear-gradient(90deg, var(--color-white), var(--color-electric));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-duration-fast) var(--transition-smooth);
    border-radius: var(--radius-full);
}

.nav-list a:hover {
    color: var(--color-white);
}

.nav-list a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-list a.active {
    color: var(--color-white);
}

.nav-list a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Mobile Navigation Toggle — Refined */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-1);
    z-index: var(--z-navigation);
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
}

.menu-bar {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--color-white);
    border-radius: var(--radius-full);
    transition: all var(--transition-duration-fast) var(--transition-smooth);
    transform-origin: center;
}

.mobile-nav-toggle[aria-expanded="true"] .menu-bar:first-child {
    transform: rotate(45deg) translate(4px, 5px);
}

.mobile-nav-toggle[aria-expanded="true"] .menu-bar:last-child {
    transform: rotate(-45deg) translate(4px, -5px);
}

/* Mobile Navigation Overlay — Refined */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    background: var(--color-background-surface);
    z-index: var(--z-mobile-nav);
    transform: translateX(100%);
    transition: transform var(--transition-duration-slow) var(--transition-ease-in-out);
    visibility: hidden;
    border-left: 1px solid var(--color-border);
}

.mobile-nav-overlay.active {
    transform: translateX(0);
    visibility: visible;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: var(--space-7);
}

.mobile-nav-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-1);
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
}

.close-bar {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--color-white);
    border-radius: var(--radius-full);
}

.close-bar:first-child {
    transform: rotate(45deg) translate(4px, 5px);
}

.close-bar:last-child {
    transform: rotate(-45deg) translate(4px, -5px);
}

.mobile-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.mobile-nav-list a {
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-medium);
    color: var(--color-white);
    transition: color var(--transition-duration-fast) var(--transition-smooth);
    letter-spacing: var(--letter-spacing-tight);
}

.mobile-nav-list a:hover {
    color: var(--color-electric);
}

/* ========================================
   FOOTER — Refined
   ======================================== */

.site-footer {
    padding: var(--space-9) 0 var(--space-4);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-9);
    position: relative;
    z-index: 1;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(245, 245, 242, 0.04) 30%,
        rgba(245, 245, 242, 0.06) 50%,
        rgba(245, 245, 242, 0.04) 70%,
        transparent 100%
    );
    pointer-events: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr;
    gap: var(--space-7);
    margin-bottom: var(--space-7);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-logo .logo-text {
    font-size: 20px;
    color: var(--color-white);
    opacity: 0.8;
    font-weight: var(--font-weight-extrabold);
}

.footer-mission {
    font-size: var(--text-sm);
    color: var(--color-muted);
    max-width: 320px;
    line-height: var(--line-height-relaxed);
}

.footer-nav-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2) var(--space-4);
}

.footer-nav-list a {
    font-size: var(--text-sm);
    color: var(--color-muted);
    transition: color var(--transition-duration-fast) var(--transition-smooth);
}

.footer-nav-list a:hover {
    color: var(--color-white);
}

.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: flex-start;
}

.footer-social a {
    font-size: var(--text-sm);
    color: var(--color-muted);
    padding: var(--space-1) var(--space-2);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    transition: all var(--transition-duration-fast) var(--transition-smooth);
}

.footer-social a:hover {
    color: var(--color-white);
    border-color: var(--color-border-hover);
    background: var(--color-background-surface-hover);
}

.footer-bottom {
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.footer-copyright {
    font-size: var(--text-xs);
    color: var(--color-muted);
    opacity: 0.4;
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */

@media (max-width: 1024px) {
    .main-nav {
        display: none;
    }
    
    .mobile-nav-toggle {
        display: flex;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .footer-nav-list {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-social {
        gap: var(--space-4);
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 640px) {
    :root {
        --container-padding: var(--space-3);
    }
    
    .mobile-nav-overlay {
        max-width: 100%;
    }
    
    .mobile-nav-list a {
        font-size: var(--text-2xl);
    }
    
    .footer-nav-list {
        grid-template-columns: 1fr;
    }
    
    .footer-social {
        gap: var(--space-3);
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    #aurora-overlay {
        display: none;
    }
}

/* ========================================
   FOCUS VISIBLE — Refined
   ======================================== */

:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ========================================
   SELECTION — White
   ======================================== */

::selection {
    background: var(--color-white);
    color: var(--color-background);
}

::-moz-selection {
    background: var(--color-white);
    color: var(--color-background);
}