/* ============================================
   ASIAN ROVER CHALLENGE - PREMIUM STYLES
   ============================================ */

:root {
    /* Core Layout Colors */
    --color-white: #ffffff;
    --color-black: #000000;
    --color-bg-dark: #f8fafc;
    /* Replaces deep space with light slate */
    --color-bg-light: #ffffff;

    /* Typography */
    --color-text-dark: #0f172a;
    --color-text-slate-700: #334155;
    --color-text-slate-600: #475569;
    --color-text-slate-500: #64748b;

    /* Primary Accents (Replaced neon with deep electric hues for contrast) */
    --color-neon-cyan: #2563eb;
    /* Electric Blue */
    --color-neon-blue: #1d4ed8;
    /* Deep Blue */
    --color-neon-purple: #6d28d9;
    /* Royal Purple */
    --color-neon-orange: #ea580c;
    /* Burnt Orange */
    --color-hover-blue: #1e3a8a;
    /* Darker hover state */

    /* Secondary Accents */
    --color-cyan-dark: #1e40af;
    --color-blue-dark: #1e3a8a;
    --color-indigo-dark: #3730a3;
    --color-orange-dark: #c2410c;
    --color-red-dark: #b91c1c;
    --color-purple-dark: #5b21b6;

    /* Translucent Overlays (Mapped to dark/blue instead of cyan/white) */
    --rgba-cyan-30: rgba(37, 99, 235, 0.3);
    --rgba-cyan-40: rgba(37, 99, 235, 0.4);
    --rgba-cyan-5: rgba(37, 99, 235, 0.05);
    --rgba-cyan-10: rgba(37, 99, 235, 0.1);
    --rgba-cyan-20: rgba(37, 99, 235, 0.2);
    --rgba-cyan-0: rgba(37, 99, 235, 0);

    /* Structural Translucency (White backgrounds -> Darker overlays for contrast) */
    --rgba-white-10: rgba(15, 23, 42, 0.05);
    --rgba-white-50: rgba(15, 23, 42, 0.15);
    --rgba-white-80: rgba(255, 255, 255, 0.9);
    --rgba-white-5: rgba(15, 23, 42, 0.03);
    --rgba-white-60: rgba(15, 23, 42, 0.6);
    --rgba-white-40: rgba(15, 23, 42, 0.4);
    --rgba-white-20: rgba(15, 23, 42, 0.1);
    --rgba-white-3: rgba(15, 23, 42, 0.02);
    --rgba-white-4: rgba(15, 23, 42, 0.04);
    --rgba-white-90: rgba(255, 255, 255, 0.95);
    --rgba-white-0: rgba(255, 255, 255, 0);

    --rgba-black-10: rgba(0, 0, 0, 0.1);
    --rgba-black-15: rgba(0, 0, 0, 0.15);
    --rgba-black-3: rgba(0, 0, 0, 0.03);
    --rgba-black-2: rgba(0, 0, 0, 0.02);

    /* Layout Backgrounds */
    --rgba-dark-80: rgba(255, 255, 255, 0.9);
    --rgba-dark-98: rgba(248, 250, 252, 0.98);
    --rgba-dark-85: rgba(255, 255, 255, 0.85);

    --rgba-slate-70: rgba(15, 23, 42, 0.7);
    --rgba-slate-5: rgba(15, 23, 42, 0.05);
    --rgba-slate-98: rgba(248, 250, 252, 0.98);

    --rgba-purple-20: rgba(109, 40, 217, 0.15);
    --rgba-purple-10: rgba(109, 40, 217, 0.08);

    --rgba-cyan-dark-0: rgba(30, 64, 175, 0);
    --rgba-blue-dark-0: rgba(30, 58, 138, 0);
    --rgba-orange-dark-0: rgba(194, 65, 12, 0);
    --rgba-auto-1: rgba(0, 245, 255, 0.02);
}

/* --- Global --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--color-neon-cyan), var(--color-neon-blue));
    border-radius: 3px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    cursor: default;
    background-color: #ffffff;
    color: #0f172a;
}

body.menu-open {
    overflow: hidden;
}

/* --- Text utility for true white text (e.g., on gradient CTAs) --- */
.text-purewhite {
    color: white;
}

.pureblack {
    background-color: rgb(0, 0, 0);
}

/* Navigation Text Contrast */
.nav-link,
.mobile-nav-link {
    color: rgba(15, 23, 42, 0.7);
}

.nav-link:hover,
.nav-link.active,
.mobile-nav-link:hover {
    color: #1e3a8a;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-menu-overlay {
    background: rgba(248, 250, 252, 0.98);
}

.hamburger span {
    background: #0f172a;
}

.hamburger.active span {
    background: #2563eb;
}

/* --- Mobile Menu Overlay --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: var(--rgba-dark-98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 55;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu-overlay.open {
    transform: translateX(0);
}

/* --- Preloader --- */
#preloader {
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-ring {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.ring-outer {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-top-color: var(--color-neon-cyan);
    border-right-color: var(--color-neon-blue);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.ring-inner {
    position: absolute;
    inset: 10px;
    border: 2px solid transparent;
    border-bottom-color: var(--color-neon-purple);
    border-left-color: var(--color-neon-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite reverse;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    animation: loadPulse 1.5s ease-in-out infinite;
}

@keyframes loadPulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

/* --- Grid Overlay --- */
.grid-overlay {
    background-image:
        linear-gradient(var(--rgba-slate-5) 1px, transparent 1px),
        linear-gradient(90deg, var(--rgba-slate-5) 1px, transparent 1px) !important;
    background-size: 60px 60px;
}

/* --- Navigation --- */
#navbar {
    background: transparent;
    z-index: 50;
}

#navbar.scrolled {
    background: var(--rgba-dark-85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--rgba-white-5);
}

.nav-link {
    position: relative;
    padding: 8px 16px;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--rgba-white-60);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-neon-cyan);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: var(--color-neon-cyan);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

.mobile-nav-link {
    color: var(--rgba-white-60);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-nav-link:hover {
    color: var(--color-neon-cyan);
    transform: translateX(10px);
}

/* --- Register Button --- */
.register-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    border: 1px solid var(--rgba-cyan-30);
    border-radius: 4px;
    color: var(--color-neon-cyan);
    text-decoration: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.register-btn:hover {
    border-color: var(--color-neon-cyan);
    box-shadow: 0 0 20px var(--rgba-cyan-20);
}

.btn-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--rgba-cyan-10), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.register-btn:hover .btn-glow {
    transform: translateX(100%);
}

/* --- CTA Buttons --- */
.primary-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 16px 32px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    overflow: hidden;
    transition: all 0.4s ease;
}

.cta-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-neon-cyan), var(--color-neon-blue), var(--color-neon-purple));
    z-index: 0;
    transition: opacity 0.3s ease;
}

.primary-cta:hover .cta-bg {
    opacity: 0.9;
}

.primary-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px var(--rgba-cyan-30);
}

.secondary-cta {
    display: inline-flex;
    align-items: center;
    padding: 16px 32px;
    border: 1px solid var(--rgba-white-20);
    border-radius: 4px;
    color: black;
    text-decoration: none;
    transition: all 0.3s ease;
}

.secondary-cta:hover {
    border-color: var(--rgba-white-50);
    color: rgb(39, 64, 206);
    background: var(--rgba-white-5);
}

/* --- Countdown --- */
.countdown-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media (min-width: 640px) {
    .countdown-grid {
        gap: 16px;
    }
}

.countdown-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--rgba-white-3);
    border: 1px solid var(--rgba-white-5);
    backdrop-filter: blur(10px);
    min-width: 58px;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .countdown-block {
        min-width: 90px;
        padding: 16px 20px;
    }
}

@media (min-width: 768px) {
    .countdown-block {
        min-width: 100px;
        padding: 16px 24px;
    }
}

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

/* --- Scroll Indicator --- */
.scroll-dot {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {

    0%,
    100% {
        transform: translateY(0);
        opacity: 1;
    }

    50% {
        transform: translateY(12px);
        opacity: 0.3;
    }
}

/* --- Stats --- */
.stat-item {
    position: relative;
    padding: 12px 0;
}

.stat-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 40%;
    background: var(--rgba-white-5);
}

.stat-item:last-child::after {
    display: none;
}

/* --- Mission Tags --- */
.mission-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    background: var(--rgba-white-3);
    border: 1px solid var(--rgba-white-5);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--rgba-white-60);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Timeline --- */
.timeline-line {
    transform-origin: top;
}

.timeline-dot {
    transition: all 0.3s ease;
}

.timeline-dot:hover {
    transform: scale(1.3);
    box-shadow: 0 0 20px currentColor;
}

/* --- About Features --- */
.about-feature {
    transition: all 0.3s ease;
}

.about-feature:hover {
    border-color: var(--rgba-white-10);
    background: var(--rgba-white-4);
    transform: translateY(-4px);
}

/* --- Sponsor Cards --- */
.sponsor-card {
    transition: all 0.3s ease;
}

.sponsor-card:hover {
    border-color: var(--rgba-cyan-20);
    background: var(--rgba-auto-1);
    transform: translateY(-4px);
}

/* --- Social Links --- */
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--rgba-white-5);
    color: var(--rgba-white-40);
    transition: all 0.3s ease;
}

.social-link:hover {
    border-color: var(--rgba-cyan-30);
    color: var(--color-neon-cyan);
    background: var(--rgba-cyan-5);
    transform: translateY(-2px);
}

/* --- Hamburger --- */
.hamburger {
    width: 24px;
    height: 18px;
    position: relative;
}

.hamburger span {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #0f172a;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger span:nth-child(3) {
    bottom: 0;
}

.hamburger.active span {
    background: var(--color-neon-cyan);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 50%;
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg);
    bottom: 50%;
}

/* --- Challenge Cards --- */
.challenge-card {
    transition: all 0.4s ease;
}

.challenge-card:hover {
    transform: translateY(-4px);
}

/* --- Register Card --- */
.register-card {
    position: relative;
    overflow: hidden;
}

.register-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-neon-cyan), var(--color-neon-blue), var(--color-neon-purple), transparent);
}

/* --- Venue Card --- */
.venue-card {
    transition: all 0.4s ease;
}

.venue-card:hover {
    border-color: var(--rgba-purple-20);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px var(--rgba-purple-10);
}

/* --- Animated Gradient Border --- */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- Floating Animation --- */
@keyframes float {

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

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

/* --- Scan Line Effect --- */
.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--rgba-cyan-30), transparent);
    animation: scanMove 4s linear infinite;
    pointer-events: none;
}

@keyframes scanMove {
    0% {
        top: -2px;
    }

    100% {
        top: 100%;
    }
}

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
    .stat-item::after {
        display: none;
    }

    .timeline-item .md\:text-right {
        text-align: left;
    }

    .hero-word-rotator {
        height: 24px;
    }

    .hero-word-rotator .font-mono {
        font-size: 11px;
    }

    .countdown-grid {
        gap: 4px;
    }

    .countdown-block {
        min-width: 52px;
        padding: 6px 6px;
    }
}

@media (max-width: 370px) {
    .countdown-block {
        min-width: 46px;
        padding: 6px 4px;
    }

    .countdown-separator {
        font-size: 14px;
    }
}

/* --- Text animation utilities --- */
.text-scramble {
    display: inline-block;
}

.char-reveal {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
}

.word-slide-up {
    display: inline-block;
    overflow: hidden;
}

.word-slide-up span {
    display: inline-block;
}

/* Glitch text effect for section headers */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch-text.active::before {
    animation: glitch1 0.3s ease forwards;
    color: var(--color-neon-cyan);
    z-index: -1;
}

.glitch-text.active::after {
    animation: glitch2 0.3s ease forwards;
    color: var(--color-neon-purple);
    z-index: -2;
}

@keyframes glitch1 {
    0% {
        opacity: 0.8;
        transform: translate(-2px, -1px);
    }

    50% {
        opacity: 0.5;
        transform: translate(2px, 1px);
    }

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

@keyframes glitch2 {
    0% {
        opacity: 0.8;
        transform: translate(2px, 1px);
    }

    50% {
        opacity: 0.5;
        transform: translate(-2px, -1px);
    }

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

/* --- Noise texture overlay --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 60;
    pointer-events: none;
    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)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Stepper Component --- */
.stepper-container {
    position: relative;
}

.stepper-track,
.stepper-progress {
    position: absolute;
    left: 47px;
    /* 24px (pl-6) + 24px (half of 48px dot) - 1px (half of 2px width) */
    top: 24px;
    /* start at the center of the first dot */
    width: 2px;
    border-radius: 1px;
}

.stepper-track {
    bottom: 24px;
    /* end at the center of the last dot */
    background: linear-gradient(to bottom, #dbeafe, #e0e7ff, #ede9fe);
}

.stepper-progress {
    background: linear-gradient(to bottom, #3b82f6, #6366f1, #8b5cf6);
    transition: height 0.7s ease;
    max-height: calc(100% - 48px);
    /* don't go past the last dot center */
}

.stepper-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 40px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stepper-step:last-child {
    margin-bottom: 0;
}

.stepper-step.stepper-active {
    opacity: 1;
    transform: translateY(0);
}

.stepper-dot {
    position: relative;
    z-index: 10;
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stepper-step:hover .stepper-dot {
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    transform: scale(1.08);
}

.stepper-step.stepper-active .stepper-dot {
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

.stepper-content {
    padding-top: 4px;
    min-height: 48px;
}

@media (min-width: 640px) {

    .stepper-track,
    .stepper-progress {
        left: 51px;
        /* 24px (pl-6) + 28px (half of 56px dot) - 1px */
        top: 28px;
    }

    .stepper-track {
        bottom: 28px;
    }

    .stepper-progress {
        max-height: calc(100% - 56px);
    }

    .stepper-dot {
        width: 56px;
        height: 56px;
        min-width: 56px;
    }

    .stepper-step {
        gap: 28px;
        margin-bottom: 48px;
    }

    .stepper-content {
        padding-top: 8px;
    }
}