@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-black: #000000;
    --bg-gray-900: #111827;
    --bg-gray-800: #1f2937;
    --border-gray-700: #374151;
    --text-white: #ffffff;
    --text-gray-200: #e5e7eb;
    --text-gray-300: #d1d5db;
    --text-gray-400: #9ca3af;
    --color-blue-400: #60a5fa;
    --color-blue-500: #3b82f6;
    --color-blue-600: #2563eb;
    --color-purple-400: #c084fc;
    --color-purple-500: #a855f7;
    --color-purple-600: #9333ea;
    --color-cyan-500: #06b6d4;
    --color-cyan-600: #0891b2;
    --color-green-400: #4ade80;
    --color-orange-400: #fb923c;
    --color-yellow-500: #eab308;
    --color-red-500: #ef4444;
    
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Typed Indicator */
.typed-cursor {
    color: var(--color-blue-400);
    font-weight: bold;
    animation: blink 1s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-black);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-gray-800);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-gray-700);
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

footer {
    scroll-snap-align: end;
}

body {
    background-color: var(--bg-black);
    color: var(--text-gray-300);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Base utility classes */
.font-mono { font-family: var(--font-mono); }
.text-center { text-align: center; }
.relative { position: relative; }
.absolute { position: absolute; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.max-w-7xl { max-width: 1280px; margin: 0 auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

/* Colors Texts */
.text-white { color: var(--text-white); }
.text-gray-200 { color: var(--text-gray-200); }
.text-gray-300 { color: var(--text-gray-300); }
.text-gray-400 { color: var(--text-gray-400); }
.text-blue-400 { color: var(--color-blue-400); }
.text-blue-500 { color: var(--color-blue-500); }
.text-purple-400 { color: var(--color-purple-400); }
.text-green-400 { color: var(--color-green-400); }
.text-orange-400 { color: var(--color-orange-400); }

/* Grid Layouts */
.grid-cols-1 { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.grid-cols-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
@media (max-width: 1024px) {
    .grid-cols-4, .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100; /* Increased to beat hero section z-index: 50 */
    background: transparent;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
}
.navbar.scrolled {
    background: rgba(17, 24, 39, 0.95);
    border-bottom: 1px solid var(--border-gray-700);
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 5rem;
}
.logo-box {
    width: 40px;
    height: 40px;
    background: linear-gradient(to bottom right, var(--color-blue-500), var(--color-purple-600));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--color-blue-400), var(--color-purple-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    text-decoration: none;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}
.nav-link {
    color: var(--text-gray-300);
    text-decoration: none;
    font-size: 0.875rem;
    position: relative;
    transition: color 0.3s;
}
.nav-link:hover { color: var(--color-blue-400); }
.nav-link .tag { color: var(--color-blue-400); transition: opacity 0.3s; }

/* Gradient backgrounds & grids */
.bg-gradient-site {
    background: linear-gradient(to bottom, var(--bg-black), var(--bg-gray-900), var(--bg-black));
}
.bg-grid-pattern {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    pointer-events: none;
    background-image: linear-gradient(to right, var(--color-blue-500) 1px, transparent 1px),
                      linear-gradient(to bottom, var(--color-blue-500) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Ambient glowing orbs */
.glow-orb {
    position: absolute;
    width: 24rem;
    height: 24rem;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}
.glow-blue { top: 0; left: 0; background: rgba(37, 99, 235, 0.2); }
.glow-purple { bottom: 0; right: 0; background: rgba(147, 51, 234, 0.2); }
.glow-cyan { top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(8, 145, 178, 0.1); }

/* Floating code text */
.floating-code {
    position: absolute;
    color: rgba(59, 130, 246, 0.15);
    font-size: 1.2rem;
    pointer-events: none;
    white-space: nowrap;
    animation-direction: alternate;
}
/* Generate random float animations via JS or basic keyframes */

/* Hero Title */
.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1.1;
}
.title-gradient {
    background: linear-gradient(to right, var(--color-blue-400), var(--color-purple-500), var(--color-blue-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: shine 5s linear infinite;
}
@keyframes shine {
    to { background-position: 200% center; }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    font-family: var(--font-mono);
}
.btn-primary {
    background: linear-gradient(to right, var(--color-blue-600), var(--color-purple-600));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}
.btn-secondary {
    background: var(--bg-gray-800);
    color: var(--text-gray-200);
    border: 1px solid var(--border-gray-700);
}
.btn-secondary:hover {
    border-color: var(--color-blue-500);
    color: white;
}

/* Social Buttons */
.social-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray-900);
    border: 1px solid var(--border-gray-700);
    border-radius: 0.5rem;
    color: var(--text-gray-400);
    text-decoration: none;
    transition: all 0.3s;
}
.social-btn:hover {
    background: var(--bg-gray-800);
    border-color: var(--color-blue-500);
    color: var(--color-blue-400);
}

/* Card Style (Glassmorphism Bento Box) */
.glass-card {
    background: linear-gradient(to bottom right, var(--bg-gray-900), var(--bg-gray-800));
    border: 1px solid var(--border-gray-700);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s;
}
.glass-card:not(.portfolio-card):hover {
    border-color: var(--color-blue-500);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.portfolio-card:hover {
    border-color: var(--color-blue-500);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.card-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(to bottom right, var(--color-blue-600), var(--color-purple-600));
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
}

/* Terminal Decor */
.terminal-window {
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-gray-700);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.terminal-header {
    background: var(--bg-gray-800);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-gray-700);
}
.terminal-dots {
    display: flex;
    gap: 0.5rem;
}
.terminal-dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; }
.dot-red { background: var(--color-red-500); }
.dot-yellow { background: var(--color-yellow-500); }
.dot-green { background: var(--color-green-400); }
.terminal-body {
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Section Header */
.section-tag {
    color: var(--color-blue-400);
    font-size: 0.875rem;
    display: inline-block;
    margin-bottom: 1rem;
}
.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Skill bars */
.skill-item { margin-bottom: 1.5rem; }
.skill-info { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-weight: 600; color: white;}
.progress-bg {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    height: 0.5rem;
    border-radius: 9999px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--color-blue-500), var(--color-purple-500));
    border-radius: 9999px;
}

/* Portfolio Swiper Settings */
.portfolio-swiper {
    width: 100%;
    padding: 3rem 0 4rem 0;
}
.swiper-slide.portfolio-card {
    width: 350px;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.portfolio-img-stub {
    width: 100%;
    height: 180px;
    background: var(--bg-gray-800);
    border: 1px dashed var(--border-gray-700);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.swiper-pagination-bullet { background: var(--text-gray-400); transition: all 0.3s; }
.swiper-pagination-bullet-active { background: var(--color-blue-500); width: 24px; border-radius: 8px; }
.swiper-nav-btn { color: var(--color-blue-400) !important; }
@media (max-width: 768px) {
    .swiper-nav-btn { display: none !important; }
}

/* Form Styles */
input, textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-gray-700);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: inherit;
    transition: all 0.3s;
}
input:focus, textarea:focus {
    outline: none;
    border-color: var(--color-blue-500);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Mobile Nav Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-gray-300);
    font-size: 1.5rem;
    cursor: pointer;
}
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 5rem;
        left: 0;
        right: 0;
        background: rgba(17, 24, 39, 0.98);
        flex-direction: column;
        gap: 1.5rem;
        padding: 2rem 1rem;
        border-bottom: 1px solid var(--border-gray-700);
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.5);
    }
    .nav-links.active {
        display: flex;
    }
    .mobile-toggle {
        display: block;
    }
}

/* --- Added Utility Classes to fix HTML formatting bugs --- */
.hidden { display: none !important; }
.overflow-hidden { overflow: hidden; }
.mx-auto { margin-left: auto; margin-right: auto; }
.block { display: block; }
.m-0 { margin: 0; }
.list-disc { list-style-type: disc; }

.about-bio-card { grid-column: span 2; }
@media (max-width: 768px) {
    .about-bio-card { grid-column: span 1; }
}

/* Hide terminals on medium-large screens where they conflict, show only on massive screens (>1500px) */
@media (max-width: 1500px) {
    .terminal-decor-area { display: none !important; }
}

@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:text-6xl { font-size: 3.75rem; line-height: 1; }
}
@media (min-width: 768px) {
    .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .lg\:block { display: block !important; }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    .xl\:block { display: block !important; }
}

/* Positioning & Layout Utility */
.top-24 { top: 6rem; }
.left-10 { left: 2.5rem; }
.top-1\/2 { top: 50%; }
.right-10 { right: 2.5rem; }
.bottom-8 { bottom: 2rem; }
.-translate-x-1\/2 { transform: translateX(-50%); }

/* Sizing Utility */
.w-80 { width: 20rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.max-w-4xl { max-width: 56rem; margin: 0 auto; }
.max-w-7xl { max-width: 80rem; margin: 0 auto; }

/* Text Sizes */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

/* Margins & Paddings */
.ml-4 { margin-left: 1rem; }
.ml-8 { margin-left: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.pl-4 { padding-left: 1rem; }
.pl-6 { padding-left: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

/* Borders & Colors */
.border-l { border-left: 1px solid var(--border-gray-700); }
.border-t { border-top: 1px solid var(--border-gray-700); }
.-left-\[6\.5px\] { left: -6.5px; }

.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }
.bg-blue-500 { background-color: var(--color-blue-500); }
.bg-purple-500 { background-color: var(--color-purple-500); }
.bg-gray-800 { background-color: var(--bg-gray-800); }
.text-gray-500 { color: #6b7280; }

/* --- RESTORED GSAP PRELOADER & CURSOR & LOAD MASKS --- */
body.locked { overflow: hidden !important; height: 100vh; }

.preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background-color: var(--bg-black); z-index: 9990;
    display: flex; justify-content: center; align-items: center;
}
.loader-content { position: relative; z-index: 10; text-align: center; }
.overlay-curve {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 100vh;
    background-color: var(--bg-black); z-index: 9980;
    clip-path: ellipse(150% 100% at 50% 100%);
}

.mask-box { overflow: hidden; display: block; }
.mask-text { display: block; transform: translateY(110%); }

@media (hover: hover) and (pointer: fine) {
    * { cursor: none !important; }
    .cursor-dot, .cursor-outline {
        display: block; position: fixed; top: 0; left: 0;
        transform: translate(-50%, -50%); border-radius: 50%;
        z-index: 10000; pointer-events: none;
    }
    .cursor-dot { width: 8px; height: 8px; background-color: var(--color-blue-400); }
    .cursor-outline {
        width: 40px; height: 40px; border: 1px solid rgba(96, 165, 250, 0.5);
        transition: background-color 0.2s, transform 0.1s;
    }
}
@media (hover: none), (pointer: coarse), (max-width: 991px) {
    * { cursor: auto !important; }
    .cursor-dot, .cursor-outline { display: none !important; }
}

/* Skills grid responsive */
@media (max-width: 768px) {
    #skills .reveal-content[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}