/* Variables de couleurs et thèmes */
:root {
    --primary-blue: rgb(29, 47, 111);
    --secondary-blue: rgb(131, 144, 250);
    --accent-orange: #fab348;
    --light-orange: #fffaf0;
    --text-dark: rgb(45, 55, 72);
    --text-light: #718096;
    --white: #ffffff;
    --bg-gray: #f7fafc;
    --highlight-gray: #e0e3e5;
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    /*background-color: var(--bg-gray);*/
    background-image: linear-gradient(var(--bg-gray), var(--light-orange));
    scroll-behavior: smooth;
    /*overflow-x: hidden;*/
}

h3 {
    font-size: 1.8rem;
    color: var(--primary-blue);
}

/* Navigation */
nav {
    background: rgba(29, 47, 111, 0.99);
/*    background: var(--primary-blue) 0.8;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    border-bottom: 1px solid var(--primary-blue);*/

    color: var(--accent-orange);
    padding: 0.7rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(45, 55, 72, 0.1);
}

/* Profile & Dropdown Section */
.profile-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50px;
    border: solid 1px rgba(29, 47, 111, 0);
    transition: var(--transition);
}

.profile-container:hover {
    background: rgba(255, 255, 255, 0.1);
    border: solid 1px rgba(29, 47, 111, 0.8);
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-orange);
    object-fit: cover;
    border: 2px solid var(--white);
    box-shadow: 
    0 0 1px rgba(45, 55, 72, 0.8),  
    0 0 8px rgba(45, 55, 72, 0.4);
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    text-shadow:
    0 0 2px rgba(45, 55, 72, 0.8),  
    0 0 8px rgba(45, 55, 72, 0.4);
    /*-1px -1px 1px rgba(45, 55, 72, 0.4),  
    1px -1px 1px rgba(45, 55, 72, 0.4),
    -1px  1px 1px rgba(45, 55, 72, 0.4),
    1px  1px 1px rgba(45, 55, 72, 0.4),
    0 0 8px rgba(45, 55, 72, 0.4);*/
}

/* Dropdown Menu */
#dropdown-menu {
    position: absolute;
    top: 120%;
    left: 0;
    background: var(--white);
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    padding: 10px 0;
    z-index: 1001;
}

.profile-container:hover #dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.profile-container.is-active {
    background: rgba(255, 255, 255, 0.1);
    border: solid 1px rgba(29, 47, 111, 0.8);
}
.profile-container.is-active #dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--highlight-gray);
    color: var(--primary-blue);
}

.dropdown-item svg {
    margin-right: 12px;
    width: 18px;
    height: 18px;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    text-shadow: 
    0 0 2px rgba(45, 55, 72, 0.8),  
    0 0 8px rgba(45, 55, 72, 0.4);
    /*-1px -1px 1px rgba(45, 55, 72, 0.4),  
    1px -1px 1px rgba(45, 55, 72, 0.4),
    -1px  1px 1px rgba(45, 55, 72, 0.4),
    1px  1px 1px rgba(45, 55, 72, 0.4),
    0 0 8px rgba(45, 55, 72, 0.4);*/
}


.nav-links a:hover {
    color: var(--accent-orange);
}


/* Hero Section */
/*header::before {
    content: "";
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/layered-peaks-haikei.svg'); 
    background-repeat: no-repeat;
    background-size: cover;
    background-position: bottom;
    z-index: 1;
}*/

/*header {
    position: relative;
    height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    padding: 0 1rem;
    overflow-y: visible;
    background-color: var(--primary-blue);
}*/
/*
.parallax-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.parallax-container svg {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
}
*/
.layer {
    transition: all 0.1s ease;
}

header {
    position: relative;
    height: 75vh;
    overflow-y: visible; /* Keeps mountains inside the header */
    overflow-x: clip;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    background-color: var(--primary-blue);
}

.parallax-header {
    position: absolute;
    /*bottom: -5px; /* Tiny offset to prevent sub-pixel gaps */
    top: 5vh;
    left: 0;
    width: 100%;
    height: 70vh;
    z-index: 1;
    pointer-events: none; /* User can still highlight text/click buttons */
}

.parallax-header svg {
    min-width: 130vw; /* Scale up so we have "bleed" room for the horizontal movement */
    height: 101%;
    min-height: 300px; /* Ensure it covers enough ground */
    position: absolute;
    top: 0;
    left: 0;
}

.hero-content {
    position: relative;
    z-index: 10; /* Put text way above the mountains */
    padding: 0 2rem;
    /* Optional: helps text stand out if mountains are light */
    pointer-events: auto; 
}



header h1, header p, header .accent-bar {
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

header p {
    font-size: 1.25rem;
    max-width: 750px;
    opacity: 1;
    font-weight: 500;
    margin: 0 auto;
}

.accent-bar {
    width: 80px;
    height: 4px;
    background-color: var(--accent-orange);
    margin: 1.5rem 0;
    justify-self: center;
}

/* Section Projects */
.container {
    max-width: 1000px;
    margin: 2rem auto 4rem auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.2rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

/* Filters */
.filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border: 2px solid var(--secondary-blue);
    background: transparent;
    color: var(--secondary-blue);
    cursor: pointer;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--secondary-blue);
    color: var(--white);
}

/* Grid - Masonry-like layout */
.projects-grid {
/*    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    gap: 2rem;
    align-items: start;
    justify-items: center;*/

    /*display: grid;*/
    /* This creates as many 350px columns as will fit, then stretches them */
    /*grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));*/
    column-count: 3;
    gap: 2rem;
    padding: 2rem 0;
    align-items: start;
    justify-items: center;
}

.project-card {
/*  max-width: min(300px, 90vw);
    grid-column: span 1;
    grid-row: span 2;*/
    max-width: 350px;
    margin-bottom: 2rem;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: fit-content; /* or 100% to makes all cards in a row same height */
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.1);
}

.card-image {
    position: relative;
    /*height: fit-content;*/
    aspect-ratio: 1.414;
    width: 100%;
    overflow: hidden;
    background-color: var(--white);
    border-radius: 12px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* "Cover" prevents white bars; "contain" shows full image */
    transition: transform 0.5s ease;
    display: block;
}

.card-image p a {
    display: inline;
}


.project-card.vertical .card-image {
    /*width: fit-content;
    height: auto;*/
    aspect-ratio: 1 / 1.414;
    border-right: 1px solid #edf2f7;
    background: #fff;
}

.project-card:hover .card-image img {
    transform: scale(1.02);
}

.project-card p {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 60%);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    color: white;
    font-size: 0.85rem;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s ease;
    /*pointer-events: none; /* Allows clicking the image through the text */
    text-shadow: 0 0 4px rgba(45, 55, 72, 0.6);
}
.project-card:hover .card-image p {
    opacity: 100%;
}

.card-image a {
    color: var(--white);
}

.card-content {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Makes content area fill space */
}

.card-content a:nth-child(2) {
    text-decoration: none;
    color: var(--primary-blue);
}
.card-content a:nth-child(2):hover {
    text-decoration: underline;
    color: var(--primary-blue);
}

.category-tag {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    align-self: flex-start;
}

.tag-pwc { background: #fee2e2; color: #b91c1c; } 
.tag-eco { background: #e0f2fe; color: #0369a1; } 
.tag-kaggle { background: #fef3c7; color: #92400e; } 
.tag-blog { background: #f3f4f6; color: #374151; }

.project-card h3 {
    margin-bottom: 0.8rem;
    color: var(--primary-blue);
    font-size: 1.25rem;
}

.card-footer {
/*    padding: 1.5rem;
    background-color: #fcfcfc;
    align-self: flex-end;*/
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #edf2f7;
}

.btn-link {
    text-decoration: none;
    color: var(--accent-orange);
    font-weight: bold;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-self: flex-end;
    gap: 5px;
}
.btn-link:hover {
    text-decoration: underline;
}


/* Section layout */
#blog {
    margin-bottom: 2rem;
    text-align: justify;
}

#blog h2, #blog h3, #blog h4 {
    text-align: center;
}

#blog strong, #blog i {
    font-size: 1rem;
}

/* ── Tab bar ───────────────────────────────────────────────── */
.blog-tabs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.blog-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border: 2px solid var(--secondary-blue);
    background: transparent;
    color: var(--secondary-blue);
    cursor: pointer;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

.blog-tab svg {
    flex-shrink: 0;
    transition: var(--transition);
}

.blog-tab:hover,
.blog-tab.active {
    background-color: var(--secondary-blue);
    color: var(--white);
}

/* ── Panels wrapper (clips overflow during animation) ───────── */
.blog-panels-wrapper {
    position: relative;
    overflow: hidden;        /* keeps off-screen panels invisible */
    /* min-height prevents layout jump when panels change */
    min-height: 8rem;
}

/* ── Individual panels ──────────────────────────────────────── */
.blog-panel {
    /* Hidden panels sit below, invisible */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(24px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(.43,.01,.49,1.19);
    /* Don't let hidden panels contribute to wrapper height */
    visibility: hidden;
    display: flex;
    flex-direction: row;
    gap: 2rem;
}

.blog-panel.active {
    position: relative;      /* back in flow → sets wrapper height */
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

/* ── Placeholder (Articles tab) ─────────────────────────────── */
.blog-placeholder {
    background-color: rgba(0, 0, 0, 0.06);
    border: 2px dashed rgba(0, 0, 0, 0.25);
    padding: 3rem;
    text-align: center;
    border-radius: 12px;
    margin: 0 auto;
}
/*
.blog-placeholder {
    background-color: rgba(0, 0, 0, 0.06);
    border: 2px dashed rgba(0, 0, 0, 0.25);
}*/

/* ── Reading notes ───────────────────────────────────────────── */
.notes-lecture div {
    display: flow-root;
    margin: 2rem 1rem;
    font-size: 0.85rem;
}

.notes-lecture .headline {
    margin: 0 0 0.5rem 0;
    text-align: start;
}

.notes-lecture img {
    float: left;
    max-height: 150px;
    margin: 0 1rem 0.5rem 0;
    border: 2px solid var(--light-orange);
    border-radius: 12px;
    box-shadow: 0 0 5px rgba(45, 55, 72, 0.6);
}

.notes-lecture p,
.notes-lecture details {
    margin: 0;
    font-size: 0.85rem;
}

.note li {
    margin: 0.5rem 0 0.5rem 2rem;
}

/* Custom summary/chevron */
.notes-lecture details > summary,
.youtube details > summary {
    cursor: pointer;
    list-style: none;         /* remove default marker in Firefox */
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--secondary-blue);
    margin-top: 0.4rem;
    transition: color 0.2s ease;
    user-select: none;
}

.notes-lecture details > summary::-webkit-details-marker,
.youtube details > summary::-webkit-details-marker {
    display: none;            /* remove default marker in Chrome/Safari */
}

.notes-lecture details > summary::before,
.youtube details > summary::before {
    content: "";
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin-bottom: 2px;       /* optical centering */
}

details[open] > summary::before {
    transform: rotate(45deg);
}

details > summary:hover {
    color: var(--primary-blue);
}

/* ── YouTube recommendations ──────────────────────────────── */
.youtube div {
    margin: 2rem 0 3rem 0;
    font-size: 0.85rem;
}

.youtube a {
    color: var(--text-dark);
}

.channel-link {
    display: inline-flex;
    flex-direction: row;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-dark);
    margin: 0 1rem -1rem 1rem;
    transition: var(--transition);
    align-items: center;
}

.channel-link:hover {
    text-decoration: underline;
}

.channel-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--white);
    transition: var(--transition);
    box-shadow:
        0 0 1px rgba(45, 55, 72, 0.8),
        0 0 8px rgba(45, 55, 72, 0.4);
}

.channel-link:hover .channel-pic {
    border-color: var(--secondary-blue);
    box-shadow:
        0 0 1px rgba(131, 144, 250, 0.8),
        0 0 8px rgba(131, 144, 250, 0.4);
}

/* ── Scroll-reveal animation (keep as-is) ───────────────────── */
.note {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.note.is-visible {
    opacity: 1;
    transform: translateY(0);
}



/* Footer */
/*footer {
    position: relative;
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: center;
    text-align: center;
    color: var(--white);
    padding: 0 5% 4rem 5%;
    overflow-y: visible;
    background-color: var(--accent-orange);
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/layered-waves-haikei.svg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top;
    z-index: 1;
}*/

footer {
    position: relative;
    height: 60vh;
    overflow-y: visible; /* Keeps mountains inside the header */
    overflow-x: clip;
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: center;
    text-align: center;
    color: var(--white);
    padding: 0 5% 4rem 5%;
    background-color: var(--accent-orange);
}
.parallax-footer {
    position: absolute;
    /*top: -5px; /* Tiny offset to prevent sub-pixel gaps */
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none; /* User can still highlight text/click buttons */
    background-color: var(--accent-orange);
}
.parallax-footer svg {
    min-width: 120vw;
    height: 101%;
    min-height: 200px;
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: var(--accent-orange);
}
.footer-content {
    position: relative;
    z-index: 10; /* Put text way above the mountains */
    padding: 0 2rem;
    /* Optional: helps text stand out if mountains are light */
    pointer-events: auto;
    bottom: -190px;
}

footer h4, footer p, footer * {
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    line-height: 2;
}
footer h4 {
    cursor: default;
    pointer-events: all;
    margin: 0 auto;
}


/* Responsive */
@media (max-width: 900px) {
    .section-title h2 { font-size: 2rem; }
    header h1 { font-size: 2.5rem; }
    header p { font-size: 1.2rem; font-weight: 450; }
    header { height: 70vh; }
    .parallax-header { height: 65vh;}
    .projects-grid { column-count: 2; }
    .container { padding: 0 1rem }
}

@media (max-width: 600px) {
    .section-title h2 { font-size: 1.8rem; }
    header h1 { font-size: 2.2rem; }
    header p { font-size: 1.1rem; font-weight: 400; }
    header { height: 65vh; }
    .parallax-header { height: 60vh;}
    .nav-links { font-size: 0.8rem;}
    .nav-links li { margin-left: 1rem; }
    .projects-grid { column-count: 1; }
}