/* CSS Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: rgba(20, 20, 20, 0.4);
    --bg-card-hover: rgba(30, 30, 30, 0.5);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --accent: #DFFF00;
    --accent-hover: #f0ff4d;
    --accent-dim: rgba(223, 255, 0, 0.1);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(223, 255, 0, 0.3);
    --font-heading: 'Geist Mono', 'Consolas', 'Monaco', monospace;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
}

/* Lenis smooth scroll base styles */
html.lenis, html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    font-size: 16px;
}

/* Screen reader only - for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Canvas - Fixed background */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    /* pointer-events, width, height set via JavaScript for Firefox compatibility */
    overflow: visible;
    /* Ensure no clipping in Firefox */
    clip: auto;
    -webkit-clip-path: none;
    clip-path: none;
}

/* Main content overlay */
main {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

/* ======================
   Section Tracker (Right Side)
   ====================== */
.section-tracker {
    position: fixed;
    right: 0px;
    top: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 24px;
    pointer-events: auto;
    padding: 20px 40px 20px 100px;
}

/* Gradient background with fading blur using pseudo-element */
.section-tracker::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        to left,
        rgba(10, 10, 10, 1) 0%,
        rgba(10, 10, 10, 0.8) 50%,
        rgba(10, 10, 10, 0.5) 80%,
        rgba(10, 10, 10, 0.25) 90%,
        rgba(10, 10, 10, 0) 100%
    );
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    /* Mask to fade out the blur effect */
    -webkit-mask: linear-gradient(
        to left,
        black 0%,
        black 50%,
        transparent 100%
    );
    mask: linear-gradient(
        to left,
        black 0%,
        black 50%,
        transparent 100%
    );
}

.tracker-line {
    display: none;
}

.tracker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-muted);
    transition: var(--transition-medium);
    position: relative;
}

.tracker-item:hover {
    color: var(--text-secondary);
}

.tracker-item.active {
    color: var(--accent);
}

.tracker-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--text-muted);
    transition: var(--transition-medium);
    order: 2;
}

.tracker-item:hover .tracker-dot {
    border-color: var(--text-secondary);
}

.tracker-item.active .tracker-dot {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

.tracker-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 1;
    transition: var(--transition-medium);
    order: 1;
}

.tracker-item.active .tracker-label {
    color: var(--accent);
}

/* Tracker Item Groups (for expandable sections) */
.tracker-item-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

/* Subsections Container */
.tracker-subsections {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    padding: 0;
}

.tracker-item-group.expanded .tracker-subsections {
    max-height: 200px;
    opacity: 1;
    padding: 12px 0 0 0;
}

/* Individual Subsection Items */
.tracker-subsection {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    transition: var(--transition-medium);
    position: relative;
}

.tracker-subsection:hover {
    color: var(--text-secondary);
}

.tracker-subsection.active {
    color: var(--accent);
}

.subsection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid var(--text-muted);
    transition: var(--transition-medium);
}

.tracker-subsection:hover .subsection-dot {
    border-color: var(--text-secondary);
}

.tracker-subsection.active .subsection-dot {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.subsection-label {
    display: none;
}

/* ======================
   Sections
   ====================== */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 0rem;
    position: relative;
}

/* Sections with sticky headers - allow natural content flow */
#experience,
#projects {
    display: block;
    align-items: unset;
    justify-content: unset;
    padding-top: 6rem;
    padding-bottom: 8rem;
}

.section-content {
    max-width: 800px;
    width: 100%;
    margin-left: 32%;
    pointer-events: auto;
}

/* Section Header */
.section-header {
    margin-bottom: 3rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

/* Sticky section headers for experience and projects */
#experience .section-header,
#projects .section-header {
    position: sticky;
    top: 0;
    background: linear-gradient(to bottom, var(--bg-primary) 0%, var(--bg-primary) 80%, transparent 100%);
    padding-top: 3rem;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    z-index: 10;
}

.section-number {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 500;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* ======================
   Hero Section
   ====================== */
#hero {
    justify-content: flex-start;
    align-items: flex-start;
}

#hero .section-content {
    text-align: left;
    margin-left: 32%;
    margin-top: 50vh; /* Position below the "HELLO," particle text (at y: 0.35 = 35%) */
    transform: translateY(-50%);
}

.hero-content {
    max-width: 600px;
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.hero-subtitle .highlight {
    color: var(--accent);
    font-weight: 600;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 550px;
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.875rem 1.75rem;
    border-radius: 6px;
    text-decoration: none;
    transition: var(--transition-medium);
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(223, 255, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ======================
   About Section
   ====================== */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.about-text {
    max-width: 600px;
}

.about-intro {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.about-text p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

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

.about-details {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.about-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.detail-value {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--accent);
    font-weight: 500;
}

.about-journey {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-color);
}

.about-journey-title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* ======================
   Skills Section
   ====================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.skill-category {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.skill-category-title {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.skill-item:hover {
    background: rgba(223, 255, 0, 0.1);
    transform: translateY(-2px);
}

.skill-item i {
    font-size: 1.25rem;
}

.skill-item span {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ======================
   Journey Section
   ====================== */
.journey-timeline {
    position: relative;
    padding-left: 2rem;
}

.journey-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent) 0%, var(--border-color) 100%);
}

.journey-item {
    position: relative;
    padding-bottom: 2.5rem;
}

.journey-item:last-child {
    padding-bottom: 0;
}

.journey-marker {
    position: absolute;
    left: -2rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    background: var(--bg-primary);
    border: 2px solid var(--accent);
    border-radius: 50%;
    transform: translateX(-5px);
}

.journey-item:hover .journey-marker {
    background: var(--accent);
}

.journey-content {
    padding-left: 1rem;
}

.journey-date {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.journey-title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    color: var(--text-primary);
    margin: 0.5rem 0;
    font-weight: 600;
}

.journey-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 550px;
}

/* ======================
   Entries Container
   ====================== */
.entries-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ======================
   Projects Horizontal Scroll Transform
   ====================== */
#projects {
    /* Height will be set dynamically by JavaScript */
    min-height: auto;
    padding-top: 0;
    padding-bottom: 0;
}

.projects-sticky-viewport {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#projects .section-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 3rem;
}

#projects .section-header {
    position: relative;
    flex-shrink: 0;
}

.projects-track {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: stretch;
    /* Transform will be applied via JavaScript */
    will-change: transform, opacity;
    transition: opacity 0.3s ease;
}

#projects .project-card {
    flex: 0 0 800px;
    min-width: 800px;
}

/* ======================
   Work Cards
   ====================== */
.work-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: var(--transition-medium);
}

.work-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

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

.work-info {
    flex: 1;
    min-width: 200px;
}

.work-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.work-company {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.work-period {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: var(--font-heading);
}

.work-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.work-location svg {
    opacity: 0.7;
}

.work-description {
    margin-bottom: 1.5rem;
}

.work-description p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.work-highlights {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.work-highlights li {
    position: relative;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.work-highlights li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ======================
   Project Cards
   ====================== */
.project-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: var(--transition-medium);
}

.project-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

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

.project-info {
    flex: 1;
    min-width: 200px;
}

.project-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.project-tagline {
    font-size: 0.9375rem;
    color: var(--accent);
    font-weight: 400;
}

.project-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.project-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: var(--transition-fast);
}

.project-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}

.project-link i {
    font-size: 1rem;
}

.project-link svg {
    width: 16px;
    height: 16px;
}

.project-description {
    margin-bottom: 1.5rem;
}

.project-description p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* ======================
   Tech Stack
   ====================== */
.tech-stack {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.tech-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tech-icons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tech-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: var(--transition-fast);
    cursor: default;
}

.tech-icon:hover {
    background: var(--accent-dim);
    transform: translateY(-2px);
}

.tech-icon i {
    font-size: 1.25rem;
}

/* ======================
   Contact Section
   ====================== */
.contact-wrapper {
    text-align: left;
}

.contact-intro {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 500px;
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition-medium);
}

.contact-link:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.contact-link svg,
.contact-link i {
    font-size: 1.25rem;
    opacity: 0.8;
}

.contact-link:hover svg,
.contact-link:hover i {
    opacity: 1;
}

/* ======================
   Responsive Design
   ====================== */
@media (max-width: 1200px) {
    .section-content {
        margin-left: 10%;
    }
    
    #hero .section-content {
        margin-left: 32%;
    }
    
    #projects .project-card {
        flex: 0 0 700px;
        min-width: 700px;
    }
}

@media (max-width: 992px) {
    .section-tracker {
        right: 0px;
        padding: 16px 20px;
    }
    
    .section-content {
        margin-left: 5%;
        max-width: 90%;
    }
    
    #hero .section-content {
        margin-left: 32%;
        max-width: 60%;
    }
    
    #projects .project-card {
        flex: 0 0 600px;
        min-width: 600px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    .section {
        padding: 4rem 1.5rem;
    }

    .section-content {
        margin-left: 0;
        max-width: 100%;
    }
    
    #experience .section-header,
    #projects .section-header {
        padding-top: 2rem;
    }
    
    #projects .project-card {
        flex: 0 0 85vw;
        min-width: 85vw;
    }
    
    .projects-track {
        gap: 1.5rem;
    }
    
    .section-tracker {
        display: none;
    }

    #hero {
        justify-content: center;
        align-items: center;
    }
    
    #hero .section-content {
        margin-left: 0;
        margin-top: 50vh;
        padding: 0 1.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    /* About responsive */
    .about-details {
        gap: 2rem;
    }

    /* Skills responsive */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Journey responsive */
    .journey-timeline {
        padding-left: 1.5rem;
    }

    .journey-marker {
        left: -1.5rem;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .btn {
        text-align: center;
    }

    .work-card,
    .project-card {
        padding: 1.5rem;
    }
    
    .work-header,
    .project-header {
        flex-direction: column;
    }
    
    .work-location {
        margin-top: 0.5rem;
    }
    
    .project-links {
        width: 100%;
    }
    
    .tech-stack {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-links {
        flex-direction: column;
    }

    .contact-link {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 3rem 1rem;
    }
    
    #projects .project-card {
        flex: 0 0 90vw;
        min-width: 90vw;
    }
    
    .section-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .work-title,
    .project-title {
        font-size: 1.125rem;
    }
    
    .tech-icons {
        gap: 0.5rem;
    }
    
    .tech-icon {
        width: 32px;
        height: 32px;
    }
    
    .tech-icon i {
        font-size: 1rem;
    }
}
