/* ============================================
   THE EVOLUTION SIMULATOR - MAIN STYLES
   ============================================ */

/* CSS Variables */
:root {
    /* Background Colors */
    --bg-primary: #0B0F17;
    --bg-secondary: #141B2A;
    --bg-card: rgba(242, 245, 250, 0.06);
    
    /* Accent Colors */
    --accent-coral: #FF6A3D;
    --accent-ocean: #2EE6A8;
    --accent-dinosaur: #FF6A3D;
    --accent-human: #C9A86C;
    --accent-tech: #7AA3FF;
    --accent-success: #2EE6A8;
    --accent-warning: #FFD15C;
    
    /* Text Colors */
    --text-primary: #F2F5FA;
    --text-secondary: #A7B1C6;
    
    /* Border */
    --border-subtle: rgba(242, 245, 250, 0.10);
    
    /* Shadows */
    --shadow-card: 0 18px 60px rgba(0, 0, 0, 0.35);
    
    /* Typography */
    --font-display: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    
    /* Spacing */
    --section-padding: 8vh 0;
    --safe-margin: 6vw;
    
    /* Card Radius */
    --radius-large: 28px;
    --radius-medium: 18px;
    --radius-small: 12px;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: auto;
}

html.lenis, html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

h1 {
    font-size: clamp(56px, 7vw, 120px);
    text-transform: uppercase;
}

h2 {
    font-size: clamp(44px, 5vw, 96px);
    text-transform: uppercase;
}

h3 {
    font-size: clamp(32px, 3vw, 56px);
}

p {
    font-size: clamp(15px, 1.2vw, 18px);
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Label/Micro text */
.label {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
}

/* Links */
a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-coral);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 36px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--accent-coral);
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 106, 61, 0.4);
    color: var(--bg-primary);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    border-color: var(--accent-coral);
    color: var(--accent-coral);
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-large);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Stat Card */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-medium);
    padding: 24px;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-6px);
}

.stat-value {
    font-family: var(--font-display);
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 800;
    color: var(--text-primary);
    display: block;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-top: 8px;
    display: block;
}

/* Info Card */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-medium);
    padding: 32px;
    transition: all 0.3s ease;
}

.info-card:hover {
    border-color: var(--accent-coral);
    transform: translateY(-4px);
}

.info-card h4 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.info-card p {
    font-size: 14px;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px var(--safe-margin);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(11, 15, 23, 0.9) 0%, transparent 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(11, 15, 23, 0.95);
    padding: 15px var(--safe-margin);
}

.logo {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.logo span {
    color: var(--accent-coral);
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    position: relative;
    padding: 5px 0;
}

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

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

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background: var(--bg-secondary);
    z-index: 1001;
    padding: 100px 40px;
    transition: right 0.4s ease;
}

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

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-links {
    list-style: none;
}

.mobile-nav-links li {
    margin-bottom: 24px;
}

.mobile-nav-links a {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-primary);
}

/* Scroll Progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-ocean), var(--accent-dinosaur), var(--accent-human), var(--accent-tech));
    z-index: 9999;
    transform-origin: left;
    transform: scaleX(0);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 0 var(--safe-margin);
}

.hero-bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-card {
    position: relative;
    width: min(78vw, 1100px);
    min-height: min(52vh, 520px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 40px;
    z-index: 1;
}

.hero-card::before,
.hero-card::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-subtle);
}

.hero-card::before {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
}

.hero-card::after {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
}

.hero-badge {
    position: absolute;
    top: 30px;
    right: 30px;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    color: var(--text-secondary);
}

.hero h1 {
    margin-bottom: 24px;
    background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    max-width: 600px;
    margin-bottom: 40px;
    font-size: 18px;
}

/* Stage Label */
.stage-label {
    position: absolute;
    top: 10%;
    left: var(--safe-margin);
    z-index: 10;
}

.stage-label .label {
    display: block;
    margin-bottom: 8px;
}

.stage-label h2 {
    font-size: clamp(32px, 4vw, 64px);
}

/* Creature Reveal Section */
.creature-reveal {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 var(--safe-margin);
}

.creature-card {
    position: relative;
    width: min(84vw, 1200px);
    min-height: min(58vh, 560px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 60px;
    overflow: hidden;
}

.creature-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.creature-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}

.creature-content h2 {
    margin-bottom: 20px;
}

.creature-content p {
    margin-bottom: 40px;
    max-width: 420px;
}

.creature-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.creature-stats .stat-card {
    flex: 1;
    min-width: 120px;
}

/* Facts Section */
.facts-section {
    padding: var(--section-padding);
    position: relative;
}

.facts-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--safe-margin);
}

.did-you-know {
    text-align: center;
    margin-bottom: 60px;
}

.did-you-know h3 {
    margin-bottom: 24px;
}

.did-you-know p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 18px;
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Gallery */
.gallery {
    margin-top: 60px;
}

.gallery h4 {
    margin-bottom: 24px;
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: var(--radius-medium);
    overflow: hidden;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Timeline Section */
.timeline-section {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.timeline-header {
    text-align: center;
    padding-top: 100px;
    margin-bottom: 40px;
}

.timeline-container {
    position: relative;
    height: calc(100vh - 200px);
    overflow: hidden;
}

.timeline-track {
    display: flex;
    height: 100%;
    will-change: transform;
}

.timeline-era {
    min-width: 100vw;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 var(--safe-margin);
    position: relative;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-ocean), var(--accent-dinosaur), var(--accent-human), var(--accent-tech));
    border-radius: 2px;
    transform: translateY(-50%);
}

.timeline-era h3 {
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
}

.timeline-milestones {
    display: flex;
    gap: 40px;
    position: relative;
    z-index: 2;
}

.milestone-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-medium);
    padding: 30px;
    min-width: 200px;
    text-align: center;
    transition: all 0.3s ease;
}

.milestone-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-coral);
}

.milestone-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 50%;
    font-size: 28px;
}

.milestone-card h4 {
    font-size: 18px;
    margin-bottom: 8px;
}

.milestone-card p {
    font-size: 13px;
}

/* Database Section */
.database-section {
    padding: var(--section-padding);
}

.database-header {
    text-align: center;
    margin-bottom: 60px;
}

.database-header h2 {
    margin-bottom: 30px;
}

.filter-chips {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 10px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-chip:hover,
.filter-chip.active {
    background: var(--accent-coral);
    border-color: var(--accent-coral);
    color: var(--bg-primary);
}

.species-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--safe-margin);
}

.species-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-large);
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
}

.species-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-coral);
    box-shadow: var(--shadow-card);
}

.species-card.hidden {
    display: none;
}

.species-image {
    aspect-ratio: 16/10;
    overflow: hidden;
}

.species-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.species-card:hover .species-image img {
    transform: scale(1.1);
}

.species-info {
    padding: 24px;
}

.species-info h4 {
    font-size: 20px;
    margin-bottom: 8px;
}

.species-info p {
    font-size: 14px;
}

.species-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-primary);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.species-tag.ocean { color: var(--accent-ocean); }
.species-tag.dinosaur { color: var(--accent-dinosaur); }
.species-tag.human { color: var(--accent-human); }
.species-tag.tech { color: var(--accent-tech); }

/* CTA Section */
.cta-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--section-padding);
}

.cta-card {
    width: min(86vw, 1100px);
    padding: 80px 60px;
    text-align: center;
}

.cta-card h2 {
    margin-bottom: 20px;
}

.cta-card p {
    max-width: 500px;
    margin: 0 auto 40px;
    font-size: 18px;
}

.newsletter-form {
    display: flex;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 16px 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease;
}

.newsletter-form input:focus {
    border-color: var(--accent-coral);
}

.newsletter-form input::placeholder {
    color: var(--text-secondary);
}

/* Footer */
.footer {
    padding: 40px var(--safe-margin);
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.footer p {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.footer-links a {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

/* Particle Canvas */
.particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.04;
    mix-blend-mode: overlay;
    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)'/%3E%3C/svg%3E");
}

/* Stage Accent Colors */
.stage-ocean .creature-stats .stat-card:hover { border-color: var(--accent-ocean); }
.stage-ocean .info-card:hover { border-color: var(--accent-ocean); }
.stage-ocean .gallery-item { border: 1px solid rgba(46, 230, 168, 0.2); }

.stage-dinosaur .creature-stats .stat-card:hover { border-color: var(--accent-dinosaur); }
.stage-dinosaur .info-card:hover { border-color: var(--accent-dinosaur); }
.stage-dinosaur .gallery-item { border: 1px solid rgba(255, 106, 61, 0.2); }

.stage-human .creature-stats .stat-card:hover { border-color: var(--accent-human); }
.stage-human .info-card:hover { border-color: var(--accent-human); }
.stage-human .gallery-item { border: 1px solid rgba(201, 168, 108, 0.2); }

.stage-tech .creature-stats .stat-card:hover { border-color: var(--accent-tech); }
.stage-tech .info-card:hover { border-color: var(--accent-tech); }
.stage-tech .gallery-item { border: 1px solid rgba(122, 163, 255, 0.2); }

/* Responsive */
@media (max-width: 1024px) {
    .creature-card {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .creature-content p {
        max-width: 100%;
    }
    
    .creature-stats {
        justify-content: center;
    }
    
    .facts-grid,
    .species-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timeline-milestones {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero-card {
        padding: 40px 24px;
    }
    
    .creature-card {
        padding: 40px 24px;
    }
    
    .creature-image img {
        max-height: 250px;
    }
    
    .facts-grid,
    .species-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .cta-card {
        padding: 50px 30px;
    }
}

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

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }
