:root {
    --primary: #6366f1; /* Indigo - More premium than pure blue */
    --primary-glow: rgba(99, 102, 241, 0.3);
    --secondary: #ec4899;
    --bg-dark: #09090b;
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    --border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --container-px: 5%;
    --section-py: 8rem;
    --card-padding: 2.5rem;
}

/* Light Mode Overrides */
body.light-mode {
    --bg-dark: #f4f4f5;
    --text-main: #18181b;
    --text-muted: #71717a;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --border: rgba(0, 0, 0, 0.1);
}

/* Base reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    line-height: 1.6; 
    overflow-x: hidden; 
    -webkit-font-smoothing: antialiased; 
    transition: background-color 0.3s, color 0.3s;
    width: 100%;
}

h1, h2, h3, .brand, .card-title { font-family: 'Outfit', sans-serif; }

/* Gradient Background */
.bg-gradient {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background: radial-gradient(circle at 20% 20%, var(--primary-glow), transparent 40%),
                radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.05), transparent 40%),
                var(--bg-dark);
}

/* --- NAVIGATION --- */
.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1.5rem var(--container-px); 
    width: 100%; 
    z-index: 100; 
    gap: 1rem;
}
.navbar div { display: flex; align-items: center; gap: 1rem; }
.brand { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    font-size: 1.25rem; 
    font-weight: 800; 
    color: inherit; 
    text-decoration: none; 
    letter-spacing: -1px; 
}
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.back-link { color: var(--text-muted); text-decoration: none; font-weight: 500; transition: 0.3s; font-size: 0.85rem; padding: 0.5rem 0; }
.back-link:hover { color: var(--primary); }

/* Theme Toggle Button */
.theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    backdrop-filter: blur(10px);
}
.theme-toggle:hover { border-color: var(--primary); transform: scale(1.05); }
.theme-toggle svg { width: 18px; height: 18px; }
.sun-icon { display: none; }
body.light-mode .sun-icon { display: block; }
body.light-mode .moon-icon { display: none; }

/* --- HERO SECTION --- */
.hero { 
    min-height: 50vh; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    padding: 3rem 1.5rem; 
    text-align: center; 
}
.hero-icon, .hero-emoji { 
    display: block; 
    width: auto;
    height: auto;
    font-size: clamp(3rem, 12vw, 4.5rem);
    margin: 0 auto 1.5rem; 
    filter: drop-shadow(0 0 20px var(--primary-glow)); 
    line-height: 1;
}
.hero-icon {
    width: clamp(70px, 12vw, 90px); 
    height: clamp(70px, 12vw, 90px); 
}
.badge-group { display: flex; gap: 6px; margin-bottom: 1.5rem; flex-wrap: wrap; justify-content: center; }
.badge { background: var(--glass-bg); border: 1px solid var(--glass-border); padding: 5px 14px; border-radius: 100px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); }
.badge-os { background: rgba(34, 197, 94, 0.15) !important; border-color: rgba(34, 197, 94, 0.3) !important; color: #22c55e !important; }

/* Premium Floating OS Pill */
.os-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.project-card > div:nth-child(2) {
    margin-top: 0.4rem;
}

.project-card:hover .os-pill {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

body.light-mode .os-pill {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.hero h1 { 
    font-size: clamp(2.25rem, 10vw, 4rem); 
    font-weight: 810; 
    line-height: 1.05; 
    margin-bottom: 1.25rem; 
    letter-spacing: -1.5px; 
    color: inherit; 
    max-width: 800px;
}
body:not(.light-mode) .hero h1 { background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
body.light-mode .hero h1 { color: #18181b; }
.hero p { font-size: clamp(0.95rem, 3vw, 1.15rem); color: var(--text-muted); max-width: 650px; margin-bottom: 2.5rem; }

/* --- BUTTONS --- */
.btn-group { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; width: 100%; }
.btn { 
    padding: 1rem 2rem; 
    border-radius: 14px; 
    font-weight: 700; 
    font-size: 1rem; 
    text-decoration: none; 
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1); 
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 10px; 
    min-width: 180px;
}
.btn-primary { background: #fff; color: #000; box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1); }
body.light-mode .btn-primary { background: #18181b; color: #fff; }
.btn-primary:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(255, 255, 255, 0.15); }

/* --- GRID & CARDS --- */
.features, .projects-grid { 
    max-width: 1200px; 
    margin: 2rem auto 8rem; 
    padding: 0 var(--container-px); 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); 
    gap: 1.5rem; 
}
.feature, .project-card { 
    background: var(--glass-bg); 
    border: 1px solid var(--glass-border); 
    border-radius: 24px; 
    padding: var(--card-padding); 
    backdrop-filter: blur(10px); 
    transition: 0.4s; 
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.feature:hover, .project-card:hover { border-color: var(--primary); background: rgba(255, 255, 255, 0.05); transform: translateY(-5px); }
body.light-mode .feature, body.light-mode .project-card { background: #fff; }

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    font-size: 1.1rem;
}

body.light-mode .logo-icon {
    background: rgba(0, 0, 0, 0.03);
}

.brand .logo-icon {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border: none;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
    position: relative;
    overflow: hidden;
}

.brand .logo-icon::after {
    content: 'R';
    color: white;
    font-size: 1rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.brand .logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    opacity: 0;
    transition: 0.5s;
}

.brand:hover .logo-icon::before {
    opacity: 1;
}

.project-card:hover .logo-icon {
    transform: translateY(-4px) scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.1);
}

.project-card .card-title { font-size: 1.5rem; margin-bottom: 0.5rem; }
.project-card .card-desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }
.project-card .card-footer { 
    margin-top: auto; 
    padding-top: 1.5rem; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    color: var(--primary); 
    font-weight: 700; 
    font-size: 0.9rem; 
    transition: gap 0.3s;
}
.project-card:hover .card-footer { gap: 12px; }

/* --- RESPONSIVENESS --- */
@media (max-width: 1024px) {
    :root {
        --container-px: 5%;
        --section-py: 6rem;
    }
}

@media (max-width: 768px) {
    :root {
        --container-px: 1.25rem;
        --section-py: 4rem;
        --card-padding: 1.5rem;
    }
    
    .navbar { 
        padding: 1rem var(--container-px);
        background: rgba(9, 9, 11, 0.7);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--glass-border);
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    body.light-mode .navbar { background: rgba(255, 255, 255, 0.7); }

    .brand { font-size: 1.1rem; }
    .logo-icon { width: 32px; height: 32px; border-radius: 8px; }
    .brand .logo-icon::after { font-size: 0.8rem; }
    
    .hero { 
        padding: 4rem 1.25rem 2rem; 
        min-height: auto;
    }
    .hero h1 { 
        font-size: clamp(2.2rem, 10vw, 2.75rem);
        letter-spacing: -1.5px; 
        margin-bottom: 0.75rem; 
        line-height: 1.1;
    }
    .hero p { 
        font-size: 1rem;
        margin-bottom: 2rem; 
        line-height: 1.5;
        opacity: 0.8;
    }
    
    .btn { 
        width: 100%; 
        min-width: 0; 
        padding: 0.8rem 1.5rem; 
        font-size: 0.95rem;
        border-radius: 12px;
    }
    .btn-group { 
        gap: 0.75rem; 
        flex-direction: column;
        width: 100%;
        max-width: 400px;
    }
    
    .projects-grid, .features { 
        grid-template-columns: 1fr;
        gap: 1rem; 
        margin: 2rem auto 4rem;
        padding: 0 var(--container-px);
    }

    .project-card, .feature {
        padding: 1.5rem;
        border-radius: 20px;
    }
    
    .project-card .card-title { font-size: 1.35rem; }
    .project-card .card-desc { font-size: 0.9rem; }
    
    .os-pill {
        top: 10px;
        right: 10px;
        font-size: 0.45rem;
        padding: 2px 8px;
    }

    footer { 
        padding: 4rem 1.25rem 2rem; 
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .btn { padding: 0.75rem 1.25rem; }
    .badge { padding: 4px 10px; font-size: 0.55rem; }
    .hero h1 { font-size: 2.1rem; }
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

body > * { animation: fadeIn 0.6s ease-out forwards; }
.hero { animation: slideUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards; }
.features, .projects-grid, .mockup-container { animation: slideUp 1s cubic-bezier(0.23, 1, 0.32, 1) forwards; }

/* --- FOOTER --- */
footer { padding: var(--section-py) 2rem 4rem; text-align: center; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid var(--glass-border); }
