/* Design Tokens & Theme Variables */
:root {
    --bg-primary: #0a0b10;
    --bg-secondary: #12131a;
    --accent-glow: rgba(124, 58, 237, 0.15);
    --color-primary: #7c3aed;
    /* Neon Violet */
    --color-secondary: #06b6d4;
    /* Neon Cyan */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --glass-bg: rgba(18, 19, 26, 0.7);
    --glass-border: rgba(255, 255, 255, 0.06);
    --card-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Global Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-sans);
}

body {
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    padding: 1.5rem;
}

/* Base Headings & Typography */
h1,
h2,
h3 {
    font-weight: 800;
    line-height: 1.2;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Layout Sections */
section {
    margin-bottom: 2.5rem;
    position: relative;
}

/* --- Global Animating Elements --- */
#anim-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.25s ease-out;
}

#anim-container.ready {
    opacity: 1;
}

#anim-pill {
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 60px;
    /* Pill shape */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    /* JS will control this */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform-origin: top left;
    will-change: transform, width, height, opacity;
}


#anim-pic {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    transform-origin: top left;
    will-change: transform;
}

#anim-title {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    font-size: 3rem;
    line-height: 1.2;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transform-origin: top left;
    will-change: transform;
    white-space: nowrap;
}

/* --- Placeholders --  */
.pic-pl {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    visibility: hidden;
}

.title-pl {
    visibility: hidden;
    white-space: nowrap;
    font-weight: 800;
    font-family: var(--font-sans);
    line-height: 1.2;
    width: max-content;
    height: auto;
}

#hero-pl-container .title-pl {
    font-size: 3rem;
}

#about-pl-container .title-pl {
    font-size: 2.5rem;
}

/* 1. Hero Section */
#hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Center horizontally now */
}

#hero-pl-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: 100%;
}

/* Nav Placeholders (Sticky Header) */
#nav-pl-container {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    width: 100%;
    pointer-events: none;
    z-index: -1;
}

#nav-pl-container .pic-pl {
    width: 50px;
    height: 50px;
}

#nav-pl-container .title-pl {
    font-size: 1.5rem;
}

/* About Me Placeholders */
#about-pl-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    margin-top: 2rem;
}

#hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 90%;
    margin-bottom: 2rem;
}

/* 2. Projects Section (Stacking Cards) */
.projects-section {
    position: relative;
}

.projects-cards-container {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 1rem;
    /* Clean, uniform transition spacing to the next section */
}

.project-card {
    position: sticky;
    top: 15vh;
    width: 100%;
    height: 240px;
    min-height: 240px;
    max-height: 240px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 -15px 30px -10px rgba(0, 0, 0, 0.6), 0 20px 40px -15px rgba(0, 0, 0, 0.8);
    transform-origin: top center;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
    margin-bottom: 8vh;
    /* creates scrolling track room */
    flex-shrink: 0;
    /* Prevents flexbox from shrinking subsequent cards, keeping them all the exact same physical size */
}

.project-card:last-child {
    margin-bottom: 0;
}

.project-card:nth-child(1) {
    z-index: 1;
}

.project-card:nth-child(2) {
    z-index: 2;
}

.project-card:nth-child(3) {
    z-index: 3;
}

.project-card:nth-child(4) {
    z-index: 4;
}

.project-card:nth-child(5) {
    z-index: 5;
}

.project-card h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

.project-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 3. Workflow Section (Horizontal Scroll/Swipe) */
#workflow {
    overflow: visible;
}

.workflow-sticky-container {
    position: relative;
    width: 100%;
}

.workflow-horizontal-scroll {
    width: 100%;
}

.workflow-slider {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.5rem 0 1.5rem 0;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

/* Hide scrollbar for Chrome/Safari */
.workflow-slider::-webkit-scrollbar {
    display: none;
}

.workflow-spacer-card {
    display: none;
}

.workflow-card {
    flex: 0 0 85%;
    /* Shows most of one card and hints at the next */
    scroll-snap-align: start;
    background: var(--card-gradient);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.workflow-card:active {
    transform: scale(0.98);
    border-color: rgba(124, 58, 237, 0.4);
}

.card-num {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.workflow-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.workflow-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 4. About Me Section */
#about {
    min-height: auto;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* 5. Social Links Section */
#social-links {
    min-height: auto;
    padding-top: 2rem;
}

/* Laptop / Desktop Enhancements (Media Query) */
@media (min-width: 768px) {
    body {
        padding: 0;
    }

    #hero,
    #projects,
    #about,
    #social-links {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 4rem;
        padding-right: 4rem;
    }

    #hero {
        min-height: 90vh;
    }

    #anim-title {
        font-size: 5rem;
    }

    #hero-pl-container .title-pl {
        font-size: 5rem;
    }

    #about-pl-container .title-pl {
        font-size: 4rem;
    }

    #hero .pic-pl {
        width: 300px;
        height: 300px;
    }

    #nav-pl-container {
        top: 2rem;
        left: 4rem;
    }

    #nav-pl-container .pic-pl {
        width: 60px;
        height: 60px;
    }

    #about-pl-container {
        flex-direction: row;
        justify-content: space-between;
        padding: 0 5%;
        margin-top: 5rem;
    }

    #about-pl-container .pic-pl {
        width: 400px;
        height: 400px;
    }

    h2 {
        font-size: 3rem;
        margin-bottom: 2.5rem;
    }

    /* 2. Projects Section Sticky Stacking Layout */
    .project-card {
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
        height: 260px;
        min-height: 260px;
        max-height: 260px;
        padding: 2.5rem;
    }

    /* 3. Workflow Section Sticky Scroll Layout */
    #workflow.workflow-scroll-wrapper {
        height: 200vh;
        /* Taller scroll track for the scroll interaction */
        margin-top: 0;
        margin-bottom: 0;
        background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
    }

    .workflow-sticky-container {
        position: sticky;
        top: 17.5vh;
        height: 65vh;
        display: flex;
        align-items: center;
        overflow: hidden;
    }

    .workflow-horizontal-scroll {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .workflow-slider {
        display: flex;
        gap: 3rem;
        overflow-x: visible;
        /* Let JS transform it */
        scroll-snap-type: none;
        /* Disable native snapping on desktop */
        padding: 0 0 0 33vw;
        will-change: transform;
        transition: transform 0.1s ease-out;
        /* Smooth follow-through */
    }

    .workflow-card {
        flex: 0 0 420px;
        /* Fixed card width on desktop */
        height: 280px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .workflow-spacer-card {
        display: block;
        flex: 0 0 calc(33vw - 3rem);
        opacity: 0;
        pointer-events: none;
    }
}

/* --- Global Scroll Indicator, Hover & Reveal Animations --- */
.reveal-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 600px;
    text-align: center;
    margin-top: 1.5rem;
    line-height: 1.6;
    transition-delay: 0.1s;
}

/* Scroll Indicator */
#scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
    transition: opacity 0.4s ease-out;
}

.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    position: relative;
    display: block;
}

.wheel {
    width: 4px;
    height: 8px;
    background-color: var(--color-primary);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-wheel 1.6s infinite ease-in-out;
}

@keyframes scroll-wheel {
    0% {
        top: 8px;
        opacity: 1;
        height: 8px;
    }

    50% {
        top: 18px;
        opacity: 0.4;
        height: 12px;
    }

    100% {
        top: 8px;
        opacity: 1;
        height: 8px;
    }
}

/* Hover effects for project cards */
.project-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.project-card:hover {
    border-color: rgba(124, 58, 237, 0.4) !important;
    box-shadow: 0 20px 45px rgba(124, 58, 237, 0.18), 0 -15px 30px rgba(0, 0, 0, 0.7) !important;
    transform: scale(1.02) translateY(-8px) !important;
}

/* Hover effects for workflow cards */
.workflow-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.workflow-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 20px 40px rgba(6, 182, 212, 0.15), 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* About me description */
.about-content {
    max-width: 600px;
    margin: 3rem auto 0 auto;
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-muted);
}

/* Social links grid & cards */
#social-links {
    text-align: center;
    padding-bottom: 4rem;
}

.section-desc {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3.5rem auto;
    font-size: 1.1rem;
    line-height: 1.6;
}

.social-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.social-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--card-gradient);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.75rem;
    text-decoration: none;
    color: inherit;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.4s ease;
    text-align: left;
}

.social-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    color: var(--text-muted);
}

.social-card:hover .social-icon {
    transform: rotate(8deg) scale(1.1);
}

.social-card.github:hover {
    border-color: rgba(243, 244, 246, 0.3);
    box-shadow: 0 15px 35px rgba(243, 244, 246, 0.06);
}

.social-card.github:hover .social-icon {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.social-card.linkedin:hover {
    border-color: rgba(14, 118, 168, 0.4);
    box-shadow: 0 15px 35px rgba(14, 118, 168, 0.15);
}

.social-card.linkedin:hover .social-icon {
    color: #0e76a8;
    background: rgba(14, 118, 168, 0.1);
    border-color: rgba(14, 118, 168, 0.3);
}

.social-card.twitter:hover {
    border-color: rgba(29, 161, 242, 0.4);
    box-shadow: 0 15px 35px rgba(29, 161, 242, 0.15);
}

.social-card.twitter:hover .social-icon {
    color: #1da1f2;
    background: rgba(29, 161, 242, 0.1);
    border-color: rgba(29, 161, 242, 0.3);
}

.social-card.email:hover {
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 15px 35px rgba(124, 58, 237, 0.15);
}

.social-card.email:hover .social-icon {
    color: var(--color-primary);
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.3);
}

.social-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: #fff;
}

.social-info p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

@media (min-width: 600px) {
    .social-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 768px) {
    .about-content {
        margin-top: 5rem;
        font-size: 1.3rem;
        max-width: 800px;
    }
}

/* --- More Projects Button --- */
.projects-more-container {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.btn-more-projects {
    display: inline-block;
    padding: 1.1rem 2.8rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    text-decoration: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.btn-more-projects:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.btn-more-projects:active {
    transform: translateY(-1px);
}

/* --- Projects Page Layout --- */
.projects-page-container {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.projects-page-header {
    text-align: center;
    margin-bottom: 4rem;
}

.projects-page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    margin-bottom: 3rem;
    font-size: 1rem;
}

.btn-back-home:hover {
    color: #fff;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.projects-grid .project-card {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    min-height: 220px;
    max-height: none;
    margin-bottom: 0 !important;
    transform: none !important;
    opacity: 1 !important;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .projects-page-header h1 {
        font-size: 4rem;
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Burger Menu & Full Screen Overlay --- */
#burger-menu-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
}

#burger-menu-container.visible {
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 768px) {
    #burger-menu-container {
        top: 2rem;
        right: 4rem;
    }
}

#burger-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 4.2rem;
    height: 4.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
    #burger-btn {
        width: 4.2rem;
        height: 4.2rem;
        gap: 8px;
    }
}

#burger-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

.burger-line {
    width: 24px;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .burger-line {
        width: 28px;
    }
}

/* Burger Open State */
#burger-btn.open .burger-line:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

#burger-btn.open .burger-line:nth-child(2) {
    transform: translateY(-4px) rotate(-45deg);
}

@media (min-width: 768px) {
    #burger-btn.open .burger-line:nth-child(1) {
        transform: translateY(5px) rotate(45deg);
    }

    #burger-btn.open .burger-line:nth-child(2) {
        transform: translateY(-5px) rotate(-45deg);
    }
}

/* Menu Overlay */
#menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 11, 16, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-out;
}

#menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.menu-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.menu-link {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

#menu-overlay.active .menu-link {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger link animations */
#menu-overlay.active .menu-link:nth-child(1) {
    transition-delay: 0.1s;
}

#menu-overlay.active .menu-link:nth-child(2) {
    transition-delay: 0.15s;
}

#menu-overlay.active .menu-link:nth-child(3) {
    transition-delay: 0.2s;
}

#menu-overlay.active .menu-link:nth-child(4) {
    transition-delay: 0.25s;
}

.menu-link:hover {
    color: var(--color-primary);
    transform: scale(1.1) !important;
}

@media (min-width: 768px) {
    .menu-link {
        font-size: 4rem;
    }
}

/* Transition Overlay */
#transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

#transition-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transition: none;
    /* Show instantly */
}