/* --- CSS Variables / Theming System --- */
:root {
    /* Fonts base */
    --font-primary: 'Outfit', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;

    /* Theme Transition Speeds */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;

    /* Spacing & Borders */
    --radius-md: 12px;
    --radius-lg: 20px;
}

[data-theme="dark"] {
    --bg-page: #090a0f;
    --text-primary: #ffffff;
    --text-secondary: #a0aab2;
    --accent-blue: #00d1ff;
    /* SpaceX style neon */
    --accent-red: #e31937;
    /* Tesla Red */
    --bg-glass: rgba(25, 30, 40, 0.4);
    --bg-glass-hover: rgba(40, 45, 60, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] {
    --bg-page: #f5f7fa;
    --text-primary: #12151e;
    --text-secondary: #4a5568;
    --accent-blue: #0076a8;
    --accent-red: #cc0000;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-hover: rgba(255, 255, 255, 0.9);
    --border-glass: rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-page);
    color: var(--text-primary);
    transition: background-color var(--transition-medium), color var(--transition-medium);
    overflow-x: hidden;
    line-height: 1.8;
    font-size: 1.15rem;
    /* Increased base font size */
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: transparent;
    border-bottom: 1px solid var(--border-glass);
}

.navbar .logo {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 4px;
    font-size: 1.25rem;
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: var(--bg-glass);
}

/* Custom Select Styling */
.lang-selector select {
    appearance: none;
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    padding: 0.5rem 2rem 0.5rem 1rem;
    border-radius: 6px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    cursor: pointer;
    backdrop-filter: blur(5px);
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23a0aab2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
}

.lang-selector select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 0 1rem;
}

.hero-content {
    z-index: 10;
}

.glitch {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1.1;
    position: relative;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(0, 209, 255, 0.2);
    margin-bottom: 1rem;
}

[data-theme="dark"] .glitch::before,
[data-theme="dark"] .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

[data-theme="dark"] .glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-red);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

[data-theme="dark"] .glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent-blue);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(10px, 9999px, 86px, 0);
        transform: skew(0.2deg);
    }

    10% {
        clip: rect(66px, 9999px, 98px, 0);
        transform: skew(0.6deg);
    }

    20% {
        clip: rect(17px, 9999px, 30px, 0);
        transform: skew(0.5deg);
    }

    30% {
        clip: rect(74px, 9999px, 60px, 0);
        transform: skew(0.3deg);
    }

    40% {
        clip: rect(9px, 9999px, 93px, 0);
        transform: skew(0.4deg);
    }

    50% {
        clip: rect(48px, 9999px, 2px, 0);
        transform: skew(0.6deg);
    }

    60% {
        clip: rect(32px, 9999px, 93px, 0);
        transform: skew(0.7deg);
    }

    70% {
        clip: rect(78px, 9999px, 34px, 0);
        transform: skew(0.2deg);
    }

    80% {
        clip: rect(16px, 9999px, 7px, 0);
        transform: skew(0.1deg);
    }

    90% {
        clip: rect(31px, 9999px, 4px, 0);
        transform: skew(0.3deg);
    }

    100% {
        clip: rect(4px, 9999px, 85px, 0);
        transform: skew(0.4deg);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(29px, 9999px, 30px, 0);
        transform: skew(0.8deg);
    }

    10% {
        clip: rect(88px, 9999px, 6px, 0);
        transform: skew(0.4deg);
    }

    20% {
        clip: rect(78px, 9999px, 16px, 0);
        transform: skew(0.2deg);
    }

    30% {
        clip: rect(47px, 9999px, 79px, 0);
        transform: skew(0.6deg);
    }

    40% {
        clip: rect(2px, 9999px, 57px, 0);
        transform: skew(0.5deg);
    }

    50% {
        clip: rect(78px, 9999px, 9px, 0);
        transform: skew(0.4deg);
    }

    60% {
        clip: rect(56px, 9999px, 62px, 0);
        transform: skew(0.8deg);
    }

    70% {
        clip: rect(51px, 9999px, 17px, 0);
        transform: skew(0.7deg);
    }

    80% {
        clip: rect(54px, 9999px, 9px, 0);
        transform: skew(0.8deg);
    }

    90% {
        clip: rect(73px, 9999px, 63px, 0);
        transform: skew(0.3deg);
    }

    100% {
        clip: rect(28px, 9999px, 16px, 0);
        transform: skew(0.5deg);
    }
}

.subtitle {
    font-size: 1.6rem;
    /* Increased subtitle */
    color: var(--text-secondary);
    letter-spacing: 2px;
    max-width: 800px;
    margin: 0 auto;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    letter-spacing: 1px;
    animation: bounce 2s infinite;
}

.chevron::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-bottom: 2px solid var(--accent-blue);
    border-right: 2px solid var(--accent-blue);
    transform: rotate(45deg);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-10px) translateX(-50%);
    }

    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* --- Sections & Glassmorphism --- */
.glass-section {
    padding: 6rem 0;
}

.glass-section h2 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    /* Increased h2 size */
    margin-bottom: 3rem;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

.glass-section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-blue);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.text-block p {
    font-size: 1.3rem;
    /* Increased paragraph size */
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 1.5rem;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    transition: transform var(--transition-medium), background var(--transition-medium);
}

.glass-panel:hover {
    transform: translateY(-5px);
    background: var(--bg-glass-hover);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 4rem;
    font-family: var(--font-heading);
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-red));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.5rem;
}

/* --- Timelines & Grids --- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--border-glass);
}

.timeline-item {
    position: relative;
    padding: 1.5rem;
}

.timeline-dot {
    position: absolute;
    left: -26px;
    /* -20px map to padding + 5px radius */
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: var(--accent-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-blue);
    z-index: 2;
}

.timeline-item p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.3rem;
    /* Increased timeline text size */
    line-height: 1.7;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    text-align: left;
    padding: 2rem !important;
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform var(--transition-medium);
}

.card:hover .card-image {
    transform: scale(1.03);
}

.card h3 {
    color: var(--accent-blue);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-heading);
}

.card p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    /* Increased card paragraph size */
    line-height: 1.7;
}

/* Space Background (CSS only for speed) */
[data-theme="dark"] #stars,
[data-theme="dark"] #stars2,
[data-theme="dark"] #stars3 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}

/* Simplified stars for brevity */
[data-theme="dark"] #stars {
    background: radial-gradient(1px 1px at 10% 10%, #fff, transparent), radial-gradient(1px 1px at 30% 60%, rgba(255, 255, 255, 0.8), transparent);
    background-size: 200px 200px;
    opacity: 0.3;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    border-top: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 1.05rem;
    }

    .container {
        padding: 0 1rem;
    }

    .navbar {
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        text-align: center;
    }

    .glass-section {
        padding: 4rem 0;
    }

    .glitch {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .glass-section h2 {
        font-size: 2.5rem;
        margin-bottom: 2rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .text-block p,
    .timeline-item p,
    .card p {
        font-size: 1.1rem;
    }

    .stat-value {
        font-size: 3.5rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1.5rem !important;
    }

    .timeline {
        padding-left: 15px;
    }

    .timeline-dot {
        width: 12px;
        height: 12px;
        left: -21px;
    }

    .timeline-item {
        padding: 1rem;
    }
}