:root {
    --bg-color: #050505;
    --accent-color: #ffffff;
    --text-main: #eeeeee;
    --text-dim: #aaaaaa;
    --gradient-primary: linear-gradient(135deg, #ffffff 0%, #777777 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

@property --a {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Global Background */
.bg-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 1;
}

.orb {
    position: fixed;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
}
.orb-1 { top: -10%; left: -10%; background: #015482; }
.orb-2 { bottom: -10%; right: -10%; background: #251858; }

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(20px, 5%, 60px);
    box-sizing: border-box;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(5,5,5,0.8), transparent);
    backdrop-filter: blur(10px);
}

.logo {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 2px;
}
.logo span { color: #888; }

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    cursor: pointer;
    z-index: 1100;
    padding: 8px; /* touch-friendly hit area */
}
.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease;
    will-change: transform, opacity; /* GPU hint */
}

    .nav-links {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        transition: all 0.3s ease;
    }

    .nav-links a {
        color: var(--text-main);
        text-decoration: none;
        margin-left: 30px;
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        transition: color 0.3s;
    }
    .nav-links a:hover { color: #888; }

/* Animated Glowing Border Button */
.btn-login {
    position: relative;
    padding: 10px 25px;
    background: #000;
    color: #fff !important;
    border-radius: 50px;
    overflow: hidden;
    z-index: 1;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-login::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: conic-gradient(from var(--a), transparent, #fff, transparent 30%);
    animation: rotateGlow 3s linear infinite;
    z-index: -2;
}

.btn-login::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: #000;
    border-radius: 50px;
    z-index: -1;
}

@keyframes rotateGlow {
    from { --a: 0deg; }
    to { --a: 360deg; }
}

.btn-login:hover {
    box-shadow: 0 0 20px rgba(255,255,255,0.4);
    transform: scale(1.05);
}

/* Panels */
.panel {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 5% 80px 5%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

/* Hero Section */
.hero-content {
    text-align: center;
    max-width: 900px;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 900;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtext {
    font-size: clamp(1rem, 4vw, 1.2rem);
    color: var(--text-dim);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Buttons */
.btn-primary {
    background: white;
    color: black;
    padding: 15px 35px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 50px;
    transition: transform 0.3s, background 0.3s;
    display: inline-block;
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    transform: scale(1.05);
    background: #eee;
}

/* Features Section */
.section-title {
    font-size: 3rem;
    margin-bottom: 60px;
    text-align: center;
    font-weight: 800;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
    max-width: 1200px;
}

@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(15px);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.feature-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 0 20px rgba(1, 84, 130, 0.3), 0 0 40px rgba(37, 24, 88, 0.3);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

/* Mosaic Repository */
.mosaic-intro {
    text-align: center;
    margin-bottom: 50px;
}

/* GPU-compositing for animated elements */
.feature-card,
.hero-content h1,
.contact-container {
    will-change: transform, opacity;
    -webkit-transform: translateZ(0);
}

.viewport {
    width: 100%;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1500px;
    overflow: hidden; /* prevent scroll from mosaic items */
}

.mosaic-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 15px;
    width: 80vw;
    height: 70vh;
    max-width: 1000px;
    margin: 0 auto; /* explicit center */
}

/* Mosaic item styles (shared desktop + mobile) */
.mosaic-item {
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    background-color: #222;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: box-shadow 0.3s;
    will-change: transform, opacity; /* GPU compositing hint */
    -webkit-transform: translateZ(0); /* force GPU layer */
}

/* Mobile gallery grid */
/* Mosaic item styles (shared desktop + mobile) */

/* Contact Section */
.contact-container {
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}

.contact-form input, .contact-form textarea {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 12px;
    color: white;
    font-family: inherit;
}
.contact-form textarea { height: 150px; }

@media (max-width: 768px) {
    nav {
        padding: 0 20px;
        height: 70px;
    }
    
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 75vw;
        max-width: 320px;
        height: 100vh;
        transform: translateX(100%);
        background: rgba(5, 5, 5, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px); /* Safari support */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        z-index: 1050;
        box-shadow: -4px 0 30px rgba(0,0,0,0.5); /* visual boundary */
    }

    /* Solid fill strip at the top to cover the navbar gap */
    .nav-links::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: rgba(5, 5, 5, 0.97);
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links a {
        margin: 20px 0;
        font-size: 1.2rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }

    .panel {
        padding: 60px clamp(15px, 4%, 20px) clamp(30px, 8%, 50px);
    }

    /* Evidence section mobile spacing */
    #evidence {
        min-height: auto;
        display: block;
    }

    #evidence .mosaic-intro {
        padding-top: 20px;
    }

    /* Swap desktop mobile galleries */
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: block !important;
    }

    /* Ensure hamburger stays visible and in-frame */
    .menu-toggle {
        display: flex !important;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-links a {
        margin-left: 0;
        padding: 12px 0; /* larger tap targets on mobile */
    }
}
