/* ==========================================================================
   CSS Variables & Theme Setup
   ========================================================================== */
:root {
    /* Colors - Deep Dark Theme with Cyan Accent */
    --bg-primary: #050505;
    --bg-secondary: #111111;
    --bg-tertiary: rgba(25, 25, 25, 0.6);

    --accent-primary: #00e5ff;
    /* Cyan instead of neon green */
    --accent-secondary: #b300ff;
    /* Purple for gradients */

    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;

    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* Typography */
    --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
    --font-heading: 'Outfit', sans-serif;

    /* Spacing & Layout */
    --nav-height: 80px;
    --section-padding: 100px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    --transition-smooth: 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-primary);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: none;
    /* hide default cursor on desktop */
}

/* ==========================================================================
   Custom Cursor
   ========================================================================== */

/* Small precise dot */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, opacity 0.3s ease;
    box-shadow: 0 0 8px var(--accent-primary), 0 0 20px rgba(0, 229, 255, 0.4);
}

/* Larger lagged ring */
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--accent-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition:
        width 0.35s cubic-bezier(0.19, 1, 0.22, 1),
        height 0.35s cubic-bezier(0.19, 1, 0.22, 1),
        border-color 0.35s ease,
        opacity 0.3s ease,
        background 0.35s ease;
    opacity: 0.7;
}

/* Hover state */
.cursor-dot.hovering {
    width: 12px;
    height: 12px;
    background: var(--accent-secondary);
    box-shadow: 0 0 12px var(--accent-secondary), 0 0 30px rgba(179, 0, 255, 0.5);
}

.cursor-ring.hovering {
    width: 56px;
    height: 56px;
    border-color: var(--accent-secondary);
    background: rgba(179, 0, 255, 0.06);
    opacity: 1;
}

/* Click state */
.cursor-dot.clicking {
    width: 6px;
    height: 6px;
    background: #fff;
    box-shadow: 0 0 16px #fff;
}

.cursor-ring.clicking {
    width: 26px;
    height: 26px;
    opacity: 1;
}

/* Particle sparkle */
.cursor-particle {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99997;
    transform: translate(-50%, -50%);
    background: var(--accent-primary);
    box-shadow: 0 0 6px var(--accent-primary);
    animation: particle-fade 0.55s ease-out forwards;
}

@keyframes particle-fade {
    0% {
        opacity: 0.9;
        transform: translate(calc(-50% + 0px), calc(-50% + 0px)) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.2);
    }
}

/* Restore default cursor on mobile/touch devices */
@media (hover: none) and (pointer: coarse) {
    body {
        cursor: auto;
    }

    .cursor-dot,
    .cursor-ring,
    .cursor-particle {
        display: none;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.1;
}

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--accent-secondary);
}

ul {
    list-style: none;
}

/* ==========================================================================
   Utility Classes & Components
   ========================================================================== */
.section {
    padding: var(--section-padding) 0;
    max-width: 1000px;
    margin: 0 auto;
    padding-left: clamp(20px, 5vw, 100px);
    padding-right: clamp(20px, 5vw, 100px);
}

.section-title {
    display: flex;
    align-items: center;
    font-size: clamp(24px, 4vw, 32px);
    margin-bottom: 40px;
    color: var(--text-primary);
    white-space: nowrap;
}

.section-title::after {
    content: "";
    display: block;
    height: 1px;
    width: 300px;
    background-color: var(--glass-border);
    margin-left: 20px;
}

.section-title span {
    color: var(--accent-primary);
    font-family: var(--font-sans);
    font-size: clamp(16px, 3vw, 20px);
    font-weight: 400;
    margin-right: 10px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    font-family: var(--font-sans);
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.cta-button.primary {
    background-color: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.cta-button.primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 229, 255, 0.1);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-smooth);
}

.cta-button.primary:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.cta-button.outline {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--text-tertiary);
}

.cta-button.outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ==========================================================================
   Loader Layer
   ========================================================================== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-primary);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-text {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 900;
    color: var(--accent-primary);
}

/* ==========================================================================
   Background Canvas
   ========================================================================== */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    /* Let clicks pass through */
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 50px;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
    opacity: 0;
    transform: translateY(-100%);
}

.navbar.hidden {
    transform: translateY(-100%);
}

.logo {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-primary);
    cursor: pointer;
    text-decoration: none;
}

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

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links li {
    font-family: var(--font-sans);
    font-size: 14px;
}

.nav-links a {
    color: var(--text-primary);
    position: relative;
    padding: 5px 0;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-primary);
    transition: width var(--transition-fast);
}

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

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 clamp(20px, 5vw, 150px);
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content {
    opacity: 0;
    /* Handled by GSAP */
    max-width: 800px;
}

.greeting {
    color: var(--accent-primary);
    margin-bottom: 20px;
    font-family: var(--font-sans);
    font-weight: 400;
}

.name {
    font-size: clamp(40px, 8vw, 80px);
    margin-bottom: 10px;
}

.roles {
    font-size: clamp(30px, 6vw, 60px);
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.cursor {
    color: var(--accent-primary);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.bio-short {
    font-size: 18px;
    max-width: 540px;
    margin-bottom: 40px;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.btn-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
    display: inline-block;
    flex-shrink: 0;
}

.download-btn {
    display: inline-flex;
    align-items: center;
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-content {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 50px;
}

.about-text {
    padding: 30px;
}

.about-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 30px;
}

.about-github-btn,
.about-linkedin-btn {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    padding: 0.75rem 1.5rem;
}

.about-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.about-image-wrapper::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 20px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    z-index: -1;
    transition: var(--transition-smooth);
}

.about-image-wrapper:hover::before {
    top: 10px;
    left: 10px;
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background-image: url('https://images.unsplash.com/photo-1549692520-acc6669e2f0c?q=80&w=1000&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    filter: grayscale(100%) contrast(1.2);
    transition: var(--transition-smooth);
}

.about-image-wrapper:hover .image-placeholder {
    filter: none;
}

/* ==========================================================================
   Projects Section
   ========================================================================== */
.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 100px;
}

.project-card {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
}

.project-card.reverse .project-content {
    grid-column: 1 / 8;
    text-align: left;
}

.project-card.reverse .project-tech-list {
    justify-content: flex-start;
}

.project-card.reverse .project-links {
    justify-content: flex-start;
}

.project-content {
    grid-column: 6 / -1;
    text-align: right;
    z-index: 2;
}

.project-overline {
    color: var(--accent-primary);
    font-size: 13px;
    margin-bottom: 5px;
}

.project-title {
    font-size: 28px;
    margin-bottom: 20px;
}

.project-description {
    padding: 25px;
    margin-bottom: 20px;
    font-size: 15px;
}

.project-tech-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 20px;
    margin-bottom: 20px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-tertiary);
}

.project-links {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
}

.project-links a {
    color: var(--text-primary);
}

.project-links a:hover {
    color: var(--accent-primary);
}

.project-links svg {
    width: 22px;
    height: 22px;
}

.project-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    letter-spacing: 0.5px;
    padding: 6px 0;
    border-bottom: 1px solid transparent;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.project-link-btn:hover {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* ==========================================================================
   Skills Marquee
   ========================================================================== */
.skills {
    padding: var(--section-padding) 0;
    overflow: hidden;
    max-width: 100%;
}

.skills .section-title {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 clamp(20px, 5vw, 100px);
    box-sizing: border-box;
}

.marquee-container {
    display: flex;
    overflow: hidden;
    user-select: none;
    gap: 3rem;
    padding: 2rem 0;
    mask-image: linear-gradient(to right,
            rgba(0, 0, 0, 0),
            rgba(0, 0, 0, 1) 10%,
            rgba(0, 0, 0, 1) 90%,
            rgba(0, 0, 0, 0));
    -webkit-mask-image: linear-gradient(to right,
            rgba(0, 0, 0, 0),
            rgba(0, 0, 0, 1) 10%,
            rgba(0, 0, 0, 1) 90%,
            rgba(0, 0, 0, 0));
}

.marquee-content {
    display: flex;
    flex-shrink: 0;
    justify-content: space-around;
    gap: 3rem;
    animation: scroll 30s linear infinite;
}

@keyframes scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(-100% - 3rem));
    }
}

.skill-item {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    color: transparent;
    -webkit-text-stroke: 1px var(--text-tertiary);
    transition: var(--transition-fast);
    cursor: default;
}

.skill-item:hover {
    color: var(--accent-primary);
    -webkit-text-stroke: 1px transparent;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 100px;
}

.contact .section-title.overline {
    display: block;
    margin-bottom: 20px;
    color: var(--accent-primary);
    font-size: 16px;
}

.contact .section-title.overline::after {
    display: none;
}

.contact-heading {
    font-size: clamp(40px, 5vw, 60px);
    margin-bottom: 20px;
}

.contact-desc {
    margin-bottom: 40px;
}

.contact-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    padding: 20px;
    text-align: center;
    background-color: var(--bg-secondary);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-links a {
    color: var(--text-secondary);
}

.social-links a:hover {
    color: var(--accent-primary);
    transform: translateY(-3px);
}

.social-links svg {
    width: 20px;
    height: 20px;
}

.copyright {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .section-title::after {
        width: 100%;
    }

    .nav-links {
        display: none;
        /* Add a typical mobile menu logic here later */
    }

    .nav-toggle {
        display: block;
    }

    .hamburger {
        display: block;
        width: 24px;
        height: 2px;
        background: var(--text-primary);
        position: relative;
    }

    .hamburger::before,
    .hamburger::after {
        content: '';
        position: absolute;
        width: 24px;
        height: 2px;
        background: var(--text-primary);
        left: 0;
    }

    .hamburger::before {
        top: -8px;
        transition: transform 0.3s ease, top 0.3s ease;
    }

    .hamburger::after {
        bottom: -8px;
        transition: transform 0.3s ease, bottom 0.3s ease;
    }

    /* Open state: nav links drop down */
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: rgba(5, 5, 5, 0.97);
        padding: 20px 0 30px;
        gap: 0;
        text-align: center;
        border-top: 1px solid var(--glass-border);
    }

    .nav-links.open li a {
        display: block;
        padding: 14px 20px;
        font-size: 16px;
    }

    /* Hamburger → X animation */
    .nav-toggle.active .hamburger {
        background: transparent;
    }

    .nav-toggle.active .hamburger::before {
        top: 0;
        transform: rotate(45deg);
    }

    .nav-toggle.active .hamburger::after {
        bottom: 0;
        transform: rotate(-45deg);
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .project-card,
    .project-card.reverse .project-content {
        display: block;
        margin-bottom: 50px;
    }

    .project-content {
        text-align: left;
    }

    .project-tech-list,
    .project-links {
        justify-content: flex-start;
    }

    .about-image-wrapper {
        margin: 50px auto 0;
    }
}