/* ==========================================================================
   1. RESET & CSS VARIABLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Color Palette - Dark Futuristic Default */
    --bg-primary: #080b10;
    --bg-secondary: #0f141c;
    --bg-tertiary: #161f2c;
    --bg-glass: rgba(15, 20, 28, 0.75);
    --bg-glass-border: rgba(255, 255, 255, 0.08);

    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;

    --accent-blue: #38bdf8;
    --accent-purple: #818cf8;
    --accent-cyan: #22d3ee;
    --accent-glow: rgba(56, 189, 248, 0.25);

    --gradient-primary: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);

    /* Typography */
    --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Transitions & Shadows */
    --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px var(--accent-glow);

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

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-glass-border: rgba(0, 0, 0, 0.08);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --accent-blue: #0284c7;
    --accent-purple: #4f46e5;
    --accent-cyan: #0891b2;
    --accent-glow: rgba(2, 132, 199, 0.15);

    --gradient-card: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.005) 100%);
}

/* ==========================================================================
   2. GENERAL STYLES & ACCESSIBILITY
   ========================================================================== */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

.skip-to-content {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--accent-blue);
    color: #fff;
    padding: 12px 20px;
    z-index: 10000;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: top var(--transition-fast);
}

.skip-to-content:focus {
    top: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
    position: relative;
    z-index: 2;
}

/* Gradient & Typography Helpers */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.text-center { text-align: center; }

.section-header {
    margin-bottom: 60px;
}

.section-subtitle {
    font-family: var(--font-mono);
    color: var(--accent-blue);
    font-size: 0.875rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
}

.section-line {
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    margin: 16px auto 0 auto;
    border-radius: var(--radius-full);
}

/* ==========================================================================
   3. BUTTONS & INTERACTIVE ELEMENTS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    border-color: var(--bg-glass-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-blue);
}

/* ==========================================================================
   4. PRELOADER
   ========================================================================== */
.preloader {
    position: fixed;
    inset: 0;
    background-color: var(--bg-primary);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    width: 300px;
}

.preloader-logo {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.logo-bracket { color: var(--accent-blue); }
.logo-text { color: var(--text-primary); }

.preloader-spinner-container {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 20px auto;
}

.preloader-spinner {
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.preloader-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 15px;
}

.preloader-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    transition: width 0.1s linear;
}

.preloader-text-wrapper {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   5. CANVAS & CUSTOM CURSOR
   ========================================================================== */
.particle-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.cursor-dot, .cursor-follower {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-blue);
}

.cursor-follower {
    width: 32px;
    height: 32px;
    border: 1px solid var(--accent-blue);
    transition: transform 0.15s ease-out, width 0.2s ease, height 0.2s ease;
}

/* Hover active cursor state */
body.cursor-hover .cursor-follower {
    width: 50px;
    height: 50px;
    background-color: rgba(56, 189, 248, 0.1);
    border-color: var(--accent-cyan);
}

/* ==========================================================================
   6. SITE HEADER & NAVIGATION
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: all var(--transition-normal);
}

.site-header.scrolled {
    padding: 12px 0;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--bg-glass-border);
}

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

.nav-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-code { color: var(--accent-blue); font-family: var(--font-mono); }
.logo-accent { color: var(--accent-purple); }

.desktop-nav .nav-list {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-blue);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-glass-border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }
[data-theme="light"] .theme-toggle .sun-icon { display: block; }
[data-theme="light"] .theme-toggle .moon-icon { display: none; }

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger-bar {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all var(--transition-fast);
}

/* Mobile menu drawer */
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-secondary);
    padding: 100px 30px;
    transition: right var(--transition-normal);
    box-shadow: var(--shadow-lg);
    z-index: 999;
}

.mobile-menu-drawer.open { right: 0; }

.mobile-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mobile-nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
}

/* ==========================================================================
   7. HERO SECTION
   ========================================================================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 140px;
    overflow: hidden;
}

.hero-bg-aurora {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.4;
    filter: blur(80px);
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    animation: float 20s infinite alternate;
}

.blob-1 { width: 400px; height: 400px; background: var(--accent-blue); top: -10%; left: -10%; }
.blob-2 { width: 500px; height: 500px; background: var(--accent-purple); bottom: -10%; right: -10%; }

.hero-grid-overlay {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--accent-blue);
    font-family: var(--font-mono);
    margin-bottom: 20px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-blue);
}

.hero-greeting {
    display: block;
    font-size: 1.25rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.hero-name-gradient {
    font-size: 3.8rem;
    font-weight: 800;
    line-height: 1.1;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.typing-container {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent-cyan);
    margin: 15px 0;
    height: 30px;
    display: flex;
    align-items: center;
}

.hero-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 540px;
    margin-bottom: 30px;
}

.hero-cta-group {
    display: flex;
    gap: 16px;
    margin-bottom: 35px;
}

.hero-socials {
    display: flex;
    gap: 16px;
}

.social-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.social-icon-btn:hover {
    background: var(--accent-blue);
    color: #fff;
    transform: translateY(-3px);
}

/* Visual developer card frame */
.developer-card-frame {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.card-glass-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.window-controls { display: flex; gap: 6px; }
.control { width: 10px; height: 10px; border-radius: 50%; }
.close { background-color: #ef4444; }
.minimize { background-color: #f59e0b; }
.maximize { background-color: #10b981; }

.window-title { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }

.profile-image-container {
    width: 100%;
    height: 240px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.code-snippet-box {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.code-keyword { color: #f472b6; }
.code-prop { color: #38bdf8; }
.code-string { color: #a3e635; }

.floating-badge {
    position: absolute;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-glass-border);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.badge-1 { top: 20px; right: -20px; }
.badge-2 { bottom: 20px; left: -20px; }

/* ==========================================================================
   8. ABOUT SECTION
   ========================================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
}

.about-bio-card {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    padding: 36px;
    border-radius: var(--radius-lg);
}

.about-heading { font-size: 1.5rem; margin-bottom: 20px; }
.about-p { color: var(--text-secondary); margin-bottom: 16px; }

.about-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.highlight-item { display: flex; gap: 12px; align-items: center; }
.highlight-icon { font-size: 1.5rem; }

.about-pillars-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.pillar-card {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    padding: 24px;
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast);
}

.pillar-card:hover { transform: translateY(-5px); border-color: var(--accent-blue); }
.pillar-icon { font-size: 2rem; margin-bottom: 10px; }
.pillar-title { font-size: 1.1rem; margin-bottom: 8px; }
.pillar-desc { font-size: 0.85rem; color: var(--text-secondary); }

/* ==========================================================================
   9. STATS SECTION
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    padding: 30px;
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--accent-blue);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 6px;
}

/* ==========================================================================
   10. SKILLS SECTION
   ========================================================================== */
.skills-disclaimer {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 40px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.skill-card {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    padding: 20px 24px;
    border-radius: var(--radius-md);
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
}

.skill-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   11. TIMELINE SECTION
   ========================================================================== */
.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: var(--bg-glass-border);
    transform: translateX(-50%);
}

.timeline-item {
    margin-bottom: 40px;
    position: relative;
    width: 50%;
}

.timeline-item.left { left: 0; padding-right: 40px; text-align: right; }
.timeline-item.right { left: 50%; padding-left: 40px; text-align: left; }

.timeline-dot {
    position: absolute;
    top: 0;
    width: 16px;
    height: 16px;
    background: var(--accent-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-blue);
}

.timeline-item.left .timeline-dot { right: -8px; }
.timeline-item.right .timeline-dot { left: -8px; }

.timeline-content {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    padding: 24px;
    border-radius: var(--radius-md);
}

.timeline-stage {
    font-family: var(--font-mono);
    color: var(--accent-blue);
    font-size: 0.8rem;
}

.timeline-title { font-size: 1.2rem; margin: 6px 0; }
.timeline-desc { font-size: 0.85rem; color: var(--text-secondary); }

/* ==========================================================================
   12. PROJECTS SECTION
   ========================================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-fast);
}

.project-card:hover { transform: translateY(-8px); border-color: var(--accent-blue); }

.project-image-box {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

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

.project-number-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--bg-primary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.project-details {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title { font-size: 1.25rem; margin-bottom: 10px; }
.project-description { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 20px; flex-grow: 1; }

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
}

.project-links {
    display: flex;
    gap: 12px;
}

/* ==========================================================================
   13. SERVICES SECTION
   ========================================================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.service-card {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    padding: 30px;
    border-radius: var(--radius-md);
}

.service-icon { font-size: 2.5rem; margin-bottom: 15px; }
.service-title { font-size: 1.2rem; margin-bottom: 10px; }
.service-desc { color: var(--text-secondary); font-size: 0.85rem; }

/* ==========================================================================
   14. CONTACT SECTION
   ========================================================================== */
.contact-card-wrapper {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    padding: 48px;
}

.contact-inner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-card-heading { font-size: 1.8rem; margin-bottom: 15px; }
.contact-card-text { color: var(--text-secondary); margin-bottom: 30px; }

.contact-methods-list { display: flex; flex-direction: column; gap: 20px; }
.method-item { display: flex; gap: 16px; align-items: center; }
.method-icon { font-size: 1.5rem; }

.contact-actions-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 24px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 700;
    transition: transform var(--transition-fast);
}

.whatsapp-btn { background-color: #25d366; color: #fff; }
.email-btn { background-color: var(--accent-blue); color: #fff; }
.call-btn { background-color: #16a085; color: #fff; }
.contact-btn:hover { transform: translateY(-3px); }

/* ==========================================================================
   15. PROJECT MODAL
   ========================================================================== */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.project-modal.active { opacity: 1; pointer-events: auto; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-container {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    padding: 30px;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-primary);
    cursor: pointer;
}

.modal-image-wrapper { height: 260px; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 20px; }
.modal-image-wrapper img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   16. FOOTER
   ========================================================================== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-glass-border);
    padding: 60px 0 30px 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.footer-logo { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); text-decoration: none; }
.footer-tagline { color: var(--text-secondary); font-size: 0.9rem; }

.back-to-top-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-bottom { text-align: center; color: var(--text-muted); font-size: 0.85rem; border-top: 1px solid var(--bg-glass-border); padding-top: 20px; }

/* ==========================================================================
   17. REVEAL ANIMATIONS & RESPONSIVE BREAKPOINTS
   ========================================================================== */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 992px) {
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-description { margin: 0 auto 30px auto; }
    .hero-cta-group { justify-content: center; }
    .hero-socials { justify-content: center; }
    .about-grid { grid-template-columns: 1fr; }
    .contact-inner-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .mobile-menu-toggle { display: flex; }
    .hero-name-gradient { font-size: 2.8rem; }
    .timeline-container::before { left: 20px; }
    .timeline-item { width: 100%; padding-left: 50px !important; text-align: left !important; }
    .timeline-item.left .timeline-dot, .timeline-item.right .timeline-dot { left: 12px; }
    .cursor-dot, .cursor-follower { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .reveal-element { opacity: 1; transform: none; }
}

/* ==========================================================================
   MOBILE + TABLET RESPONSIVE PATCH
   ========================================================================== */

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

img, svg, canvas, video {
    max-width: 100%;
}

button, a, input, textarea, select {
    -webkit-tap-highlight-color: transparent;
}

.container {
    box-sizing: border-box;
}

.hero-section,
.section {
    overflow-x: clip;
}

.hero-container,
.about-grid,
.contact-inner-grid,
.projects-grid,
.services-grid {
    min-width: 0;
}

.hero-text-content,
.hero-visual-content,
.about-bio-card,
.timeline-content,
.project-card,
.service-card,
.contact-card-wrapper {
    min-width: 0;
}

.code-snippet-box pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.profile-image-container {
    max-width: 100%;
}

.profile-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
}

.project-links {
    flex-wrap: wrap;
}

.project-links .btn {
    flex: 1 1 140px;
    justify-content: center;
}

@media (max-width: 1100px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .hero-container {
        gap: 40px;
    }

    .hero-name-gradient {
        font-size: clamp(2.8rem, 6vw, 3.8rem);
    }

    .developer-card-frame {
        padding: 18px;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .site-header {
        padding: 12px 0;
    }

    .site-header.scrolled {
        padding: 9px 0;
    }

    .header-container {
        gap: 12px;
    }

    .nav-logo {
        font-size: 1rem;
        white-space: nowrap;
    }

    .nav-actions {
        gap: 8px;
    }

    .theme-toggle {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }

    .mobile-menu-toggle {
        padding: 8px 4px;
        min-width: 42px;
        min-height: 42px;
        justify-content: center;
    }

    .mobile-menu-drawer {
        width: min(86vw, 340px);
        padding: 90px 24px 30px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-nav-list {
        gap: 18px;
    }

    .mobile-nav-link {
        display: block;
        padding: 8px 0;
        font-size: 1.05rem;
    }

    .hero-section {
        min-height: auto;
        padding-top: 105px;
        padding-bottom: 70px;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 42px;
    }

    .hero-text-content {
        width: 100%;
    }

    .hero-badge {
        max-width: 100%;
        justify-content: center;
        text-align: center;
        padding: 6px 12px;
        font-size: .76rem;
    }

    .hero-title {
        margin-bottom: 12px;
    }

    .hero-name-gradient {
        display: block;
        font-size: clamp(2.15rem, 11vw, 3rem);
        line-height: 1.08;
        overflow-wrap: anywhere;
    }

    .hero-subtitle {
        font-size: clamp(1rem, 4.5vw, 1.35rem);
        line-height: 1.35;
    }

    .typing-container {
        max-width: 100%;
        overflow-wrap: anywhere;
        font-size: .82rem;
    }

    .hero-description {
        max-width: 100%;
        font-size: .98rem;
        line-height: 1.7;
        margin-bottom: 24px;
    }

    .hero-cta-group {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 10px;
    }

    .hero-cta-group .btn {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }

    .hero-socials {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .hero-visual-content {
        width: 100%;
    }

    .developer-card-frame {
        width: 100%;
        box-sizing: border-box;
        padding: 14px;
    }

    .card-glass-header {
        gap: 8px;
        min-width: 0;
    }

    .window-title {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .7rem;
    }

    .code-snippet-box {
        overflow: hidden;
    }

    .code-snippet-box pre {
        font-size: .68rem;
        line-height: 1.6;
        padding: 12px;
    }

    .floating-badge {
        position: static !important;
        width: auto;
        max-width: 100%;
        margin-top: 10px;
        box-sizing: border-box;
    }

    .section {
        padding: 72px 0;
    }

    .section-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
    }

    .section-header {
        margin-bottom: 36px;
    }

    .about-grid,
    .contact-inner-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .about-bio-card,
    .contact-card-wrapper {
        padding: 24px 18px;
    }

    .stats-grid,
    .skills-grid {
        grid-template-columns: 1fr !important;
    }

    .timeline-container::before {
        left: 12px;
    }

    .timeline-item,
    .timeline-item.left,
    .timeline-item.right {
        width: 100%;
        left: 0;
        right: auto;
        padding: 0 0 24px 36px !important;
        text-align: left !important;
        box-sizing: border-box;
    }

    .timeline-item.left .timeline-dot,
    .timeline-item.right .timeline-dot {
        left: 4px;
        right: auto;
    }

    .timeline-content {
        width: 100%;
        box-sizing: border-box;
        padding: 20px 16px;
    }

    .projects-grid,
    .services-grid {
        grid-template-columns: 1fr !important;
        gap: 18px;
    }

    .project-image-box {
        height: 180px;
    }

    .project-details {
        padding: 18px;
    }

    .project-links {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .project-links .btn {
        width: 100%;
        box-sizing: border-box;
    }

    .service-card {
        padding: 22px 18px;
    }

    .contact-card-heading {
        font-size: 1.45rem;
    }

    .method-item {
        align-items: flex-start;
    }

    .contact-btn {
        width: 100%;
        box-sizing: border-box;
        min-height: 54px;
    }

    .modal-container {
        width: calc(100% - 24px);
        max-height: calc(100vh - 24px);
        padding: 48px 16px 20px;
        border-radius: 16px;
        box-sizing: border-box;
    }

    .modal-image-wrapper {
        height: 180px;
    }

    .modal-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .modal-actions .btn {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }

    .modal-close-btn {
        top: 8px;
        right: 12px;
        font-size: 1.8rem;
        padding: 8px;
    }

    .footer-content {
        flex-direction: column;
        gap: 22px;
        text-align: center;
        margin-bottom: 28px;
    }

    .footer-socials {
        justify-content: center;
        flex-wrap: wrap;
    }

    .footer-bottom {
        line-height: 1.6;
    }

    .particle-canvas {
        display: none;
    }
}

@media (max-width: 420px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .hero-section {
        padding-top: 92px;
    }

    .hero-name-gradient {
        font-size: clamp(2rem, 12vw, 2.55rem);
    }

    .hero-badge {
        font-size: .7rem;
    }

    .hero-socials .social-icon-btn {
        width: 42px;
        height: 42px;
    }

    .developer-card-frame {
        padding: 10px;
    }

    .code-snippet-box pre {
        font-size: .6rem;
        padding: 9px;
    }

    .project-image-box {
        height: 160px;
    }

    .contact-card-wrapper,
    .about-bio-card {
        padding: 20px 14px;
    }

    .modal-container {
        width: calc(100% - 16px);
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Touch devices: remove desktop hover transformations */
@media (hover: none), (pointer: coarse) {
    .project-card:hover,
    .btn-primary:hover,
    .contact-btn:hover {
        transform: none;
    }
}
