/* ── BASE STYLES ── */
html, body {
    background-color: #020617;
    overflow-x: hidden;
    scroll-behavior: smooth;
    color: #cbd5e1;
}

/* Custom Scrollbar */
::-webkit-scrollbar { 
    width: 6px; 
}
::-webkit-scrollbar-track { 
    background: #020617; 
}
::-webkit-scrollbar-thumb { 
    background: #1e293b; 
    border-radius: 10px; 
}
::-webkit-scrollbar-thumb:hover { 
    background: #38bdf8; 
}

/* ── BACKGROUND LAYERS ── */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 200px;
}

/* ── GRADIENT ORBS ── */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 8s ease-in-out infinite;
}
.orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(56,189,248,0.08) 0%, transparent 70%);
    top: -100px; left: -100px;
    animation-delay: 0s;
}
.orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
    top: 40%; right: -80px;
    animation-delay: -3s;
}
.orb-3 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(56,189,248,0.05) 0%, transparent 70%);
    bottom: 10%; left: 20%;
    animation-delay: -6s;
}

@keyframes orbFloat {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

/* ── GRID LINES ── */
.grid-lines {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(56,189,248,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56,189,248,0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

/* ── LIGHTBOX ── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.98);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(15px);
}
.lightbox.active { 
    display: flex; 
}

/* ── COMPONENTS ── */
.pointer-events-none { 
    pointer-events: none; 
    user-select: none; 
}

.tool-card {
    min-height: 140px;
    position: relative;
    overflow: hidden;
}
.tool-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(56,189,248,0.08), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.tool-card:hover::before { 
    opacity: 1; 
}

.section-num {
    text-shadow: 0 0 20px rgba(56,189,248,0.4);
}

/* ── HERO GLITCH EFFECT ── */
#hero-name { 
    position: relative; 
}
#hero-name::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: #38bdf8;
    animation: glitch 6s infinite;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes glitch {
    0%, 90%, 100% { clip-path: none; transform: none; }
    92% { clip-path: polygon(0 20%, 100% 20%, 100% 30%, 0 30%); transform: translate(-3px, 0); }
    94% { clip-path: polygon(0 60%, 100% 60%, 100% 70%, 0 70%); transform: translate(3px, 0); }
    96% { clip-path: polygon(0 40%, 100% 40%, 100% 55%, 0 55%); transform: translate(-2px, 0); }
}

/* ── SCANLINE ── */
.scanline {
    position: fixed;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(transparent, rgba(56,189,248,0.05), transparent);
    z-index: 2;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}
@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* ── PROJECT CARD SHINE ── */
.project-card {
    position: relative;
    overflow: hidden;
}
.project-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 50%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
    pointer-events: none;
}
.project-card:hover::after { 
    left: 125%; 
}

/* ── FOOTER & INTERACTIVE ── */
#footer-links a.main-btn {
    position: relative;
    overflow: hidden;
}
#footer-links a.main-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(56,189,248,0.15), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}
#footer-links a.main-btn:hover::before { 
    transform: translateX(100%); 
}

nav a { 
    position: relative; 
}
nav a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 1px;
    background: #38bdf8;
    transition: width 0.3s ease;
}
nav a:hover::after { 
    width: 100%; 
}

#body-wrapper {
    position: relative;
    z-index: 10;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
    .lightbox img { 
        max-width: 95%; 
        max-height: 70%; 
    }
}