/* ============ THEME VARIABLES (DEFAULT: DARK) ============ */
:root {
    --primary: #7C3AED;
    --secondary: #2563EB;
    --bg: #030305;
    --surface: rgba(20, 20, 25, 0.6);
    --text: #FFFFFF;
    --text-muted: #A1A1AA;
    --border: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --gradient: linear-gradient(135deg, #7C3AED, #2563EB);
    --font: 'Inter', sans-serif;
}

[data-theme="light"] {
    --primary: #6D28D9;
    --secondary: #1D4ED8;
    --bg: #FAFAFA;
    --surface: rgba(255, 255, 255, 0.7);
    --text: #09090B;
    --text-muted: #52525B;
    --border: rgba(0, 0, 0, 0.08);
    --glass-border: rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #6D28D9, #1D4ED8);
}

* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

a { text-decoration: none; color: inherit; }

/* ============ CUSTOM CURSOR ============ */
.cursor-dot, .cursor-outline {
    position: fixed; top: 0; left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%; z-index: 9999; pointer-events: none;
}
.cursor-dot { width: 6px; height: 6px; background: var(--primary); }
.cursor-outline {
    width: 40px; height: 40px; border: 1px solid var(--primary);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}
.cursor-outline.hover { width: 60px; height: 60px; background: rgba(124, 58, 237, 0.1); border-color: transparent; }
@media (max-width: 768px) { .cursor-dot, .cursor-outline { display: none; } * { cursor: auto; } }

/* ============ CANVAS & OVERLAY ============ */
#webgl-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -2; }
.overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1;
    background: radial-gradient(circle at center, transparent 0%, var(--bg) 100%);
    opacity: 0.8;
}
[data-theme="light"] .overlay { background: radial-gradient(circle at center, transparent 0%, var(--bg) 90%); opacity: 0.9; }

/* ============ NAVBAR ============ */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(3, 3, 5, 0.4); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
[data-theme="light"] .navbar { background: rgba(250, 250, 250, 0.6); }

.nav-container { max-width: 1200px; margin: 0 auto; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; }
.nav-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.brand-logo { width: 32px; height: 32px; border-radius: 8px; }

/* Desktop Nav Links */
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--text-muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.github-btn { display: flex; align-items: center; gap: 6px; background: var(--surface); padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); backdrop-filter: blur(10px); }
.github-btn:hover { border-color: var(--primary); }

/* Nav Actions (Theme + Hamburger) */
.nav-actions { display: flex; align-items: center; gap: 12px; }

.theme-btn {
    background: var(--surface); border: 1px solid var(--border);
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text); transition: all 0.3s;
}
.theme-btn:hover { color: var(--primary); border-color: var(--primary); }

/* ============ HAMBURGER MENU (Mobile Only) ============ */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
    z-index: 1001;
}
.hamburger:hover { background: rgba(255, 255, 255, 0.05); }
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ HERO ============ */
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 120px 24px 60px; }
.hero-content { max-width: 900px; position: relative; z-index: 10; }
.badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); padding: 8px 20px; border-radius: 50px; font-size: 13px; font-weight: 600; margin-bottom: 30px; backdrop-filter: blur(10px); }
.dot { width: 8px; height: 8px; background: #10B981; border-radius: 50%; box-shadow: 0 0 12px #10B981; animation: pulse 2s infinite; }
.hero-title { font-size: clamp(48px, 8vw, 96px); font-weight: 900; line-height: 1.05; letter-spacing: -3px; margin-bottom: 24px; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: clamp(16px, 2vw, 20px); color: var(--text-muted); margin-bottom: 48px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 60px; }

/* ============ BUTTONS ============ */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 18px 36px; border-radius: 16px; font-weight: 700; font-size: 16px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-primary { background: var(--gradient); color: white; box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4); }
.btn-primary:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 20px 40px rgba(124, 58, 237, 0.6); }
.btn-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text); backdrop-filter: blur(10px); }
.btn-secondary:hover { border-color: var(--primary); transform: translateY(-5px); background: rgba(255,255,255,0.05); }

/* ============ STATS ============ */
.hero-stats { display: flex; justify-content: center; align-items: center; gap: 40px; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

/* ============ SECTIONS ============ */
.section { padding: 120px 24px; position: relative; }
.section-alt { background: rgba(0,0,0,0.2); }
[data-theme="light"] .section-alt { background: rgba(0,0,0,0.02); }
.container { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 80px; }
.section-header h2 { font-size: clamp(32px, 5vw, 48px); font-weight: 900; letter-spacing: -1px; }
.section-header p { color: var(--text-muted); font-size: 18px; margin-top: 12px; }

/* ============ BENTO GRID ============ */
.bento-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; perspective: 1000px; }
.bento-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 40px; position: relative; overflow: hidden; backdrop-filter: blur(20px); transition: transform 0.3s, border-color 0.3s; }
.bento-card:hover { border-color: var(--glass-border); transform: translateY(-5px); }
.bento-card .glow { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(124, 58, 237, 0.1), transparent 40%); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.bento-card:hover .glow { opacity: 1; }
.bento-card.large { grid-column: span 2; grid-row: span 2; }
.bento-card.wide { grid-column: span 2; }
.icon-box { width: 56px; height: 56px; background: rgba(124, 58, 237, 0.1); border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; border: 1px solid rgba(124, 58, 237, 0.2); }
.icon-box span { color: var(--primary); font-size: 28px; }
.bento-card h3 { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.bento-card p { color: var(--text-muted); font-size: 15px; line-height: 1.7; }
.bento-card code { background: rgba(124, 58, 237, 0.15); padding: 3px 8px; border-radius: 6px; color: var(--primary); font-weight: 600; }

/* ============ SCREENSHOTS SLIDER ============ */
.slider-container { width: 100%; overflow: hidden; cursor: grab; }
.slider-container:active { cursor: grabbing; }
.slider-track { display: flex; gap: 30px; padding: 40px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; perspective: 1200px; }
.slider-track::-webkit-scrollbar { display: none; }
.phone { flex: 0 0 auto; width: 260px; height: 540px; border-radius: 36px; border: 10px solid #1A1A1A; background: #000; overflow: hidden; transition: transform 0.4s ease, box-shadow 0.4s ease; box-shadow: 0 20px 40px rgba(0,0,0,0.5); transform: rotateY(-15deg) translateZ(-50px); }
[data-theme="light"] .phone { border-color: #E4E4E7; box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.phone img { width: 100%; height: 100%; object-fit: cover; }
.phone:hover { transform: rotateY(0deg) translateZ(0) scale(1.05); box-shadow: 0 30px 60px rgba(124, 58, 237, 0.3); z-index: 10; }

/* ============ DOWNLOAD ============ */
.glass { background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(20px); }
.download-card { text-align: center; padding: 80px 24px; border-radius: 40px; position: relative; overflow: hidden; }
.download-icon-wrap { width: 100px; height: 100px; margin: 0 auto 24px; border-radius: 24px; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.download-icon-wrap img { width: 100%; height: 100%; object-fit: cover; }
.download-card h2 { font-size: 36px; font-weight: 800; margin-bottom: 12px; }
.download-card p { color: var(--text-muted); font-size: 16px; margin-bottom: 40px; }
.meta { font-size: 13px; color: var(--text-muted); margin-top: 24px; }

/* ============ FOOTER ============ */
.footer { border-top: 1px solid var(--border); padding: 60px 24px; text-align: center; }
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.footer-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; }
.footer-brand img { width: 32px; height: 32px; border-radius: 8px; }
.footer-links { display: flex; gap: 30px; }
.footer-links a { color: var(--text-muted); font-weight: 500; }
.footer-links a:hover { color: var(--primary); }
.copyright { color: var(--text-muted); font-size: 14px; }

/* ============ ANIMATIONS ============ */
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .bento-card.large { grid-column: span 2; grid-row: span 1; }
}

@media (max-width: 768px) {
    /* Show hamburger */
    .hamburger { display: flex; }

    /* Mobile Menu Drawer */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 320px;
        height: 100vh;
        background: var(--bg);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: stretch;
        padding: 90px 24px 24px;
        gap: 8px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid var(--border);
        z-index: 1000;
        box-shadow: -20px 0 40px rgba(0, 0, 0, 0.6);
        overflow-y: auto;
    }

    [data-theme="light"] .nav-links {
        box-shadow: -20px 0 40px rgba(0, 0, 0, 0.15);
    }

    .nav-links.open { right: 0; }

    .nav-links a {
        font-size: 16px;
        width: 100%;
        padding: 14px 16px;
        border-radius: 12px;
        transition: background 0.2s;
        color: var(--text);
    }

    .nav-links a:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    [data-theme="light"] .nav-links a:hover {
        background: rgba(0, 0, 0, 0.05);
    }

    .nav-links .github-btn {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    /* Other mobile adjustments */
    .hero-actions { flex-direction: column; }
    .hero-stats { flex-wrap: wrap; gap: 20px; }
    .stat-divider { display: none; }
    .bento-grid { grid-template-columns: 1fr; }
    .bento-card.wide, .bento-card.large { grid-column: span 1; }
}