/* ========== BASE ========== */
body {
    font-family: 'Inter', sans-serif;
    background-color: #000;
    color: #E0E0E0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: #D1D5DB;
    color: #000;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: rgba(209,213,219,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(209,213,219,0.4); }

/* ========== CUSTOM CURSOR ========== */
.cursor-dot {
    width: 8px;
    height: 8px;
    background: #D1D5DB;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    transition: transform 0.1s;
    mix-blend-mode: difference;
}
.cursor-ring {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(209, 213, 219, 0.5);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99998;
    transition: all 0.15s ease-out;
    mix-blend-mode: difference;
}
.cursor-ring.hovering {
    width: 60px;
    height: 60px;
    border-color: #D1D5DB;
    background: rgba(209, 213, 219, 0.05);
}

/* ========== ANIMATED GRID BACKGROUND ========== */
.grid-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.04;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(209, 213, 219, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(209, 213, 219, 0.3) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ========== NOISE OVERLAY ========== */
.noise-overlay {
    position: fixed;
    inset: 0;
    opacity: 0.03;
    pointer-events: none;
    z-index: 9998;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ========== SCANLINE ========== */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(209,213,219,0.2), transparent);
    z-index: 9997;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

/* ========== TEXT EFFECTS ========== */
.text-gradient-cyan {
    background: linear-gradient(135deg, #E5E7EB, #9CA3AF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-warm {
    background: linear-gradient(135deg, #F3F4F6, #6B7280);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-outline-glow {
    -webkit-text-stroke: 1px rgba(209, 213, 219, 0.4);
    color: transparent;
}

/* Glitch Effect */
.glitch {
    position: relative;
}
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}
.glitch::before {
    animation: textGlitch 3s infinite;
    color: #9CA3AF;
    z-index: -1;
}
.glitch::after {
    animation: textGlitch 3s infinite reverse;
    color: #D1D5DB;
    z-index: -2;
}

/* ========== REVEAL ANIMATIONS ========== */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(10px);
    will-change: transform, opacity, filter;
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-up.active {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    filter: blur(8px);
    will-change: transform, opacity, filter;
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    filter: blur(10px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* Delays */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }
.delay-600 { transition-delay: 0.6s; }
.delay-700 { transition-delay: 0.7s; }
.delay-800 { transition-delay: 0.8s; }

/* ========== GLOW CARD ========== */
.glow-card {
    position: relative;
    background: #0A0A0A;
    border: 1px solid #1A1A1A;
    overflow: hidden;
}
.glow-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(209, 213, 219, 0.04),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 1;
}
.glow-card:hover::before {
    opacity: 1;
}
.glow-card::after {
    content: "";
    position: absolute;
    inset: -1px;
    background: radial-gradient(
        400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(209, 213, 219, 0.1),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}
.glow-card:hover::after {
    opacity: 1;
}

/* ========== BEAM BORDER ========== */
.beam-border {
    position: relative;
    overflow: hidden;
}
.beam-border::before {
    content: "";
    position: absolute;
    inset: -2px;
    z-index: -1;
    background: conic-gradient(from 0deg at 50% 50%, #D1D5DB 0%, transparent 30%, transparent 70%, #9CA3AF 100%);
    animation: spin 6s linear infinite;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.5s;
}
.beam-border:hover::before {
    opacity: 1;
}

/* ========== MARQUEE ========== */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.marquee-track {
    animation: marquee 30s linear infinite;
}

/* ========== TERMINAL BLINK ========== */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
.cursor-blink::after {
    content: "█";
    animation: blink 1s step-end infinite;
    color: #D1D5DB;
}

/* ========== MAGNETIC BUTTON ========== */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========== CODE TYPING ========== */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}
.type-line {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #D1D5DB;
    animation: typing 2s steps(40) forwards, blink 0.8s step-end infinite alternate;
    width: 0;
}

/* ========== FLOATING ORBS ========== */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.15;
}

/* ========== HORIZONTAL RULE GLOW ========== */
.hr-glow {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(209,213,219,0.15), rgba(209,213,219,0.4), rgba(209,213,219,0.15), transparent);
    border: none;
}

/* ========== SHINE EFFECT ========== */
.btn-shine {
    position: relative;
    overflow: hidden;
}
.btn-shine::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: none;
    animation: shine 3s ease-in-out infinite;
}
@keyframes shine {
    0% { left: -100%; }
    50% { left: 150%; }
    100% { left: 150%; }
}

/* ========== KEYFRAMES ========== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes scroll-line {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}
.animate-scroll-line {
    animation: scroll-line 1.5s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

/* ========== MOBILE MENU ========== */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid rgba(255, 255, 255, 0.04);
}
.mobile-menu.open {
    right: 0;
}
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.mobile-overlay.open {
    opacity: 1;
    pointer-events: auto;
}