/* ============================================
   LAYOUT — Background, Nav, Sections, Footer
   ============================================ */

/* Background Grid & Glow */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

.bg-glow-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--accent-1), transparent 70%);
    top: -200px; right: -100px;
    animation: glowFloat 15s ease-in-out infinite;
}

.bg-glow-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--accent-3), transparent 70%);
    bottom: -100px; left: -100px;
    animation: glowFloat 20s ease-in-out infinite reverse;
}

.bg-glow-3 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--cyan), transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: glowPulse 10s ease-in-out infinite;
    opacity: 0.15;
}

@keyframes glowFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.25; transform: translate(-50%, -50%) scale(1.2); }
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: all 0.4s var(--ease-out);
}

.nav.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: transform 0.3s var(--ease-spring);
}

.nav-logo:hover {
    transform: scale(1.05);
}

.logo-bracket {
    color: var(--accent-1);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.3s var(--ease-out);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.nav-link.active {
    color: var(--accent-1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s var(--ease-out);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out);
}

.mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

.mobile-link {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.mobile-link:hover { color: var(--text-primary); }

/* Section Shared */
.section {
    padding: var(--section-pad) 24px;
    position: relative;
    z-index: 1;
}

.section-alt {
    background: rgba(255, 255, 255, 0.01);
}

.section-inner {
    max-width: var(--container);
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 60px;
}

.section-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-1);
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    white-space: nowrap;
}

.section-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Footer */
.footer {
    padding: 40px 24px;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-year {
    margin-top: 4px;
    font-size: 0.8rem;
}
