:root {
    --bg: #000000;
    --fg: #ffffff;
    --fg-dim: #94a3b8;
    --accent: #00f2ff;
    --nav-bg: rgba(10, 10, 10, 0.85);
    --border: rgba(255, 255, 255, 0.05);
    /* Subtled from 0.1 */
    --card-bg: rgba(255, 255, 255, 0.03);
    --font-heading: 'Outfit', sans-serif;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    --radius: 24px;
    --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--grain);
    opacity: 0.04;
    pointer-events: none;
    z-index: 10000;
}

body.light-mode::before {
    opacity: 0.02;
}

body.light-mode {
    --bg: #f8fafc;
    --fg: #0f172a;
    --fg-dim: #64748b;
    --accent: #6366f1;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --border: rgba(0, 0, 0, 0.04);
    /* Subtled from 0.08 */
    --card-bg: rgba(255, 255, 255, 0.5);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.6s ease, color 0.6s ease, border-color 0.6s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-heading);
    line-height: 1.6;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body.loading {
    overflow: hidden;
}

/* Preloader */
#loader {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 1s cubic-bezier(1, 0, 0, 1), opacity 0.8s ease;
}

#loader.fade-out {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    width: 300px;
    text-align: center;
}

.loader-text {
    font-size: 12px;
    letter-spacing: 4px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
    font-family: monospace;
}

.loader-bar-bg {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.loader-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.loader-percentage {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    font-family: monospace;
}

/* Scroll Progress */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #a855f7);
    z-index: 2001;
    transition: width 0.1s;
}

/* Custom Cursor */
@media (pointer: fine) {

    body,
    a,
    button,
    .theme-toggle,
    .exp-role,
    .btn-primary,
    .btn-outline,
    .btn-icon,
    .btn-project,
    .project-mockup {
        cursor: none;
    }
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent);
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    transition: transform 0.1s;
}

.cursor-outline {
    width: 36px;
    height: 36px;
    border: 1px solid var(--accent);
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9998;
    pointer-events: none;
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.cursor-outline.hover {
    width: 64px;
    height: 64px;
    background-color: rgba(0, 242, 255, 0.1);
    border-color: rgba(0, 242, 255, 0.5);
    backdrop-filter: blur(2px);
}

body.light-mode .cursor-outline.hover {
    background-color: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.5);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Scroll Animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-on-scroll.revealed::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    transform: skewX(-25deg);
    animation: glass-shine 1.5s ease-in-out forwards;
    pointer-events: none;
}

@keyframes glass-shine {
    0% {
        left: -150%;
    }

    100% {
        left: 200%;
    }
}

/* Staggered Reveal */
.stagger-reveal>* {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.stagger-reveal.revealed>* {
    opacity: 1;
    transform: translateY(0);
}

.stagger-reveal.revealed>*:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-reveal.revealed>*:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-reveal.revealed>*:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-reveal.revealed>*:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger-reveal.revealed>*:nth-child(5) {
    transition-delay: 0.5s;
}

.stagger-reveal.revealed>*:nth-child(6) {
    transition-delay: 0.6s;
}

/* Background Overlay */
#canvas-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
}

#canvas-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouseX, 50%) var(--mouseY, 50%), rgba(0, 242, 255, 0.03) 0%, transparent 60%);
    pointer-events: none;
}

.container {
    max-width: 1400px;
    /* Widened from 1200px */
    margin: 0 auto;
    padding: 0 60px;
}

/* Navigation Architecture */
.top-nav {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--nav-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 8px 12px;
    z-index: 2000;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    width: max-content;
    min-width: 600px;
    transition: top 0.4s ease, transform 0.4s ease;
}

.top-nav.nav-hidden {
    top: -100px;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 0 24px;
}

.nav-container a {
    text-decoration: none;
    color: var(--fg-dim);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
    padding: 10px;
}

.nav-container a.hover-effect {
    color: var(--fg);
}

.nav-container a:hover {
    color: var(--fg);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px;
    border-radius: 100px;
}

.theme-toggle i {
    font-size: 14px;
    color: var(--fg-dim);
    transition: color 0.3s ease;
}

.toggle-track {
    width: 44px;
    height: 22px;
    background: var(--border);
    border-radius: 100px;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-thumb {
    width: 16px;
    height: 16px;
    background: var(--fg);
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.light-mode .toggle-thumb {
    transform: translateX(22px);
}

body.light-mode .fa-sun {
    color: #f7df1e;
}

body:not(.light-mode) .fa-moon {
    color: #f1f5f9;
}

/* Hero Epicness */
.hero-v2 {
    min-height: 100vh;
    padding: 120px 0 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Spotlight Style for Glass Cards */
.spotlight-card {
    position: relative;
    overflow: hidden;
}

.card-spotlight {
    position: absolute;
    inset: 0;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.06),
            transparent 40%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.spotlight-card:hover .card-spotlight {
    opacity: 1;
}

body.light-mode .card-spotlight {
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y),
            rgba(0, 0, 0, 0.03),
            transparent 40%);
}

.section-header h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 20px;
    color: var(--fg);
}

.title-line {
    width: 80px;
    height: 4px;
    background: var(--accent);
    border-radius: 10px;
    margin-bottom: 40px;
}

.section-header.right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.section-header.right .title-line {
    margin-left: auto;
}

.section-header.center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.section-header.center .title-line {
    margin: 0 auto 40px;
}

.hero-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 60px;
    width: 100%;
    margin-bottom: 80px;
}

.hero-text-content {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.availability-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 14px;
    margin-bottom: 30px;
    backdrop-filter: blur(15px);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.pulse-dot {
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 10px #10b981;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid #10b981;
    border-radius: 50%;
    animation: beacon 2s ease-out infinite;
}

@keyframes beacon {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        transform: scale(3.5);
        opacity: 0;
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(.7);
        opacity: 1;
    }

    80%,
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(.7);
        opacity: 1;
    }

    80%,
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

.hero-v2 h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 25px;
    letter-spacing: -2px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

body.light-mode .gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    margin-bottom: 40px;
}

.typing-container {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 300;
    color: var(--fg);
    margin-bottom: 15px;
    height: 1.2em;
    /* To prevent layout shift */
    display: flex;
    align-items: center;
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background-color: var(--accent);
    margin-left: 5px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.location-text {
    font-size: 18px;
    color: var(--fg-dim);
    display: flex;
    align-items: center;
    gap: 10px;
}

.location-text i {
    color: var(--accent);
}

.hero-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.btn-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--fg);
    font-size: 24px;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-icon:hover {
    background: var(--fg);
    color: var(--bg);
    transform: translateY(-5px);
    border-color: transparent;
}

.btn-primary {
    background: var(--fg);
    color: var(--bg);
    padding: 16px 45px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.2);
    filter: brightness(1.1);
}

.btn-outline {
    background: var(--glass);
    color: var(--fg);
    border: 1px solid var(--border);
    padding: 16px 45px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-outline:hover {
    background: var(--fg);
    color: var(--bg);
    transform: translateY(-5px);
    border-color: transparent;
}

body.light-mode .btn-primary {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.light-mode .btn-primary:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Hero Visuals & Avatar */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    z-index: 1;
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--card-bg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2;
    filter: saturate(1.1) contrast(1.05);
}

.avatar-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110%;
    height: 110%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.3;
    z-index: 1;
    border-radius: 50%;
    animation: pulse-glow 4s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.2;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.4;
    }
}

.floating-icon {
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 3;
    animation: float 6s ease-in-out infinite;
}

.floating-icon i {
    color: var(--fg);
}

body:not(.light-mode) .floating-icon i.devicon-threejs-original {
    color: #fff;
}

.icon-1 {
    top: 10%;
    left: -5%;
    animation-delay: 0s;
}

.icon-2 {
    top: 20%;
    right: -10%;
    animation-delay: -1.5s;
}

.icon-3 {
    bottom: 15%;
    right: -5%;
    animation-delay: -3s;
}

.icon-4 {
    bottom: 5%;
    left: 0%;
    animation-delay: -4.5s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Infinity Marquee */
.hero-tech-marquee {
    width: calc(100% + 160px);
    /* Account for padding */
    margin-left: -80px;
    margin-right: -80px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}

body.light-mode .hero-tech-marquee {
    background: rgba(255, 255, 255, 0.3);
}

.marquee-content {
    display: inline-flex;
    animation: scroll-marquee 30s linear infinite;
    gap: 40px;
    padding-left: 40px;
}

.marquee-content span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--fg-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.marquee-content span i {
    font-size: 20px;
}

@keyframes scroll-marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 20px));
    }
}

/* Responsive adjustments */
@media (max-width: 968px) {
    .hero-inner-card {
        padding: 60px 30px 40px;
    }

    .hero-content-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 60px;
    }

    .hero-text-content {
        align-items: center;
        text-align: center;
    }

    .hero-v2 h1 {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .typing-container {
        justify-content: center;
    }

    .hero-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-tech-marquee {
        width: calc(100% + 60px);
        margin-left: -30px;
        margin-right: -30px;
    }
}

/* Experience Tiles */
.experience-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 80px;
}

.exp-sidebar {
    position: sticky;
    top: 150px;
    height: max-content;
}

.exp-role {
    padding: 24px 32px;
    color: var(--fg-dim);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.exp-role.active {
    color: var(--accent);
    background: var(--card-bg);
    border: 1px solid var(--border);
}

.exp-main {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 80px 60px 60px;
    /* Extra top padding for floating header */
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-height: 480px;
    position: relative;
    overflow: visible;
    /* Allow header to float outside */
}

.exp-header {
    position: absolute;
    top: -40px;
    left: 40px;
    right: 40px;
    background: var(--fg);
    color: var(--bg);
    padding: 24px 40px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.exp-header.highlight {
    background: var(--accent);
    color: #111;
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.3);
}

.exp-header-top {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 2px;
}

.exp-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.exp-title-group h3 {
    font-size: 24px;
    margin: 0;
    line-height: 1.2;
    font-weight: 800;
}

.exp-company {
    font-size: 14px;
    opacity: 0.8;
    margin: 4px 0 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-status {
    background: rgba(0, 0, 0, 0.1);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-status.working {
    background: rgba(255, 255, 255, 0.2);
}

.exp-content {
    display: none;
    padding-top: 20px;
}

.exp-content.active {
    display: block;
}

/* Header fades in without moving to stay stable */
.exp-content.active .exp-header {
    animation: expHeaderFade 0.4s ease forwards;
}

/* Description content slides up smoothly */
.exp-content.active>*:not(.exp-header) {
    animation: expContentSlide 0.8s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes expHeaderFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes expContentSlide {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.exp-skills {
    display: flex;
    gap: 12px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.skill-tag {
    background: var(--border);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    color: var(--fg);
    backdrop-filter: blur(5px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Project Masterpieces */
.project-v2 {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 80px;
    align-items: center;
    margin-bottom: 120px;
}

.project-v2.reverse {
    grid-template-columns: 0.8fr 1.2fr;
}

/* Wide image for projects like VeriForce */
.project-v2.wide-image {
    grid-template-columns: 0.8fr 1.2fr;
}

.project-v2.wide-image.reverse {
    grid-template-columns: 1.2fr 0.8fr;
}

.project-mockup {
    position: relative;
    perspective: 1200px;
    z-index: 1;
}

.project-mockup img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.4s ease, filter 0.4s ease, transform 0.15s ease-out;
    filter: brightness(0.85);
    transform-style: preserve-3d;
    will-change: transform;
    display: block;
}

.project-v2:hover .project-mockup img {
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
    filter: brightness(1.05);
}

.project-details {
    position: relative;
    z-index: 2;
}

.project-details h3 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 25px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -2px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 35px;
}

.tech-pill {
    padding: 10px 22px;
    border-radius: 100px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tech-pill:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

.tech-pill i {
    font-size: 16px;
}

.tech-python {
    background: #f0f7ff;
    border-color: #3776ab;
}

.tech-js {
    background: #fffdf0;
    border-color: #f7df1e;
}

.tech-three {
    background: #f8f8f8;
    border-color: #000;
}

.tech-supabase {
    background: #f0fff4;
    border-color: #3ecf8e;
}

.tech-react {
    background: #f0fcff;
    border-color: #61dafb;
}

.tech-tailwind {
    background: #f0fdff;
    border-color: #06b6d4;
}

.tech-django {
    background: #f0fff4;
    border-color: #092e20;
}

.tech-sqlite {
    background: #f0f7ff;
    border-color: #003b57;
}

.tech-figma {
    background: #fff5f0;
    border-color: #f24e1e;
}

.tech-api {
    background: #f8f0ff;
    border-color: #9333ea;
}

.tech-celery {
    background: #f0fdf4;
    border-color: #37814a;
}

.tech-pytorch {
    background: #fffafa;
    border-color: #ee4c2c;
}

.tech-docker {
    background: #f0f9ff;
    border-color: #2496ed;
}

.tech-postgresql {
    background: #f0f7ff;
    border-color: #336791;
}

.project-details::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 150px;
    height: 150px;
    background: var(--accent);
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
}

.tech-stack .tech-pill:nth-child(even) {
    transform: translateY(4px);
}

.tech-stack .tech-pill:nth-child(3n) {
    transform: translateY(-4px);
}

.tech-pill:hover {
    transform: translateY(-12px) scale(1.1) !important;
}

.project-desc {
    font-size: 19px;
    line-height: 1.6;
    color: var(--fg-dim);
    margin-bottom: 40px;
    font-weight: 300;
}

.btn-project {
    background: var(--fg);
    color: var(--bg);
    padding: 16px 40px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.05);
}

.btn-project:nth-child(2) {
    background: var(--glass);
    color: var(--fg);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    box-shadow: none;
}

.btn-project:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.15);
    filter: brightness(1.1);
}

.btn-project:nth-child(2):hover {
    background: var(--fg);
    color: var(--bg);
    border-color: transparent;
}

/* About Card Enhancement */
.about-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 60px;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 60px;
    align-items: flex-start;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.about-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, transparent 20%);
    opacity: 0.05;
    pointer-events: none;
}

.about-image {
    width: 100%;
    aspect-ratio: 1/1.2;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.1) contrast(1.05);
}

.about-name {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 30px;
    letter-spacing: -2px;
}

.about-bio {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--fg-dim);
    margin-bottom: 20px;
    max-width: 800px;
}

.about-bio strong {
    color: var(--fg);
    font-weight: 600;
}

/* Base Layout & Section Spacing */
.section-v2 {
    padding: 100px 0;
}

/* CTA Section (Chirag-inspired) */
.cta-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 120px 40px;
    position: relative;
    overflow: hidden;
    /* High-fidelity Graph Paper Background */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 35px 35px;
}

.cta-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cta-content h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.cta-content p {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 50px;
    color: var(--fg);
}

.footer-v2 {
    padding: 80px 0 60px;
}

.footer-content {
    border-top: 1px solid var(--border);
    padding-top: 40px;
    text-align: center;
    color: var(--fg-dim);
    font-size: 14px;
}

/* Responsiveness */
@media (max-width: 1100px) {
    .about-card {
        grid-template-columns: 1fr;
        padding: 40px;
        gap: 40px;
    }

    .about-image {
        max-width: 400px;
        margin: 0 auto;
    }

    .about-name {
        font-size: 2.5rem;
        text-align: center;
    }

    .about-bio {
        text-align: center;
        margin: 0 auto 20px;
    }
}

@media (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }

    .project-v2,
    .project-v2.reverse,
    .project-v2.wide-image,
    .project-v2.wide-image.reverse {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .experience-grid {
        grid-template-columns: 1fr;
    }

    .exp-sidebar {
        position: static;
        margin-bottom: 60px;
    }
}

/* Premium Mobile Responsive Polish (< 768px) */
@media (max-width: 768px) {
    /* Complete clipping to eliminate horizontal scrolls on mobile */
    section {
        overflow: hidden !important;
    }

    #canvas-wrapper,
    #main-canvas {
        width: 100vw !important;
        overflow: hidden !important;
    }

    /* Premium Navigation Bar Rescale */
    .top-nav {
        min-width: 0 !important;
        width: calc(100% - 24px) !important;
        max-width: calc(100% - 24px) !important;
        top: 12px;
        padding: 4px 8px;
        box-sizing: border-box;
    }

    .nav-container {
        gap: 4px;
        padding: 0;
        justify-content: space-around;
    }

    .nav-container a {
        font-size: 10px;
        letter-spacing: 0;
        padding: 6px 3px;
    }

    .theme-toggle {
        gap: 4px;
        padding: 2px;
    }

    .theme-toggle i {
        display: none !important; /* Hide moon/sun icons on mobile to reclaim critical width */
    }

    .toggle-track {
        width: 28px;
        height: 14px;
        margin: 0 4px;
    }

    .toggle-thumb {
        width: 8px;
        height: 8px;
        top: 3px;
        left: 3px;
    }

    body.light-mode .toggle-thumb {
        transform: translateX(14px);
    }

    /* Experience Section Mobile Restyling */
    .exp-sidebar {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 12px;
        margin-bottom: 40px;
        padding-bottom: 8px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none; /* Hide scrollbars in Firefox */
        -ms-overflow-style: none; /* Hide scrollbars in IE/Edge */
        -webkit-overflow-scrolling: touch;
    }

    .exp-sidebar::-webkit-scrollbar {
        display: none; /* Hide scrollbars in Chrome/Safari */
    }

    .exp-role {
        padding: 12px 24px;
        font-size: 13px;
        margin-bottom: 0;
        white-space: nowrap;
        text-align: center;
        flex: 1 0 auto;
        scroll-snap-align: start;
    }

    .exp-main {
        padding: 40px 20px 30px;
        min-height: auto;
    }

    .exp-header {
        position: relative;
        top: 0;
        left: 0;
        right: 0;
        margin-bottom: 30px;
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    }

    .exp-header-top {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }

    .exp-logo {
        height: 24px;
        width: auto;
    }

    .exp-title-group h3 {
        font-size: 18px;
    }

    .badge-status {
        align-self: flex-start;
        font-size: 10px;
        padding: 4px 12px;
    }

    .exp-skills {
        margin-top: 30px;
        gap: 8px;
    }

    /* Projects Section Mobile Restyling */
    .project-v2,
    .project-v2.reverse,
    .project-v2.wide-image,
    .project-v2.wide-image.reverse {
        display: flex;
        flex-direction: column;
        gap: 32px;
        margin-bottom: 80px;
    }

    .project-mockup {
        order: 1; /* Keep images strictly on top of text on mobile */
    }

    .project-details {
        order: 2; /* Details strictly below the mockups */
    }

    .project-details h3 {
        font-size: clamp(1.8rem, 6vw, 2.4rem);
        margin-bottom: 16px;
    }

    .tech-stack {
        margin-bottom: 24px;
        gap: 8px;
    }

    /* Reset translateY offsets to prevent line overlap on wrap */
    .tech-stack .tech-pill:nth-child(even),
    .tech-stack .tech-pill:nth-child(3n) {
        transform: none !important;
    }

    .tech-pill {
        padding: 8px 16px;
        font-size: 12px;
    }

    .tech-pill:hover {
        transform: scale(1.05) !important;
    }

    .project-desc {
        font-size: 15px;
        margin-bottom: 24px;
        line-height: 1.5;
    }

    .project-actions {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
    }

    .btn-project {
        padding: 12px 24px;
        font-size: 13px;
        letter-spacing: 1px;
        flex: 1 1 calc(50% - 6px);
        min-width: 130px;
        justify-content: center;
    }

    /* Hero Section Polish */
    .hero-v2 {
        padding: 100px 0 40px;
    }

    .avatar-wrapper {
        width: 240px;
        height: 240px;
    }

    .floating-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    /* About Card Mobile Polishing */
    .about-card {
        padding: 24px;
        gap: 24px;
    }

    .about-image {
        max-width: 280px;
    }

    .about-name {
        font-size: 2.2rem;
        margin-bottom: 20px;
    }

    .about-bio {
        font-size: 15px;
        line-height: 1.6;
    }

    /* CTA Section Mobile Polishing */
    .cta-card {
        padding: 60px 20px;
    }

    .cta-content p {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .cta-content h2 {
        font-size: 1.4rem;
    }

    /* Footer Mobile adjustments */
    .footer-v2 {
        padding: 40px 0 30px;
    }

    .footer-content {
        padding-top: 24px;
        font-size: 12px;
    }
}

/* Very Small Mobile Screen Adjustments (< 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
        overflow-x: hidden;
    }

    .top-nav {
        min-width: 0 !important;
        width: calc(100% - 16px) !important;
        max-width: calc(100% - 16px) !important;
    }

    .nav-container {
        gap: 2px;
        padding: 0;
    }

    .nav-container a {
        font-size: 9px;
        padding: 4px 2px;
    }

    .avatar-wrapper {
        width: 200px;
        height: 200px;
    }

    .floating-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .btn-primary, 
    .btn-outline {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
    }

    .btn-icon {
        width: 48px;
        height: 48px;
    }
}