:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #4361ee;
    /* Vibrant Blue */
    --accent-secondary: #7209b7;
    /* Deep Violet */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-fast: 0.3s ease;
    --transition-medium: 0.5s ease;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    /* Restored to prevent horizontal scrollbars */
    line-height: 1.6;
    width: 100%;
}

html {
    scroll-behavior: smooth;
    /* overflow-x: hidden removed from html to help sticky positioning reliability */
}

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

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

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

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

/* Container */
.container {
    max-width: 1600px;
    /* Widened from 1200px */
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    transition: var(--transition-fast);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

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

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

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    animation: float 10s infinite alternate;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(112, 0, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    animation: float 8s infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 30px);
    }
}

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

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.2s;
}

.hero-title {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.4s;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.6s;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.8s;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

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

.btn-primary:hover {
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.5);
}

.btn-secondary {
    background: transparent;
    border-color: var(--glass-border);
    color: var(--text-primary);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Splash Screen */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s ease-in-out;
}

#splash-screen.hidden {
    transform: translateY(-100%);
}

.splash-title {
    font-size: 4rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-align: center;
}

.start-btn {
    padding: 1rem 3rem;
    font-size: 1.5rem;
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.start-btn:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 30px var(--accent-color);
}

/* Mixed Layout Handling */
body {
    overflow-x: hidden;
}

/* Standard Vertical Section */
.vertical-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 10;
    background: var(--bg-color);
}

/* Horizontal Scroll Section (Sticky Method) */
/* Horizontal Scroll Section (Sticky Method) */
.horizontal-scroll-container {
    height: 200vh;
    /* Adjustment to 200vh */
    position: relative;
    z-index: 20;
}

.sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at center, #3c096c 0%, #000 100%);
}

.horizontal-track {
    display: flex;
    gap: 4rem;
    padding: 0 10vw 0 5rem;
    /* Reduced right padding to remove empty void at end */
    width: max-content;
    transform: translateX(0);

    will-change: transform;
}

/* Standard Card (Restored) */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: var(--transition-medium);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Project Cards for Horizontal Scroll */
.h-project-card {
    min-width: 400px;
    /* Wider cards */
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: 0.4s;
    position: relative;
}

.h-project-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    transform: scale(1.05) rotate(2deg);
    z-index: 10;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.h-project-number {
    font-size: 8rem;
    position: absolute;
    top: -20px;
    right: 20px;
    opacity: 0.1;
    font-weight: 900;
    color: var(--accent-color);
}

/* Photo Styling */
.profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(67, 97, 238, 0.5);
    margin: 0 auto 2rem auto;
    display: block;
}

.info-cards {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.info-pill {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

/* Timeline Restoration (Clean Version) */
.clean-timeline {
    position: relative;
    width: 100%;
    /* Responsive width */
    max-width: 1400px;
    /* Widened timeline container */
    margin: 0 auto;
    padding: 40px 0;
    /* Increased padding text top/bottom for arrows */
}

/* Central Line */
.clean-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    /* Gradient for fading at ends */
    background: linear-gradient(to bottom, var(--accent-color) 0%, var(--glass-border) 10%, var(--glass-border) 90%, var(--accent-color) 100%);
}

/* Top Arrow Indicator */
.clean-timeline::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 15px solid var(--accent-color);
}

.timeline-entry {
    display: flex;
    justify-content: flex-end;
    padding-right: 40px;
    position: relative;
    margin-bottom: 30px;
    width: 50%;
}

/* CSS Cleaned up - relying on .left and .right classes */

.timeline-card {
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    width: 100%;
    transition: transform 0.3s;
}

.timeline-card:hover {
    transform: translateX(5px);
    /* Border color handled by specific types below */
}

/* Sections General */
section {
    padding: 8rem 0;
}

.section-header {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.section-line {
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Bento Grid for Skills/Experience */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    /* Widen min size */
    gap: 2.5rem;
    width: 100%;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    /* Increase padding */
    transition: var(--transition-medium);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.card:hover::before {
    transform: translateX(100%);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card-text {
    color: var(--text-secondary);
}

/* Experience Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--glass-border);
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-color);
    border: 2px solid var(--accent-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid var(--glass-border);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--glass-border);
}

.right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid var(--glass-border);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--glass-border) transparent transparent;
}

.right::after {
    left: -10px;
}

.timeline-content {
    padding: 20px 30px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    position: relative;
}

/* Contact */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--glass-bg);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

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

.form-input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Accordion Styles (Parcours) */
.accordion-container {
    max-width: 800px;
    margin: 0 auto;
}

.accordion {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition-fast);
}

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

.accordion-header {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.accordion-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.accordion-icon {
    transition: transform 0.3s ease;
    color: var(--accent-color);
}

/* Note: Rotation is now handled by JS setting inline style for better control, 
   or we can stick to class based. Let's keep class based but use the new class name */
.accordion.expanded .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    background: rgba(0, 0, 0, 0.2);
}

.accordion-content-inner {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.exp-item {
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--accent-secondary);
}

.exp-item:last-child {
    margin-bottom: 0;
}

.exp-date {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    display: block;
}

.exp-role {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.exp-company {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    font-style: italic;
}

/* Color Coding Classes */
.timeline-card.type-work {
    border-left-color: var(--accent-color);
    /* Blue for Work */
    box-shadow: -5px 0 15px rgba(67, 97, 238, 0.1);
}

.timeline-card.type-work:hover {
    border-color: var(--accent-color);
}

.timeline-card.type-education {
    border-left-color: var(--accent-secondary);
    /* Violet for Education */
    box-shadow: -5px 0 15px rgba(114, 9, 183, 0.1);
}

.timeline-card.type-education:hover {
    border-color: var(--accent-secondary);
}

.timeline-card h3 {
    font-size: 1.4rem;
    /* Larger Title */
    margin-bottom: 0.5rem;
}

/* Timeline Alignment */
.timeline-entry.left {
    justify-content: flex-end;
    padding-right: 30px;
    left: 0;
    text-align: right;
}

.timeline-entry.right {
    justify-content: flex-start;
    padding-left: 30px;
    padding-right: 0;
    left: 50%;
    text-align: left;
}

/* Arrows */
.timeline-entry.left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 20px;
    /* Adjusted to touch border */
    border: medium solid var(--glass-border);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--glass-border);
}

.timeline-entry.right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 20px;
    /* Adjusted to touch border */
    border: medium solid var(--glass-border);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--glass-border) transparent transparent;
}

/* Bubbles (Dots) */
.timeline-entry::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    /* Center on spine (20px width / 2 = 10px) */
    background-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color), 0 0 20px rgba(67, 97, 238, 0.3);
    border: 2px solid white;
    /* Small white border for contrast */
    top: 25px;
    border-radius: 50%;
    z-index: 2;
}

.timeline-entry.right::after {
    left: -10px;
    right: auto;
}

/* Color Coding for Bubbles based on type */
.timeline-entry.type-education::after {
    background-color: var(--accent-secondary);
    box-shadow: 0 0 10px var(--accent-secondary), 0 0 20px rgba(114, 9, 183, 0.3);
}

/* Projects Grid */
.project-card p,
.h-project-card p {
    max-width: 100%;
    white-space: normal;
    /* Force wrap */
    line-height: 1.6;
    margin-bottom: 1rem;
}

.h-project-card {
    min-width: 400px;
    max-width: 500px;
    /* Constraint width to force content to wrap */
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: 0.4s;
    position: relative;
    white-space: normal;
    /* Ensure text wraps */
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tag {
    background: rgba(67, 97, 238, 0.1);
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(67, 97, 238, 0.2);
}

/* Responsive fixes */
@media screen and (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
        padding: 0 1rem;
    }

    /* Disable Horizontal Scroll on Mobile */
    .horizontal-scroll-container {
        height: auto !important;
        /* Remove 300vh */
    }

    .sticky-wrapper {
        position: relative;
        /* Remove sticky */
        height: auto;
        top: auto;
        background: transparent;
        /* Optional: remove background if it clashes */
    }

    .horizontal-track {
        display: flex;
        flex-direction: column;
        /* Stack vertically */
        transform: none !important;
        /* Disable JS transform via CSS if possible, though JS might fight it */
        padding: 0 !important;
        /* Remove padding */
        width: 100%;
        gap: 2rem;
    }

    .h-project-card {
        min-width: unset;
        width: 100%;
        margin-bottom: 2rem;
        height: auto;
        transform: none !important;
        /* Disable hover rotation on mobile to be safe */
    }
}

/* Gallery Grid (Masonry-ish) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 200px;
    gap: 1rem;
    margin-bottom: 2rem;
}

.gallery-item {
    overflow: hidden;
    border-radius: 15px;
    position: relative;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    z-index: 5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-color);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Spanning classes for visual variety */
.gallery-item.wide {
    grid-column: span 2;
}

.gallery-item.tall {
    grid-row: span 2;
}

@media screen and (max-width: 768px) {

    .gallery-item.wide,
    .gallery-item.tall {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* Timeline Responsive for Mobile */
/* Timeline Responsive for Mobile */
@media screen and (max-width: 768px) {
    .clean-timeline {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px 0;
    }

    .clean-timeline::before {
        left: 20px;
    }

    .timeline-entry {
        width: 100%;
        margin-left: 0 !important;
        padding-left: 50px !important;
        padding-right: 10px !important;
        /* Ensure content doesn't touch edge */
        justify-content: flex-start;
        text-align: left !important;
    }

    .timeline-entry.left,
    .timeline-entry.right {
        left: 0 !important;
        text-align: left !important;
    }

    /* Arrows Adjustment for Mobile (All point left) */
    .timeline-entry.left::before,
    .timeline-entry.right::before {
        right: auto;
        left: 40px;
        /* Near the line */
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--glass-border) transparent transparent;
    }

    .timeline-entry::after {
        left: 12px !important;
        right: auto;
    }
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.visible {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(67, 97, 238, 0.5);
    animation: zoomIn 0.3s;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

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