:root {
    --bg-body: #0a0a0a;
    --bg-card: rgba(20, 20, 20, 0.6);
    /* Glassy */
    --accent-start: #ff4500;
    --accent-end: #ff9900;
    --text-main: #ffffff;
    --text-muted: #999;
    --border: rgba(255, 255, 255, 0.1);
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

[data-theme="light"] {
    --bg-body: #f0f0f5;
    /* Light grey-blue for clean tech look */
    --bg-card: rgba(255, 255, 255, 0.7);
    --text-main: #1a1a1a;
    --text-muted: #555;
    --border: rgba(0, 0, 0, 0.1);
    --accent-start: #ff5e00;
    /* Slightly darker orange for visibility on white */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-body);
    transition: background-color 0.4s ease;
    overflow-x: hidden;
}

/* 1. BACKGROUND (Subtle Ambiance) */
.background-anim {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.3;
    /* Very soft */
    animation: float 25s infinite alternate;
}

.b1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--accent-start);
}

.b2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--accent-end);
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 20px);
    }
}

/* Particles (Subtle Dust) */
.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent-start);
    opacity: 0.2;
    border-radius: 50%;
    animation: floatP 15s infinite linear;
}

.p1 {
    top: 20%;
    left: 15%;
}

.p2 {
    top: 70%;
    left: 85%;
    animation-duration: 20s;
}

@keyframes floatP {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        transform: translateY(-50px);
        opacity: 0;
    }
}


/* 2. FLOATING ICONS (Background Ambiance) */
.arena-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-icon {
    position: absolute;
    font-size: 80px;
    opacity: 0.08;
    animation: floatAcross 25s linear infinite;
    filter: blur(1px);
}

[data-theme="light"] .floating-icon {
    opacity: 0.12;
}

.icon-1 {
    top: 10%;
    left: -10%;
    animation-duration: 30s;
    animation-delay: 0s;
}

.icon-2 {
    top: 60%;
    left: -10%;
    animation-duration: 35s;
    animation-delay: 5s;
    font-size: 100px;
}

.icon-3 {
    top: 30%;
    left: -10%;
    animation-duration: 28s;
    animation-delay: 10s;
    font-size: 70px;
}

.icon-4 {
    top: 80%;
    left: -10%;
    animation-duration: 32s;
    animation-delay: 3s;
    font-size: 90px;
}

.icon-5 {
    top: 45%;
    left: -10%;
    animation-duration: 38s;
    animation-delay: 8s;
    font-size: 75px;
}

.icon-6 {
    top: 20%;
    left: -10%;
    animation-duration: 33s;
    animation-delay: 15s;
    font-size: 85px;
}

@keyframes floatAcross {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.08;
    }

    90% {
        opacity: 0.08;
    }

    100% {
        transform: translateX(110vw) translateY(-30px) rotate(360deg);
        opacity: 0;
    }
}


/* 3. NAVBAR */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
}



[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.85);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-btn-nav {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.theme-btn-nav:hover {
    background: var(--accent-start);
    border-color: var(--accent-start);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 69, 0, 0.3);
}

[data-theme="light"] .theme-btn-nav:hover {
    color: #fff;
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: var(--text-main);
    text-decoration: none;
    text-transform: uppercase;
}

.divider {
    color: var(--accent-start);
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bar {
    width: 100%;
    height: 2px;
    background: var(--text-main);
    transition: 0.3s;
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s ease;
}

body.menu-open .menu-overlay {
    opacity: 1;
    pointer-events: all;
}

.menu-link {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    margin: 15px 0;
    display: block;
    text-align: center;
    transition: 0.2s;
}

.menu-link:hover {
    color: var(--accent-start);
}

.theme-pill {
    margin-top: 30px;
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
}


/* 4. HERO */
.hero {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 11vw, 7.5rem);
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--accent-start));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    /* Fade in via JS */
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    opacity: 0;
}

/* Collympics themed rulebook button */
.hero-cta {
    margin-top: 20px;
}

.rulebook-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 30px;
    border: 2px solid transparent;
    background: linear-gradient(90deg, rgba(255,69,0,0.12), rgba(255,153,0,0.08));
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 8px 30px rgba(255, 69, 0, 0.06);
    transition: all 0.2s ease;
}

.rulebook-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(255, 69, 0, 0.12);
    border-color: rgba(255, 69, 0, 0.6);
}


/* 5. CARDS (Stable Glass) */
.grid-section {
    padding: 40px 5vw 100px;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    /* Pure Glass Look */
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border: 1px solid var(--border);
    border-radius: 16px;
    min-height: 300px;
    padding: 30px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    position: relative;
    overflow: hidden;

    /* Enhanced transitions */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animated gradient border effect */
.card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-start), var(--accent-end), var(--accent-start));
    border-radius: 16px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Enhanced Hover: Scale + Glow + Border */
.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 69, 0, 0.6);
    box-shadow:
        0 12px 40px rgba(255, 69, 0, 0.2),
        0 0 30px rgba(255, 69, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: rgba(255, 69, 0, 0.05);
}

.card:hover::before {
    opacity: 0.3;
}

.card:active {
    transform: translateY(-4px) scale(1.01);
    background: rgba(255, 69, 0, 0.08);
    border-color: var(--accent-start);
}

.card-header .icon {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.card-header h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1;
    color: var(--text-main);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags span {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 50px;
    margin: 4px;
}

@media(min-width: 1024px) {
    .large {
        grid-column: span 2;
        grid-row: span 2;
    }

    .wide {
        grid-column: span 2;
    }

    .tall {
        grid-row: span 2;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
    }

    .card {
        grid-column: auto !important;
        grid-row: auto !important;
        min-height: 260px;
    }
}

#toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    /* Start hidden below */

    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-start);
    /* Tangy Accent */

    padding: 12px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 2000;

    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#toast.show {
    transform: translateX(-50%) translateY(0);
    /* Slide up */
    opacity: 1;
}

.toast-msg {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

.toast-icon {
    font-size: 1rem;
}

/* Light Mode Toast */
[data-theme="light"] #toast {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}


/* 2. THE FOOTER */
.site-footer {
    padding: 60px 20px 40px;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 40px;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.2));
}

.footer-content p {
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    opacity: 0.6;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: 0.3s;
}

.footer-links a:hover {
    color: var(--accent-start);
}

.sep {
    color: var(--border);
}