/* CSS Reset and Global Styles */
:root {
    --primary-blue: #14213D;
    --primary-blue-rgb: 20, 33, 61;
    --accent-blue: #0A1C36;
    --text-color: #1a1a1a;
    --text-light: #666666;
    --white: #ffffff;
    --bg-light: #f8f9fa;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --transition-fast: 0.3s ease;
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 100px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: var(--primary-blue);
    color: var(--white);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    font-weight: 700;
    color: var(--primary-blue);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Background Shapes */
.bg-shape {
    position: absolute;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.15;
    background-color: var(--primary-blue);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: morph 8s ease-in-out infinite both alternate;
}

@keyframes morph {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }

    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

.shape-1 {
    top: 120vh;
    left: -10vw;
    width: 35vw;
    height: 35vw;
}

.shape-2 {
    top: 200vh;
    right: -10vw;
    width: 40vw;
    height: 40vw;
    background-color: #203061;
    animation-delay: 2s;
}

.shape-3 {
    top: 280vh;
    left: -5vw;
    width: 30vw;
    height: 30vw;
    animation-delay: 4s;
}

.shape-4 {
    top: 380vh;
    right: 5vw;
    width: 25vw;
    height: 25vw;
    background-color: #0A1C36;
    animation-delay: 1s;
}

.shape-5 {
    top: 450vh;
    left: 10vw;
    width: 35vw;
    height: 35vw;
    background-color: #14213D;
    animation-delay: 3s;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    transition: all var(--transition-fast);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    /* Adjust based on actual image */
    width: auto;
}

.site-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
}

nav ul {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 4px;
    transition: color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-blue);
    transition: width var(--transition-fast);
}

nav a:hover {
    color: var(--primary-blue);
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

nav a.active {
    color: var(--primary-blue);
}

.cv-download {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cv-download::after {
    display: none;
}

.cv-download svg {
    transition: transform var(--transition-fast);
}

.cv-download:hover svg {
    transform: translateY(-2px);
}


/* Burger Menu */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.burger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--primary-blue);
    border-radius: 3px;
    transition: all var(--transition-fast);
}

.burger-menu.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Video Hero Section */
.video-hero {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -100px;
    /* Counteract body padding to go full screen */
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: linear-gradient(135deg, rgba(20, 33, 61, 0.8), rgba(10, 28, 54, 0.5)); */
    z-index: -1;
}

/* Animated organic blobs to replace the background video */
.anim-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 52% 48% 43% 57% / 50% 55% 45% 50%;
    opacity: 1;
    z-index: -1;
    animation: float 14s ease-in-out infinite, morph 8s ease-in-out infinite;
    transform-origin: center;
}

.blob-1 {
    width: 38vmax;
    height: 38vmax;
    left: -30%;
    top: -24%;
    border-radius: 57% 43% 52% 48% / 50% 58% 42% 50%;
    background-color: #203061;
    animation-delay: 0s;
}

.blob-2 {
    width: 36vmax;
    height: 36vmax;
    right: -30%;
    top: -22%;
    border-radius: 45% 55% 60% 40% / 42% 57% 40% 58%;
    background-color: #203061;
    animation-delay: 3s;
}

.blob-3 {
    width: 34vmax;
    height: 34vmax;
    left: -30%;
    bottom: -22%;
    border-radius: 42% 58% 45% 55% / 50% 52% 45% 53%;
    background-color: #203061;
    animation-delay: 6s;
}

.blob-4 {
    width: 16vmax;
    height: 16vmax;
    right: -12%;
    bottom: -12%;
    border-radius: 48% 52% 53% 47% / 44% 58% 39% 59%;
    background-color: #203061;
    animation-delay: 9s;
}

/* Additional smaller shapes */
.blob-5 {
    width: 18vmax;
    height: 18vmax;
    right: -16%;
    top: 4%;
    border-radius: 53% 47% 50% 50% / 46% 52% 49% 53%;
    background-color: #203061;
    animation-delay: 5s;
}

.blob-6 {
    width: 20vmax;
    height: 20vmax;
    left: -16%;
    bottom: 4%;
    border-radius: 49% 51% 52% 48% / 55% 45% 50% 50%;
    background-color: #203061;
    animation-delay: 7s;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
    }
    50% {
        transform: translateY(-6vh) translateX(4vw) rotate(10deg) scale(1.03);
    }
    100% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
    }
}

@media (max-width: 768px) {
    .blob { }
    .blob-1 { width: 72vmax; height: 72vmax; left: -40%; top: -62%; }
    .blob-2 { width: 58vmax; height: 58vmax; right: -38%; top: -44%; }
    .blob-3 { width: 56vmax; height: 56vmax; left: -38%; bottom: -50%; }
    .blob-4 { width: 26vmax; height: 26vmax; right: -22%; bottom: -22%; }
    .blob-5 { width: 36vmax; height: 36vmax; right: -34%; top: -14%; }
    .blob-6 { width: 38vmax; height: 38vmax; left: -34%; bottom: -30%; }
}

.video-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #203061;
    padding: 0 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-content h1 {
    font-size: 4.5rem;
    color: #203061;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 15px rgba(255, 255, 255, 0.9);
    line-height: 1.1;
    max-width: 800px;
}

.video-content p {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.9);
    color: #203061;
    font-weight: 500;
    max-width: 600px;
}

.scroll-down {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 1rem auto 0;
    border: 2px solid #203061;
    border-radius: 50%;
    color: #203061;
    text-decoration: none;
    position: relative;
    transition: transform 0.3s ease;
}

.scroll-down::before {
    content: '↓';
    font-size: 1rem;
    line-height: 1;
}

.scroll-down:hover {
    transform: translateY(3px);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.video-content .cta {
    padding: 0.75rem 1.8rem;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--transition-slow);
}

.video-content .primary-cta {
    background-color: #203061;
    color: var(--white);
    box-shadow: 0 10px 30px rgba(20, 33, 61, 0.2);
}

.primary-cta:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(20, 33, 61, 0.3);
    background-color: var(--accent-blue);
}

.video-content .secondary-cta {
    background-color: transparent;
    color: #203061;
    border: 2px solid #203061;
}

.secondary-cta:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(20, 33, 61, 0.2);
}

@media (max-width: 768px) {
    .video-hero {
        height: auto;
        min-height: 100vh;
        padding-top: 100px;
        margin-top: -100px;
    }

    .video-content h1 {
        font-size: 3rem;
    }

    .video-content p {
        font-size: 1.2rem;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
}

/* Hero Section */
.hero {
    border: 30px solid #203061;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--white);
    position: relative;
    z-index: 1;
}

.hero-content {
    margin-left: 2rem;
}

.bonjour-img-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

.bonjour-img {
    width: 100%;
    max-width: 500px;
}

.hero-image img {
    max-width: 65%;
    height: auto;
    display: block;
    margin-left: 5rem;
}

/* Formations Section */
.formations {
    padding: 6rem 5%;
    margin-bottom: 4rem;
    position: relative;
}

.section-header {
    margin-bottom: 4rem;
    position: relative;
    display: inline-block;
}

.section-header h2 {
    color: var(--primary-blue);
    font-size: 2.5rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 12px;
    background-color: rgba(20, 33, 61, 0.1);
    z-index: 0;
    border-radius: 4px;
}

.formations-container {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    align-items: center;
}

.timeline {
    flex: 1.5;
    padding-left: 1rem;
    position: relative;
}



/* Re-doing the timeline line approach to match maquette exactly */
.timeline-item {
    border: none;
    margin-bottom: 1.5rem;
    padding-bottom: 2rem;
    position: relative;
    padding-left: 3rem;
    transition: transform var(--transition-fast);
}

.timeline-item:hover {
    transform: translateX(10px);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 7px;
    /* Adjust to center with dot */
    top: 24px;
    bottom: -10px;
    width: 2px;
    background-color: rgba(20, 33, 61, 0.2);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    position: absolute;
    left: 0;
    top: 5px;
    width: 16px;
    height: 16px;
    background-color: var(--white);
    border: 3px solid var(--primary-blue);
    border-radius: 50%;
    z-index: 1;
    transition: all var(--transition-fast);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.8);
}

.timeline-item:hover .timeline-dot {
    background-color: var(--primary-blue);
    transform: scale(1.2);
}



.timeline-year {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-year .highlight {
    color: var(--primary-blue);
    font-weight: 800;
}

.timeline-year .location {
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
    background: var(--bg-light);
    padding: 4px 12px;
    border-radius: 20px;
    margin-left: auto;
}

.timeline-content {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: box-shadow var(--transition-fast);
}

.timeline-item:hover .timeline-content {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.timeline-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-color);
}

.timeline-content .subtitle {
    font-style: italic;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    color: var(--primary-blue);
    opacity: 0.8;
}

.timeline-content .description {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
}



.formations-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.formations-image img {
    width: 80%;
    max-width: 400px;
    filter: drop-shadow(0 20px 30px rgba(20, 33, 61, 0.1));
    transition: transform var(--transition-slow);
}

.formations:hover .formations-image img {
    transform: rotate(5deg) scale(1.05);
}

/* Specific styles for Experiences */
#experiences .timeline-content {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
}

#experiences .timeline-year,
#experiences .timeline-year .highlight,
#experiences .timeline-content h4 {
    color: var(--white);
}

#experiences .timeline-content .subtitle {
    color: rgba(255, 255, 255, 0.9);
}

#experiences .timeline-content .description {
    color: rgba(255, 255, 255, 0.8);
}

#experiences .timeline-year .location {
    background: var(--white);
    color: var(--primary-blue);
}

/* Projets Section */
.projets {
    margin-top: -15rem;
    padding: 6rem 5%;
    position: relative;
}

.filters {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border: 1px solid rgba(20, 33, 61, 0.1);
    border-radius: 50px;
    background: var(--bg-light);
    color: var(--text-light);
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all var(--transition-fast);
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
    box-shadow: 0 4px 15px rgba(20, 33, 61, 0.2);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(20, 33, 61, 0.12);
}

.project-image {
    height: 0;
    padding-bottom: 75%;
    position: relative;
    background-color: var(--bg-light);
    overflow: hidden;
}

.project-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.project-card:hover .project-thumb {
    transform: scale(1.08);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(20, 33, 61, 0.95), rgba(20, 33, 61, 0.7) 60%, transparent);
    padding: 2rem 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity var(--transition-fast);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.project-card:hover .card-overlay {
    opacity: 1;
}

.card-overlay h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--white);
    transform: translateY(20px);
    transition: transform var(--transition-fast) 0.1s;
}

.card-overlay p {
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    transform: translateY(20px);
    transition: transform var(--transition-fast) 0.15s;
}

.project-card:hover .card-overlay h3,
.project-card:hover .card-overlay p {
    transform: translateY(0);
}

.tags {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 20;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--primary-blue);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.project-card:hover .tag {
    background-color: var(--primary-blue);
    color: var(--white);
}

/* Compétences Section (Damier) */
.competences {
    padding: 6rem 5%;
    position: relative;
    background-color: var(--bg-light);
}

.competences-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.comp-box {
    padding: 4rem 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.comp-box h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.comp-box p {
    font-size: 1.05rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* Damier 2 colonnes (Desktop) */
.competences-grid .comp-box:nth-child(4n+1),
.competences-grid .comp-box:nth-child(4n) {
    background-color: var(--primary-blue);
    color: var(--white);
}

.competences-grid .comp-box:nth-child(4n+1) h3,
.competences-grid .comp-box:nth-child(4n) h3 {
    color: var(--white);
}

.competences-grid .comp-box:nth-child(4n+2),
.competences-grid .comp-box:nth-child(4n+3) {
    background-color: var(--white);
    color: var(--primary-blue);
}

.competences-grid .comp-box:nth-child(4n+2) h3,
.competences-grid .comp-box:nth-child(4n+3) h3 {
    color: var(--primary-blue);
}

/* Hover effect */
.comp-box:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

/* Footer */
footer {
    padding: 4rem 5% 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background-color: var(--white);
    position: relative;
    z-index: 1;
}

.footer-content {
    display: flex;
    justify-content: space-between;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    width: 20%;
}

.footer-logo img {
    width: 50px;
}

.footer-columns {
    display: flex;
    justify-content: space-between;
    width: 70%;
}

.footer-col h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-col ul li,
.footer-col p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #333;
}

.footer-col ul li a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .burger-menu {
        display: flex;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--white);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right var(--transition-slow);
        z-index: 1000;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 3rem;
        text-align: center;
    }

    nav a {
        font-size: 1.5rem;
    }

    /* Keep header items aligned row, other sections below fold column */
    .hero,
    .formations-container,
    .footer-content {
        flex-direction: column;
    }

    .timeline {
        width: 100%;
        padding-left: 0;
    }

    .formations-image {
        display: none;
        /* Hide if too squashed */
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Damier 1 colonne (Mobile) */
    .competences-grid {
        grid-template-columns: 1fr;
    }

    .competences-grid .comp-box:nth-child(n) {
        background-color: var(--white);
        color: var(--primary-blue);
    }

    .competences-grid .comp-box:nth-child(2n+1) {
        background-color: var(--primary-blue);
        color: var(--white);
    }

    .competences-grid .comp-box:nth-child(2n+1) h3 {
        color: var(--white);
    }

    .footer-columns {
        flex-direction: column;
        gap: 2rem;
        width: 100%;
        margin-top: 2rem;
    }

    .footer-logo {
        width: 100%;
        flex-direction: row;
        align-items: center;
    }
}

/* ========================================= */
/* MODAL STYLES                              */
/* ========================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 33, 61, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    position: relative;
    z-index: 2001;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--text-color);
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.modal-close:hover {
    color: var(--primary-blue);
    transform: scale(1.1) rotate(90deg);
}

.modal-body {
    display: flex;
    flex-direction: row;
    overflow-y: auto;
    max-height: 90vh;
}

.modal-image-container {
    flex: 1;
    min-height: 300px;
    background-color: var(--bg-light);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-info {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.modal-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

.modal-tags {
    position: static;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.modal-tags .tag {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.modal-description {
    color: var(--text-color);
    line-height: 1.8;
}

.modal-description p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.modal-description ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-description li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.project-card {
    cursor: pointer;
}

@media (max-width: 768px) {
    .modal-body {
        flex-direction: column;
    }

    .modal-image-container {
        padding: 1rem;
        min-height: 200px;
    }

    .modal-info {
        padding: 2rem;
    }

    .modal-info h2 {
        font-size: 1.5rem;
    }

    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
    }
}