@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

/* ==========================================
   CSS Custom Properties (Design Tokens)
   ========================================== */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-glass: rgba(17, 24, 39, 0.4);
    --border-subtle: rgba(56, 189, 248, 0.1);
    --border-glow: rgba(56, 189, 248, 0.25);
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #38bdf8;
    --accent-cyan: #22d3ee;
    --accent-purple: #a78bfa;
    --accent-pink: #f472b6;
    --gradient-primary: linear-gradient(135deg, #38bdf8 0%, #a78bfa 50%, #f472b6 100%);
    --gradient-card: linear-gradient(145deg, rgba(56, 189, 248, 0.05) 0%, rgba(167, 139, 250, 0.05) 100%);
    --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    overflow: hidden;
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow: hidden;
    height: 100%;
    -webkit-user-select: none;
    user-select: none;
}

/* ==========================================
   Mouse Trail
   ========================================== */
.mouse-trail-dot {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.9) 0%, rgba(167, 139, 250, 0.4) 60%, transparent 100%);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4), 0 0 16px rgba(167, 139, 250, 0.2);
    mix-blend-mode: screen;
}

.mouse-sparkle {
    position: fixed;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.8);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    animation: sparkleFade 0.6s ease-out forwards;
}

@keyframes sparkleFade {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0) translateY(-15px);
    }
}

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

/* ==========================================
   Navbar
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 14, 23, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 60px;
    z-index: 1000;
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition-smooth);
}

.navbar.scrolled {
    padding: 12px 60px;
    background: rgba(10, 14, 23, 0.92);
    box-shadow: var(--shadow-glow);
}

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

.navbar .logo {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Hamburger Button — hidden on desktop */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 5px 0;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 18px;
    border-radius: 50px;
    transition: var(--transition-smooth);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.08);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-blue);
    border-radius: 2px;
}

/* ==========================================
   Page Container & Pages (SPA-style)
   ========================================== */
.page-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.page.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
    z-index: 2;
}

.page.page-exit {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    z-index: 1;
}

.page.page-enter {
    animation: pageEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 40px 60px;
    min-height: calc(100vh - 120px);
}

h2 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
    max-width: 600px;
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    max-width: 900px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid var(--border-glow);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--accent-cyan);
    font-weight: 500;
    margin-bottom: 30px;
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.1); }
    50% { box-shadow: 0 0 20px 5px rgba(56, 189, 248, 0.08); }
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #f0f4f8 0%, #38bdf8 40%, #a78bfa 70%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero .typing-text {
    color: var(--text-muted);
    font-size: 1.4rem;
    font-style: italic;
    font-weight: 300;
    min-height: 2rem;
    visibility: hidden;
    border-right: 2px solid var(--accent-blue);
    animation: blink 1s step-end infinite;
    display: inline-block;
    padding-right: 4px;
}

@keyframes blink {
    50% { border-color: transparent; }
}

.hero > p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

/* Challenges Box */
.challenges {
    margin-top: 50px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.challenges::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.challenges:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.challenges h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 12px;
}

.challenges p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* Challenge Tags */
.challenge-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.challenge-tags span {
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid var(--border-subtle);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.challenge-tags span:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.1);
    transform: translateY(-2px);
}

/* ==========================================
   About Section — Content Box
   ========================================== */
.content {
    max-width: 800px;
    text-align: left;
}

.content p {
    margin-bottom: 20px;
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.9;
}

.content strong {
    color: var(--accent-blue);
    font-weight: 600;
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 30px 40px;
    text-align: center;
    transition: var(--transition-smooth);
    min-width: 160px;
}

.stat-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
}

/* ==========================================
   Projects Section
   ========================================== */
.coming-soon {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    padding: 50px;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-glow);
    margin-top: 20px;
    max-width: 600px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.coming-soon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(56, 189, 248, 0.03) 25%, transparent 50%);
    animation: rotateBg 8s linear infinite;
}

@keyframes rotateBg {
    100% { transform: rotate(360deg); }
}

.coming-soon:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow);
}

.coming-soon h3 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.coming-soon p {
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

/* ==========================================
   Contact Section
   ========================================== */
.contact-info {
    max-width: 600px;
}

.contact-info p {
    margin: 14px 0;
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.contact-info p:hover {
    color: var(--text-primary);
    transform: translateX(4px);
}

.contact-info a {
    color: var(--accent-blue);
    text-decoration: none;
    position: relative;
    transition: var(--transition-smooth);
}

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

.contact-info a:hover::after {
    width: 100%;
}

.partner-box {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    margin-top: 30px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.partner-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.partner-box:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.partner-box h3 {
    color: var(--accent-cyan);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.partner-box p {
    color: var(--text-secondary);
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    background: rgba(10, 14, 23, 0.95);
    text-align: center;
    padding: 50px 20px;
    border-top: 1px solid var(--border-subtle);
    position: relative;
    z-index: 1;
}

.footer h4 {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.sponsor-logo {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: #fff;
    padding: 12px 36px;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
    margin: 10px 0 24px;
    letter-spacing: 0.5px;
    transition: var(--transition-smooth);
}

.sponsor-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.3);
}

.footer > p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================
   Animations
   ========================================== */

/* (Page transition animations are defined in the .page rules above) */

/* Staggered Children */
.animate-child {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-child.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Float Animation */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* Glow Pulse */
.glow-pulse {
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(56, 189, 248, 0.1); }
    50% { box-shadow: 0 0 25px rgba(56, 189, 248, 0.2); }
}

/* ==========================================
   Scrollbar
   ========================================== */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-glow);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* ==========================================
   Selection
   ========================================== */
::selection {
    background: rgba(56, 189, 248, 0.2);
    color: #fff;
}

/* ==========================================
   Responsive — Tablet (≤ 768px)
   ========================================== */
@media (max-width: 768px) {
    /* --- Navbar: hamburger menu --- */
    .navbar {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }

    .navbar.scrolled {
        padding: 0;
    }

    .nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 20px;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 0 20px 16px;
        gap: 4px;
        background: rgba(10, 14, 23, 0.95);
        border-top: 1px solid var(--border-subtle);
    }

    .nav-links.open {
        display: flex;
        animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 12px 16px;
        border-radius: var(--radius-sm);
        font-size: 0.95rem;
        text-align: left;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-links a.active::after {
        bottom: auto;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 18px;
        border-radius: 2px;
    }

    /* --- Page Content --- */
    .page-content {
        padding: 80px 20px 40px;
        justify-content: flex-start;
        padding-top: 90px;
        min-height: auto;
    }

    /* --- Hero --- */
    .hero {
        max-width: 100%;
        padding: 0;
    }

    .hero-badge {
        font-size: 0.78rem;
        padding: 6px 14px;
        margin-bottom: 20px;
    }

    .hero h1 {
        font-size: 2.2rem;
        letter-spacing: -1px;
        line-height: 1.15;
        margin-bottom: 10px;
    }

    .hero .typing-text {
        font-size: 1rem;
    }

    .hero > p {
        font-size: 0.95rem;
        margin: 0 auto 24px;
        line-height: 1.7;
    }

    /* --- Challenges --- */
    .challenges {
        margin-top: 24px;
        padding: 24px 18px;
    }

    .challenges h3 {
        font-size: 1.2rem;
    }

    .challenges p {
        font-size: 0.92rem;
    }

    .challenge-tags {
        gap: 8px;
    }

    .challenge-tags span {
        padding: 5px 12px;
        font-size: 0.8rem;
    }

    /* --- Section Titles --- */
    h2 {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 28px;
    }

    /* --- About Section --- */
    .content {
        max-width: 100%;
    }

    .content p {
        font-size: 0.95rem;
    }

    .stats-row {
        flex-direction: row;
        gap: 12px;
    }

    .stat-card {
        flex: 1;
        min-width: 0;
        padding: 20px 12px;
    }

    .stat-card .stat-number {
        font-size: 1.8rem;
    }

    .stat-card .stat-label {
        font-size: 0.72rem;
        letter-spacing: 0.5px;
    }

    /* --- Projects --- */
    .coming-soon {
        padding: 30px 20px;
        max-width: 100%;
    }

    .coming-soon h3 {
        font-size: 1.3rem;
    }

    /* --- Contact --- */
    .contact-info {
        max-width: 100%;
        text-align: left;
    }

    .contact-info p {
        font-size: 0.95rem;
        word-break: break-word;
    }

    .partner-box {
        padding: 24px 18px;
    }

    .partner-box h3 {
        font-size: 1.1rem;
    }

    /* --- Footer --- */
    .footer {
        padding: 30px 16px;
    }

    .footer h4 {
        font-size: 0.75rem;
        letter-spacing: 1.5px;
    }

    .sponsor-logo {
        padding: 10px 28px;
        font-size: 0.95rem;
    }

    .footer > p {
        font-size: 0.78rem;
    }

    /* --- Hide mouse trail on touch devices --- */
    .mouse-trail-dot,
    .mouse-sparkle {
        display: none !important;
    }
}

/* ==========================================
   Responsive — Small Phone (≤ 480px)
   ========================================== */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
        letter-spacing: -0.5px;
    }

    .hero .typing-text {
        font-size: 0.88rem;
    }

    .hero > p {
        font-size: 0.88rem;
    }

    h2 {
        font-size: 1.65rem;
    }

    .section-subtitle {
        font-size: 0.88rem;
    }

    .page-content {
        padding: 80px 16px 30px;
    }

    .challenges {
        padding: 20px 14px;
    }

    .challenges h3 {
        font-size: 1.05rem;
    }

    .challenge-tags span {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .stats-row {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .stat-card {
        width: 100%;
        max-width: 260px;
        padding: 18px 16px;
    }

    .stat-card .stat-number {
        font-size: 2rem;
    }

    .contact-info p {
        font-size: 0.88rem;
    }

    .partner-box {
        padding: 20px 14px;
    }
}

/* ==========================================
   Responsive — Large Desktop (≥ 1400px)
   ========================================== */
@media (min-width: 1400px) {
    .navbar {
        padding: 18px 100px;
    }

    .navbar.scrolled {
        padding: 12px 100px;
    }

    .page-content {
        padding: 100px 80px 60px;
    }
}

/* ==========================================
   Touch device optimizations
   ========================================== */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects that don't work on touch */
    .challenges:hover {
        transform: none;
    }

    .partner-box:hover {
        transform: none;
    }

    .stat-card:hover {
        transform: none;
    }

    .contact-info p:hover {
        transform: none;
    }

    .challenge-tags span:hover {
        transform: none;
    }

    /* Ensure adequate tap targets */
    .nav-links a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}