/* =========================================
   1. ROOT VARIABLES & THEME
   ========================================= */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --accent: #f59e0b;
    --accent-2: #10b981;
    --danger: #ef4444;
    --purple: #7c3aed;

    --bg: #f8faff;
    --bg-2: #eef2ff;
    --surface: #ffffff;
    --surface-2: #f1f5ff;
    --border: #dde4f5;
    --text: #0f172a;
    --text-2: #334155;
    --text-3: #64748b;

    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.16);
    --shadow-blue: 0 8px 32px rgba(37, 99, 235, 0.22);
    --shadow-card: 0 2px 12px rgba(37, 99, 235, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);

    --grad: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #0ea5e9 100%);
    --grad-hero: linear-gradient(135deg, #0f172a 0%, #1e2d5a 40%, #1e3a8a 70%, #0369a1 100%);
    --grad-accent: linear-gradient(135deg, #f59e0b, #ef4444);
    --grad-green: linear-gradient(135deg, #059669, #10b981);
    --grad-purple: linear-gradient(135deg, #6d28d9, #7c3aed);
    --grad-subtle: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    --ease: all 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: all 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);

    --font-display: 'DM Sans', 'Sora', -apple-system, sans-serif;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    --nav-h: 68px;
    --section-gap: 7rem;
    --max-w: 1200px;
}

[data-theme='dark'] {
    --bg: #080c14;
    --bg-2: #0d1220;
    --surface: #111827;
    --surface-2: #1a2332;
    --border: #1e2d45;
    --text: #f0f6ff;
    --text-2: #94afc8;
    --text-3: #506070;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.7);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.8);
    --shadow-blue: 0 8px 32px rgba(37, 99, 235, 0.3);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(37, 99, 235, 0.1);
    --grad-subtle: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(14, 165, 233, 0.06) 100%);
}

/* =========================================
   2. RESET & BASE
   ========================================= */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-h);
    font-size: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background 0.35s ease, color 0.35s ease;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    overflow: visible;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--ease);
}

a:hover {
    color: var(--primary-dark);
}

a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

h1,
h2,
h3,
h4 {
    line-height: 1.25;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
}

h1 {
    font-size: clamp(2.2rem, 5.5vw, 3.8rem);
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    margin-bottom: 0.5rem;
}

h3 {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    margin-bottom: 0.5rem;
}

h4 {
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    margin-bottom: 0.4rem;
}

p {
    color: var(--text-2);
    font-size: clamp(0.93rem, 1.5vw, 1.02rem);
    margin-bottom: 0.9rem;
    line-height: 1.8;
}

strong {
    color: var(--text);
    font-weight: 600;
}

ul {
    list-style: none;
}

/* =========================================
   3. SCROLL PROGRESS
   ========================================= */

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--grad);
    z-index: 10001;
    transition: width 0.08s linear;
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

/* =========================================
   4. SKIP LINK
   ========================================= */

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 1rem;
    font-weight: 600;
    z-index: 10000;
    transition: top 0.2s ease;
    border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
    top: 0;
}

/* =========================================
   5. NAVBAR — COMPLETELY REBUILT FOR MOBILE
   ========================================= */

#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(248, 250, 255, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    height: var(--nav-h);
    transition: box-shadow 0.3s ease, background 0.3s ease;
    width: 100%;
    /* Desktop: logo left, nav center/right, theme toggle + spacing on right */
    padding: 0 4rem 0 2rem;
    /* right padding leaves room for fixed theme toggle */
}

[data-theme='dark'] #navbar {
    background: rgba(8, 12, 20, 0.92);
}

#navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme='dark'] #navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.05em;
    transition: var(--ease);
    font-family: var(--font-display);
    flex-shrink: 0;
    margin-right: auto;
}

.logo:hover {
    color: var(--primary);
    transform: scale(1.05);
}

.logo-dot {
    color: var(--primary);
}

#nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#nav-menu a {
    color: var(--text-2);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-md);
    position: relative;
    transition: var(--ease);
}

#nav-menu a:hover {
    color: var(--primary);
    background: var(--bg-2);
}

#nav-menu a.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.nav-resume-btn {
    background: var(--primary) !important;
    color: #fff !important;
    padding: 0.45rem 1rem !important;
    border-radius: var(--radius-full) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    margin-left: 0.5rem;
    box-shadow: var(--shadow-blue);
    transition: var(--ease) !important;
}

.nav-resume-btn:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35) !important;
}

/* Hamburger — hidden on desktop */
#hamburger {
    display: none;
}

/* =========================================
   6. THEME TOGGLE
   ========================================= */

#theme-toggle {
    position: fixed;
    right: 1rem;
    top: 0;
    z-index: 1002;
    height: var(--nav-h);
    width: 42px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

#theme-toggle:hover {
    opacity: 0.7;
}

/* =========================================
   7. HERO
   ========================================= */

#home {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--nav-h) + 3rem) 1.5rem 4rem;
    background: var(--grad-hero);
    overflow: hidden;
    width: 100%;
}

#home::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 20% 30%, rgba(37, 99, 235, 0.25) 0%, transparent 70%),
        radial-gradient(ellipse 50% 50% at 80% 70%, rgba(14, 165, 233, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 60% 20%, rgba(124, 58, 237, 0.12) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.55;
    z-index: 0;
}

#home::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    pointer-events: none;
    z-index: 0;
}

#home>.otw-badge,
#home>.hero-avatar,
#home>h1,
#home>.tagline,
#home>.hero-bio,
#home>.hero-metrics,
#home>.hero-actions,
#home>.social-links,
#home>.scroll-hint {
    position: relative;
    z-index: 1;
}

.hero-avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.25);
    object-fit: cover;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.3), var(--shadow-xl);
    animation: avatarReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes avatarReveal {
    from {
        transform: scale(0.7);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.otw-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    animation: fadeSlideDown 0.6s ease both;
    letter-spacing: 0.02em;
}

.otw-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 1.8s ease infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

#home h1 {
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 4rem);
    animation: fadeSlideUp 0.7s ease 0.1s both;
}

.highlight {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: brightness(1.3);
}

.tagline {
    font-size: clamp(1.1rem, 2.5vw, 1.45rem);
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-bottom: 0.5rem;
    min-height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeSlideUp 0.7s ease 0.2s both;
    overflow: visible;
}

#typewriter {
    border-right: 2.5px solid var(--primary-light);
    padding-right: 3px;
    animation: blink 1s step-end infinite;
    color: var(--primary-light);
    display: inline;
}

@keyframes blink {

    0%,
    100% {
        border-right-color: var(--primary-light);
    }

    50% {
        border-right-color: transparent;
    }
}

.hero-bio {
    max-width: 600px;
    color: rgba(255, 255, 255, 0.72);
    font-size: clamp(0.93rem, 1.6vw, 1.05rem);
    margin: 0.75rem auto 1.75rem;
    line-height: 1.75;
    animation: fadeSlideUp 0.7s ease 0.3s both;
    width: 100%;
}

.hero-bio strong {
    color: #fff;
}

.hero-metrics {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    padding: 1rem 2rem;
    margin-bottom: 2rem;
    animation: fadeSlideUp 0.7s ease 0.4s both;
    backdrop-filter: blur(6px);
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1.5rem;
}

.hero-metric strong {
    color: #fff;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
}

.hero-metric span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.25rem;
}

.hero-metric-divider {
    width: 1px;
    height: 42px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeSlideUp 0.7s ease 0.5s both;
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeSlideUp 0.7s ease 0.6s both;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--ease);
    backdrop-filter: blur(4px);
}

.social-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    animation: bounceDown 2s ease infinite;
}

.scroll-hint span {
    display: block;
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent);
    margin: 0 auto;
    border-radius: var(--radius-full);
}

@keyframes bounceDown {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 0.6;
    }

    50% {
        transform: translateX(-50%) translateY(8px);
        opacity: 1;
    }
}

/* =========================================
   8. BUTTONS
   ========================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius-full);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--ease);
    text-decoration: none;
    letter-spacing: 0.01em;
    position: relative;
    white-space: nowrap;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-blue);
}

.btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
    color: #fff;
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(4px);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: #fff;
}

.btn.outline {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn.outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-2px);
}

.btn.small {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--primary);
    border: 1px solid var(--border);
    font-weight: 600;
}

.btn.small:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* =========================================
   9. SECTION COMMON STYLES
   ========================================= */

section {
    padding: var(--section-gap) 1.5rem;
    max-width: var(--max-w);
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    min-height: 0 !important;
}

section,
#main-content,
main,
.about-body,
.contact-layout,
.project-group,
.blog-grid,
.skills-grid,
.highlight-cards,
.stats,
.testimonials-grid {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

section h2 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    letter-spacing: -0.04em;
    margin-bottom: 0.4rem;
}

section h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 4px;
    background: var(--grad);
    border-radius: var(--radius-full);
    margin-top: 0.6rem;
    margin-bottom: 1.5rem;
}

.section-sub-text {
    color: var(--text-3);
    font-size: 1rem;
    margin-top: -0.5rem;
    margin-bottom: 2.5rem;
}

/* =========================================
   10. FADE-UP ANIMATION
   ========================================= */

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1), transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: none;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

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

/* =========================================
   11. ABOUT
   ========================================= */

.about-body {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-card);
    border-left: 4px solid var(--primary);
    overflow: visible !important;
}

.about-body p {
    margin-bottom: 0.85rem;
}

.about-body p:last-child {
    margin-bottom: 0;
}

.about-focus {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(14, 165, 233, 0.05));
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: var(--text-2) !important;
}

.about-focus strong {
    color: var(--primary);
}

.highlight-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.hcard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem 1.5rem;
    box-shadow: var(--shadow-card);
    transition: var(--ease);
    position: relative;
    overflow: hidden;
}

.hcard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--grad);
}

.hcard:nth-child(2)::before {
    background: var(--grad-accent);
}

.hcard:nth-child(3)::before {
    background: var(--grad-green);
}

.hcard:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.hcard-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.hcard h3 {
    color: var(--text);
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.hcard p {
    color: var(--text-3);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
}

.stats li {
    flex: 1;
    min-width: 130px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: var(--ease);
}

.stats li:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-blue);
    border-color: var(--primary);
}

.stats li strong {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.stats li:nth-child(2) strong {
    background: var(--grad-accent);
    -webkit-background-clip: text;
    background-clip: text;
}

.stats li:nth-child(3) strong {
    background: var(--grad-green);
    -webkit-background-clip: text;
    background-clip: text;
}

.stats li:nth-child(4) strong {
    background: var(--grad-purple);
    -webkit-background-clip: text;
    background-clip: text;
}

.stats li span {
    color: var(--text-3);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
    margin-top: 0.25rem;
}

/* =========================================
   12. SKILLS
   ========================================= */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.skill-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-card);
    transition: var(--ease);
    position: relative;
    overflow: hidden;
}

.skill-group::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--grad-subtle);
    opacity: 0;
    transition: var(--ease);
    pointer-events: none;
}

.skill-group:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-blue);
    border-color: rgba(37, 99, 235, 0.3);
}

.skill-group:hover::after {
    opacity: 1;
}

.skill-group h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.skill-group ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-group ul li {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    transition: var(--ease);
}

.skill-group ul li:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: scale(1.05);
}

/* =========================================
   13. PROJECTS
   ========================================= */

.project-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-3);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ease);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-blue);
}

.top-projects-strip {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(14, 165, 233, 0.04));
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.75rem;
    margin-bottom: 2.5rem;
}

.strip-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.75rem;
}

.top-projects-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.top-proj-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    font-weight: 600;
    transition: var(--ease);
}

.top-proj-chip:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.section-sub {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin: 2rem 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-sub::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.project-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 0.5rem;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: var(--shadow-card);
    transition: var(--ease);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--grad);
    opacity: 0;
    transition: var(--ease);
}

.project-card.featured::before {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, 0.25);
}

.project-card:hover::before {
    opacity: 1;
}

.project-card.hidden {
    display: none;
}

.project-meta {
    margin-bottom: 0.75rem;
}

.project-meta h4 {
    color: var(--text);
    font-size: 1.02rem;
    margin-bottom: 0.4rem;
}

.project-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.22rem 0.65rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.production {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge.impact {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge.ml {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.25);
}

.badge.fullstack {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.25);
}

.project-card p {
    color: var(--text-3);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.65;
}

.project-card ul {
    list-style: none;
    margin-bottom: 1rem;
    flex: 1;
}

.project-card ul li {
    color: var(--text-3);
    font-size: 0.88rem;
    padding: 0.25rem 0 0.25rem 1.1rem;
    position: relative;
    line-height: 1.55;
    word-break: break-word;
}

.project-card ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 0.8rem;
}

.tech-stack {
    font-family: var(--font-mono);
    font-size: 0.77rem;
    color: var(--text-3);
    background: var(--bg-2);
    border: 1px solid var(--border);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    line-height: 1.6;
    word-break: break-word;
}

.project-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: auto;
}

.project-note {
    font-size: 0.8rem;
    color: var(--text-3);
    margin: 0;
    font-style: italic;
}

/* =========================================
   14. EXPERIENCE
   ========================================= */

.experience-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.25rem 2.5rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.experience-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--grad);
}

.exp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.exp-header h3 {
    color: var(--text);
    margin-bottom: 0.2rem;
}

.company {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
}

.date {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.2);
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.experience-item>p {
    color: var(--text-2);
    margin-bottom: 1.25rem;
}

.experience-item h4 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-3);
    margin-bottom: 0.75rem;
}

.experience-item ul {
    list-style: none;
    margin-bottom: 1.5rem;
}

.experience-item ul li {
    color: var(--text-2);
    font-size: 0.92rem;
    padding: 0.4rem 0 0.4rem 1.5rem;
    position: relative;
    border-bottom: 1px solid var(--border);
    word-break: break-word;
}

.experience-item ul li:last-child {
    border-bottom: none;
}

.experience-item ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.exp-metrics {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    list-style: none;
}

.exp-metrics li {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    text-align: center;
    flex: 1;
    min-width: 100px;
    border-top: 3px solid transparent;
}

.exp-metrics li:nth-child(1) {
    border-top-color: #059669;
}

.exp-metrics li:nth-child(2) {
    border-top-color: var(--primary);
}

.exp-metrics li:nth-child(3) {
    border-top-color: #f59e0b;
}

.exp-metrics li:nth-child(4) {
    border-top-color: #7c3aed;
}

.exp-metrics li strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--text);
}

.exp-metrics li span {
    color: var(--text-3);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* =========================================
   15. EDUCATION
   ========================================= */

.education-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem 2rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: var(--ease);
}

.education-item:hover {
    transform: translateX(4px);
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: var(--shadow-blue);
}

.edu-icon {
    font-size: 2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.education-item h3 {
    margin-bottom: 0.2rem;
}

.edu-degree {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 0.3rem;
}

.education-item p {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

/* =========================================
   16. BLOG
   ========================================= */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.blog-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: var(--shadow-card);
    transition: var(--ease);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.blog-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--grad-subtle);
    opacity: 0;
    pointer-events: none;
    transition: var(--ease);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, 0.25);
}

.blog-card:hover::after {
    opacity: 1;
}

.blog-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.blog-date {
    color: var(--text-3);
    font-size: 0.8rem;
}

.blog-read {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.15);
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.blog-card h4 {
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 0.6rem;
    line-height: 1.45;
    transition: var(--ease);
}

.blog-card:hover h4 {
    color: var(--primary);
}

.blog-card p {
    color: var(--text-3);
    font-size: 0.88rem;
    flex: 1;
    margin-bottom: 1rem;
}

.blog-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.blog-tags span {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-3);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.18rem 0.6rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================
   17. TESTIMONIALS
   ========================================= */

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.testimonial-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    transition: var(--ease);
    position: relative;
    margin: 0;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 0.75rem;
    right: 1.25rem;
    font-size: 5rem;
    line-height: 1;
    font-weight: 800;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.15;
    pointer-events: none;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-blue);
    border-color: rgba(37, 99, 235, 0.25);
}

.testimonial-card p {
    color: var(--text-2);
    font-size: 0.93rem;
    font-style: italic;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

.testimonial-card footer {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.testimonial-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.testimonial-card footer strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text);
}

.testimonial-card footer span {
    font-size: 0.8rem;
    color: var(--text-3);
}

/* =========================================
   18. CERTIFICATIONS
   ========================================= */

.cert-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cert-list li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-card);
    transition: var(--ease);
    flex-wrap: wrap;
}

.cert-list li:hover {
    transform: translateX(4px);
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: var(--shadow-blue);
}

.cert-featured {
    border-left: 4px solid var(--primary) !important;
}

.cert-badge {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.25);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    flex-shrink: 0;
}

.cert-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.cert-info {
    flex: 1;
    min-width: 180px;
}

.cert-info h4 {
    color: var(--text);
    font-size: 0.97rem;
    margin-bottom: 0.25rem;
}

.cert-info p {
    color: var(--text-3);
    font-size: 0.85rem;
    margin: 0;
}

.cert-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.cert-tags span {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
}

.cert-summary {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-3);
    font-size: 0.92rem;
}

.cert-summary strong {
    color: var(--primary);
}

/* =========================================
   19. CONTACT
   ========================================= */

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 2rem;
    align-items: start;
}

.contact-info-col h3,
.contact-form-col h3 {
    color: var(--text);
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.contact-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.contact-list li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: var(--ease);
}

.contact-list li:hover {
    border-color: rgba(37, 99, 235, 0.3);
    transform: translateX(3px);
}

.contact-list li>span {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.contact-list h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-3);
    margin-bottom: 0.2rem;
}

.contact-list a {
    color: var(--text-2);
    font-size: 0.9rem;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.contact-list a:hover {
    color: var(--primary);
}

.copy-btn {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-3);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.18rem 0.6rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--ease);
    margin-left: 0.5rem;
}

.copy-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.response-note {
    color: var(--text-3);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.availability-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(16, 185, 129, 0.07);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
}

.avail-dot-wrap {
    position: relative;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.avail-pulse {
    display: block;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
}

.avail-pulse::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.3);
    animation: pulse-avail 1.8s ease infinite;
}

@keyframes pulse-avail {

    0%,
    100% {
        transform: scale(0.9);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.availability-card strong {
    color: var(--text);
    display: block;
    font-size: 0.92rem;
}

.availability-card p {
    color: var(--text-3);
    font-size: 0.8rem;
    margin: 0;
}

.contact-form-col {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 0.4rem;
}

.form-group label span {
    color: var(--danger);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.92rem;
    transition: var(--ease);
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-3);
}

.field-error {
    color: var(--danger);
    font-size: 0.8rem;
    display: block;
    margin-top: 0.25rem;
}

.form-status {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.75rem;
}

.form-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.form-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* =========================================
   20. FOOTER
   ========================================= */

footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.05em;
}

.footer-brand p {
    color: var(--text-3);
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--text-3);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--ease);
}

.footer-nav a:hover {
    color: var(--primary);
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-3);
    transition: var(--ease);
}

.footer-social a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-blue);
}

.footer-copy {
    max-width: var(--max-w);
    margin: 0 auto;
    text-align: center;
    color: var(--text-3);
    font-size: 0.82rem;
}

/* =========================================
   21. BACK TO TOP
   ========================================= */

#back-to-top {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    width: 46px;
    height: 46px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(8px);
    transition: var(--ease-spring);
    z-index: 900;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

#back-to-top:hover {
    background: var(--primary-dark);
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.45);
}

/* =========================================
   22. MISC
   ========================================= */

#nav-backdrop {
    transition: opacity 0.3s ease;
}

body.kb-nav *:focus {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

/* =========================================
   23. RESPONSIVE — LARGE
   ========================================= */

@media (min-width: 1280px) {
    section {
        padding: var(--section-gap) 2rem;
    }

    .project-group {
        grid-template-columns: repeat(3, 1fr);
    }

    .skills-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    :root {
        --max-w: 960px;
    }

    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .project-group {
        grid-template-columns: repeat(2, 1fr);
    }

    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .project-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================
   24. MOBILE NAVBAR — REBUILT FROM SCRATCH
   ========================================= */

@media (max-width: 768px) {
    :root {
        --nav-h: 60px;
        --section-gap: 4rem;
    }

    /*
     * NAVBAR LAYOUT ON MOBILE:
     * [LOGO]  ........  [THEME_TOGGLE] [HAMBURGER]
     *
     * We use padding-right to leave space for
     * the two fixed-position buttons (theme + hamburger).
     * theme-toggle: 44px wide, right: 0
     * hamburger: 48px wide, right: 44px
     * total right reserved space: 44 + 48 = 92px → padding-right: 96px
     */

    #navbar {
        padding: 0 96px 0 1rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    /* HAMBURGER — fixed, right side of nav */
    #hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;

        /* Fixed positioning so it's always in top-right */
        position: absolute;
        right: 0.5rem;
        top: 50%;
        transform: translateY(-50%);
        width: 52px;
        height: var(--nav-h);
        z-index: 1003;
        padding: 0;
    }

    #hamburger span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--text);
        border-radius: 2px;
        transition: var(--ease);
    }

    #hamburger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    #hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    #hamburger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* THEME TOGGLE — fixed, left of hamburger */
    #theme-toggle {
        position: fixed;
        top: 0;
        right: 52px;
        /* same as hamburger width */
        width: 44px;
        height: var(--nav-h);
        z-index: 1001;
        font-size: 1.05rem;
        background: transparent;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    /* NAV MENU — slide-in drawer from right */
    #nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        bottom: 0;
        height: 100vh;
        width: min(320px, 80vw);
        background: var(--surface);
        border-left: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        padding: calc(var(--nav-h) + 1rem) 1rem 2rem;
        gap: 0.2rem;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-xl);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        z-index: 1002;
        display: flex !important;
        pointer-events: none;
    }

    #nav-menu.open {
        right: 0;
        pointer-events: all;
    }

    body.nav-open #theme-toggle {
        visibility: hidden;
        pointer-events: none;
    }

    #nav-menu a {
        width: 100%;
        padding: 0.7rem 1rem;
        font-size: 0.95rem;
        border-radius: var(--radius-md);
        display: block;
        color: var(--text-2);
    }

    #nav-menu a:hover,
    #nav-menu a.active {
        color: var(--primary);
        background: rgba(37, 99, 235, 0.08);
    }

    .nav-resume-btn {
        display: flex !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 0.75rem;
        justify-content: center !important;
        text-align: center;
    }

    /* HERO */
    #home {
        padding: calc(var(--nav-h) + 2.5rem) 1rem 3rem;
    }

    .hero-avatar {
        width: 110px;
        height: 110px;
    }

    #home h1 {
        font-size: clamp(1.8rem, 6vw, 2.6rem);
    }

    .tagline {
        font-size: 1rem;
    }

    .hero-bio {
        font-size: 0.92rem;
    }

    .hero-metrics {
        flex-wrap: wrap;
        padding: 0.75rem;
        width: 100%;
        justify-content: center;
    }

    .hero-metric {
        padding: 0.5rem 0.85rem;
        flex: 1;
        min-width: 80px;
    }

    .hero-metric strong {
        font-size: 1.4rem;
    }

    .hero-metric-divider {
        display: none;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 0.5rem;
    }

    .hero-actions .btn {
        width: min(280px, 90%);
        justify-content: center;
    }

    .social-links {
        gap: 0.5rem;
    }

    .social-links a {
        font-size: 0.8rem;
        padding: 0.4rem 0.85rem;
    }

    /* ABOUT */
    .about-body {
        padding: 1.25rem;
    }

    .highlight-cards {
        grid-template-columns: 1fr;
    }

    .stats {
        flex-wrap: wrap;
    }

    .stats li {
        flex: calc(50% - 0.625rem);
        min-width: 120px;
    }

    /* SKILLS */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* PROJECTS */
    .project-group {
        grid-template-columns: 1fr;
    }

    .project-filters {
        gap: 0.4rem;
    }

    .filter-btn {
        font-size: 0.78rem;
        padding: 0.35rem 0.85rem;
    }

    .top-projects-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .top-proj-chip {
        width: 100%;
        justify-content: center;
    }

    /* EXPERIENCE */
    .experience-item {
        padding: 1.25rem;
    }

    .exp-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .exp-metrics {
        gap: 0.6rem;
    }

    .exp-metrics li {
        padding: 0.75rem;
        min-width: 70px;
    }

    .exp-metrics li strong {
        font-size: 1.2rem;
    }

    /* EDUCATION */
    .education-item {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1.25rem;
    }

    /* BLOG / TESTIMONIALS */
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    /* CERTS */
    .cert-list li {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 1rem;
    }

    .cert-list li .btn.small {
        width: 100%;
        justify-content: center;
        margin-top: 0.25rem;
    }

    /* CONTACT */
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-form-col {
        padding: 1.25rem;
    }

    /* FOOTER */
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 1.25rem;
    }

    .footer-nav {
        justify-content: center;
        gap: 1rem;
    }

    .footer-social {
        justify-content: center;
    }

    footer {
        padding: 2rem 1rem 1.5rem;
    }
}

/* =========================================
   25. SMALL MOBILE — 480px
   ========================================= */

@media (max-width: 480px) {
    :root {
        --section-gap: 3rem;
    }

    section {
        padding: 3rem 0.85rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero-avatar {
        width: 96px;
        height: 96px;
    }

    #home h1 {
        font-size: 1.7rem;
    }

    .hero-bio {
        font-size: 0.88rem;
    }

    .otw-badge {
        font-size: 0.76rem;
        padding: 0.3rem 0.85rem;
    }

    /* 2x2 grid for metrics */
    .hero-metrics {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 0.75rem;
        background: rgba(255, 255, 255, 0.06);
    }

    .hero-metric {
        padding: 0.6rem 0.5rem;
        border-radius: var(--radius-lg);
    }

    .hero-metric strong {
        font-size: 1.3rem;
    }

    .hero-metric span {
        font-size: 0.68rem;
    }

    .hero-metric-divider {
        display: none;
    }

    .stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stats li {
        padding: 1rem;
    }

    .stats li strong {
        font-size: 1.6rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .skill-group {
        padding: 1.1rem 1.25rem;
    }

    .skill-group ul li {
        font-size: 0.78rem;
        padding: 0.25rem 0.6rem;
    }

    .project-card {
        padding: 1.25rem;
    }

    .project-card ul li {
        font-size: 0.84rem;
    }

    .tech-stack {
        font-size: 0.72rem;
    }

    .exp-metrics {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .exp-metrics li {
        min-width: unset;
    }

    .cert-icon {
        font-size: 1.4rem;
    }

    .contact-form-col {
        padding: 1rem;
    }

    .form-group input,
    .form-group textarea {
        font-size: 0.88rem;
        padding: 0.6rem 0.85rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    .btn.small {
        padding: 0.35rem 0.75rem;
        font-size: 0.78rem;
    }

    #back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .scroll-hint {
        display: none;
    }

    /* Hamburger + theme on small phones */
    #hamburger {
        width: 48px;
    }

    #theme-toggle {
        right: 48px;
        width: 40px;
        font-size: 0.95rem;
    }

    #navbar {
        padding-right: 88px;
    }
}

/* =========================================
   26. VERY SMALL — 360px
   ========================================= */

@media (max-width: 360px) {
    :root {
        --nav-h: 56px;
    }

    section {
        padding: 2.5rem 0.65rem;
    }

    #home {
        padding: calc(var(--nav-h) + 1.75rem) 0.65rem 2.5rem;
    }

    #home h1 {
        font-size: 1.5rem;
    }

    .hero-avatar {
        width: 84px;
        height: 84px;
    }

    .highlight-cards {
        grid-template-columns: 1fr;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    #navbar {
        padding-right: 84px;
        padding-left: 0.65rem;
    }

    #hamburger {
        width: 44px;
    }

    #theme-toggle {
        right: 44px;
        width: 40px;
    }

    .footer-nav {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
}

/* =========================================
   27. LANDSCAPE PHONES
   ========================================= */

@media (max-height: 500px) and (orientation: landscape) {
    #home {
        min-height: unset;
        padding: calc(var(--nav-h) + 1rem) 1rem 2rem;
    }

    .hero-avatar {
        width: 80px;
        height: 80px;
        margin-bottom: 0.75rem;
    }

    .hero-metrics {
        display: none;
    }

    .scroll-hint {
        display: none;
    }

    #home h1 {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }

    .tagline {
        font-size: 0.95rem;
        min-height: 1.5rem;
    }

    .hero-bio {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .hero-actions .btn {
        width: auto;
    }
}

/* =========================================
   28. TABLET 769–1024
   ========================================= */

@media (min-width: 769px) and (max-width: 1024px) {
    #home {
        padding: calc(var(--nav-h) + 3rem) 2rem 4rem;
    }

    .project-group {
        grid-template-columns: repeat(2, 1fr);
    }

    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-layout {
        grid-template-columns: 1fr 1.3fr;
    }

    .hero-actions {
        flex-direction: row;
    }

    .hero-actions .btn {
        width: auto;
    }
}

/* =========================================
   29. PRINT
   ========================================= */

@media print {

    #navbar,
    #theme-toggle,
    #back-to-top,
    #hero-canvas,
    .scroll-hint,
    .hero-actions,
    #scroll-progress {
        display: none !important;
    }

    #home {
        min-height: unset;
        padding: 2rem;
    }

    section {
        padding: 2rem 0;
        break-inside: avoid;
    }

    * {
        box-shadow: none !important;
    }
}

/* =========================================
   30. REDUCED MOTION
   ========================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .fade-up {
        opacity: 1;
        transform: none;
    }
}
