/* ==========================================================================
   Dhruv Salvadi - Personal Portfolio & Systems Showcase
   Modern Dark Theme with Glassmorphism, Micro-interactions & Visual Polish
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Color Palette */
    --bg-base: #08090e;
    --bg-secondary: #0f121d;
    --bg-card: rgba(18, 22, 38, 0.72);
    --bg-card-hover: rgba(26, 32, 54, 0.9);

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Accents & Gradients */
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
    --emerald-gradient: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);

    /* Borders & Glass */
    --border-light: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(99, 102, 241, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.04);

    /* Shadows */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.3);
    --shadow-glow-emerald: 0 0 25px rgba(16, 185, 129, 0.35);

    /* Spacing & Radii */
    --container-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 7rem;

    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --trans-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --trans-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-base);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Grids & Ambient Lights */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 90% 40%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
    pointer-events: none;
    z-index: 0;
}

.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.14) 0%, rgba(6, 182, 212, 0.04) 45%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    transition: opacity 0.4s ease, transform 0.1s ease-out;
    opacity: 0;
    will-change: left, top;
}

body:hover .cursor-glow {
    opacity: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.15;
    margin-bottom: var(--spacing-sm);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

h1 {
    font-size: clamp(3rem, 7vw, 5.5rem);
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: 1.35rem;
}

p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: var(--spacing-sm);
}

a {
    color: inherit;
    text-decoration: none;
    transition: all var(--trans-fast);
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    position: relative;
    z-index: 2;
}

.section {
    padding: var(--spacing-xl) 0;
    position: relative;
    z-index: 2;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Pulse dots */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    position: relative;
    display: inline-block;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    opacity: 0.7;
    animation: pulse 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.pulse-dot-cyan {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-cyan);
    position: relative;
    display: inline-block;
}

.pulse-dot-cyan::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background-color: var(--accent-cyan);
    opacity: 0.7;
    animation: pulse 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse {
    0% { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Section tags & headers */
.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.28);
    color: #a5b4fc;
    margin-bottom: 0.75rem;
}

.section-tag.emerald {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.28);
    color: #6ee7b7;
}

.section-title {
    margin-bottom: var(--spacing-md);
}

.section-title h2 {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(8, 9, 14, 0.8);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-light);
    padding: var(--spacing-sm) 0;
    transition: all var(--trans-smooth);
}

.navbar.scrolled {
    background: rgba(8, 9, 14, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform var(--trans-fast);
}

.logo:hover .logo-badge {
    transform: rotate(-6deg) scale(1.05);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    list-style: none;
}

.nav-links a.nav-link {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 0.25rem 0;
}

.nav-links a.nav-link:hover {
    color: var(--text-primary);
}

.nav-links a.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-gradient);
    transition: width var(--trans-fast);
    border-radius: var(--radius-full);
}

.nav-links a.nav-link:hover::after {
    width: 100%;
}

/* Nav MC Status Pill */
.nav-links a.mc-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #55FF55;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--trans-fast);
}

.nav-links a.mc-status:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: var(--shadow-glow-emerald);
    transform: translateY(-1px);
    color: #ffffff;
}

.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.4rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 5rem;
}

.hero::before {
    content: '';
    position: absolute;
    top: -15%;
    right: -10%;
    width: 550px;
    height: 550px;
    background: var(--accent-primary);
    filter: blur(180px);
    opacity: 0.16;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 480px;
    height: 480px;
    background: var(--accent-secondary);
    filter: blur(160px);
    opacity: 0.14;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 850px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(8px);
    margin-bottom: var(--spacing-sm);
}

.hero-subtitle {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
    display: inline-block;
}

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

.hero-description {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    max-width: 620px;
}

.cta-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.6rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--trans-fast);
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 18px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
    color: white;
}

.btn-mc {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.btn-mc:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.7);
    box-shadow: var(--shadow-glow-emerald);
    transform: translateY(-2px);
    color: #ffffff;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    backdrop-filter: blur(8px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    color: #ffffff;
}

/* ==========================================================================
   Cards & Grids
   ========================================================================== */

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-md);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform var(--trans-smooth), border-color var(--trans-smooth), box-shadow var(--trans-smooth);
    position: relative;
    overflow: hidden;
}

.card-hover:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md), 0 0 25px rgba(99, 102, 241, 0.15);
}

/* Card Icons */
.card-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    transition: transform var(--trans-fast);
}

.card:hover .card-icon-box {
    transform: scale(1.08) rotate(3deg);
}

.card-icon-box.cyan {
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.28);
    color: #22d3ee;
}

.card-icon-box.violet {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.28);
    color: #a78bfa;
}

.card-icon-box.emerald {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: #34d399;
}

/* Project Cards */
.card-project {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.card-media {
    position: relative;
    width: 100%;
    height: 200px;
    background: #111;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--trans-smooth);
}

.card-project:hover .card-img {
    transform: scale(1.05);
}

.card-badge {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(8, 9, 14, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    backdrop-filter: blur(8px);
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.contact-container {
    text-align: center;
    padding: var(--spacing-xl) 2rem;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.1) 0%, var(--bg-secondary) 75%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    max-width: 860px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.contact-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), transparent);
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    padding: var(--spacing-md) 0;
    border-top: 1px solid var(--border-light);
    margin-top: var(--spacing-xl);
    background: rgba(8, 9, 14, 0.8);
    position: relative;
    z-index: 2;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-mc-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #55FF55;
    transition: color var(--trans-fast);
}

.footer-mc-link:hover {
    color: #ffffff;
}

/* ==========================================================================
   Animations
   ========================================================================== */

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    h1 {
        font-size: 3.5rem;
    }

    .nav-links {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        background: rgba(8, 9, 14, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem 1.5rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--border-light);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
        transform: translateY(-150%);
        transition: transform 0.35s ease;
        pointer-events: none;
    }

    .nav-links.open {
        transform: translateY(0);
        pointer-events: auto;
    }

    .mobile-toggle {
        display: block;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}