/* ========== Particle Canvas Overlay ========== */
.section-header {
    position: relative;
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.section-header #svg_body,
.section-header #svg_profil {
    position: relative;
    z-index: 2;
}

/* ========== Pill Buttons ========== */
.about-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
    margin-bottom: 8px;
    justify-content: center;
}

.about-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-family: 'Dosis', sans-serif;
    font-size: 1.5rem;
    padding: 10px 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.about-link:hover,
.about-link:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    color: #ffffff;
    text-decoration: none;
}

.about-link svg {
    flex-shrink: 0;
}

/* ========== Section Separator ========== */
.section-separator {
    width: 100%;
    border: none;
    border-bottom: 1px solid #EAF2F8;
    margin: 32px 0;
    opacity: 0.5;
}

/* ========== Plant SVG White Border ========== */
#svg_plant {
    margin-top: 137px;
}

#svg_plant,
#svg_plant_hori {
    filter: drop-shadow(2px 1px 0 #fff) !important;
}

/* ========== Photo Carousel Section ========== */
.section-photos {
    background-color: #EAF2F8;
    padding-top: 100px;
    padding-bottom: 50px;
    overflow: hidden;
}

.section-photos .page-header {
    border: none;
    margin: 0;
    padding: 0;
}

.section-photos .col-lg-12 {
    margin-bottom: 0 !important;
}

.section-photos .page-header h1 {
    font-family: 'Dosis', sans-serif;
    color: #333333;
    margin: 8px 0 2px;
}

.photo-carousel {
    width: 100%;
    margin: 75px auto;
    padding-bottom: 10px;
    height: 400px;
}

.photo-carousel .swiper-wrapper {
    align-items: center;
}

.photo-carousel .swiper-slide {
    width: 280px !important;
    height: 350px !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.photo-carousel .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photos-header {
    display: flex;
    align-items: baseline;
    gap: 20px;
}

.photos-instagram-link {
    color: #333333;
    border-color: rgba(51, 51, 51, 0.4);
    font-size: 1.5rem;
    padding: 6px 18px;
    position: relative;
    top: -4px;
}

.photos-instagram-link:hover,
.photos-instagram-link:focus {
    background: #333333;
    color: #ffffff;
    border-color: #333333;
}

.swiper-pagination-bullet {
    background: #1f94d2 !important;
}

.swiper-pagination-bullet-active {
    background: #1a78ab !important;
}

/* ========== GitHub Projects Section ========== */
.section-projects {
    background-color: #1f94d2;
    padding: 80px 0 80px;
}

.section-projects .page-header h1 {
    font-family: 'Dosis', sans-serif;
}

.projects-header {
    display: flex;
    align-items: baseline;
    gap: 20px;
}

.projects-github-link {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
    font-size: 1.5rem;
    padding: 6px 18px;
    position: relative;
    top: -4px;
}

.projects-github-link:hover,
.projects-github-link:focus {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.6);
}

.project-card {
    background: #ffffff;
    border: 1px solid #d1d9e0;
    border-radius: 16px;
    overflow: hidden;
}

.project-card-header {
    padding: 32px 32px 24px;
    background: #f6f8fa;
    border-bottom: 1px solid #d1d9e0;
}

.project-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.project-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #24292f;
    font-family: 'Dosis', sans-serif;
    font-size: 1.8rem;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.project-name:hover,
.project-name:focus {
    color: #24292f;
    opacity: 0.7;
    text-decoration: none;
}

.project-name svg {
    flex-shrink: 0;
}

.project-stars {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 215, 0, 0.15);
    color: #b08800;
    font-family: 'Dosis', sans-serif;
    font-size: 14px;
    padding: 6px 16px;
    border-radius: 100px;
}

.project-description {
    color: #57606a;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tag {
    background: #ddf4ff;
    color: #0969da;
    font-family: 'Dosis', sans-serif;
    font-size: 14px;
    padding: 5px 14px;
    border-radius: 100px;
    border: 1px solid #54aeff;
}

/* ========== Project Diagram ========== */
.project-diagram {
    padding: 20px 20px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    border-radius: 0 0 16px 16px;
}

.project-diagram svg {
    width: 100%;
    max-width: 800px;
    height: auto;
}

.diagram-mobile {
    display: none;
}

.diagram-device rect {
    fill: #f6f8fa;
    stroke: #d1d9e0;
    stroke-width: 1.5;
}

.device-control rect {
    stroke: rgba(74, 222, 128, 0.7);
    stroke-width: 1.5;
    fill: rgba(74, 222, 128, 0.08);
}

.device-icon {
    font-size: 18px;
    text-anchor: middle;
}

.device-label,
.device-label-sm {
    fill: #333333;
    font-family: 'Dosis', sans-serif;
    font-size: 13px;
    text-anchor: middle;
}

.device-label-sm {
    font-size: 11px;
}

.conn-label {
    fill: #666666;
    font-family: 'Dosis', sans-serif;
    font-size: 11px;
    text-anchor: middle;
}

.conn-label-green { fill: #2d8a4e; }

.legend-text {
    fill: #666666;
    font-family: 'Dosis', sans-serif;
    font-size: 11px;
}

/* Connection lines */
.conn-line {
    stroke-width: 2.5;
    fill: none;
    stroke-dasharray: 8 6;
    stroke-dashoffset: 0;
}
.conn-line-reduce {
    stroke-width: 2.5;
    fill: none;
    stroke-dasharray: 4 12;
    stroke-dashoffset: 0;
}

.conn-white { stroke: #888888; }
.conn-green { stroke: #4ade80; opacity: 0.85; }

.flow-right { animation: flowRight 12s linear infinite; }
.flow-left { animation: flowLeft 12s linear infinite; }
.flow-down { animation: flowDown 12s linear infinite; }
.flow-up { animation: flowUp 12s linear infinite; }

@keyframes flowRight { from { stroke-dashoffset: 280; } to { stroke-dashoffset: 0; } }
@keyframes flowLeft { from { stroke-dashoffset: -280; } to { stroke-dashoffset: 0; } }
@keyframes flowDown { from { stroke-dashoffset: 280; } to { stroke-dashoffset: 0; } }
@keyframes flowUp { from { stroke-dashoffset: -280; } to { stroke-dashoffset: 0; } }

/* ========== Blog Section — Timeline + Bookshelf ========== */
.section-blog {
    background-color: #EAF2F8;
    padding: 80px 0;
}

.section-blog .page-header h1 {
    font-family: 'Dosis', sans-serif;
    color: #333333;
    margin: 8px 0 2px;
}

.blog-header {
    display: flex;
    align-items: baseline;
    gap: 20px;
}

.blog-link {
    color: #333333;
    border-color: rgba(51, 51, 51, 0.4);
    font-size: 1.5rem;
    padding: 6px 18px;
    position: relative;
    top: -4px;
}

.blog-link:hover,
.blog-link:focus {
    background: #333333;
    color: #ffffff;
    border-color: #333333;
}

/* Timeline */
.blog-timeline {
    position: relative;
    padding-left: 60px;
    margin-top: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.blog-timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #1f94d2, #1a78ab);
    opacity: 0.4;
}

/* Year markers */
.blog-year-marker {
    position: relative;
    margin-bottom: 16px;
    margin-top: 8px;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.blog-year-marker.blog-visible {
    opacity: 1;
    transform: translateX(0);
}

.blog-year-label {
    position: absolute;
    left: -56px;
    top: 0;
    font-family: 'Dosis', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1f94d2;
    background: #EAF2F8;
    padding: 4px 8px;
    z-index: 1;
}

/* Timeline dots */
.blog-timeline-dot {
    position: absolute;
    left: -41px;
    top: 72px;
    z-index: 1;
}

.blog-dot {
    width: 12px;
    height: 12px;
    background: #1f94d2;
    border: 3px solid #EAF2F8;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.blog-entry.blog-visible .blog-dot {
    transform: scale(1);
}

/* Blog entries — scroll reveal */
.blog-entry {
    position: relative;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.blog-entry.blog-visible {
    opacity: 1;
    transform: translateY(0);
}

.blog-entry:nth-child(2) { transition-delay: 0.05s; }
.blog-entry:nth-child(3) { transition-delay: 0.1s; }
.blog-entry:nth-child(4) { transition-delay: 0.15s; }
.blog-entry:nth-child(5) { transition-delay: 0.2s; }
.blog-entry:nth-child(6) { transition-delay: 0.25s; }
.blog-entry:nth-child(7) { transition-delay: 0.3s; }
.blog-entry:nth-child(8) { transition-delay: 0.35s; }
.blog-entry:nth-child(9) { transition-delay: 0.4s; }

/* Book cards */
.blog-book {
    display: flex;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: #333333;
    border: 1px solid #d1d9e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-book:hover,
.blog-book:focus {
    transform: translateX(8px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: #333333;
}

/* Book cover */
.blog-book-cover {
    flex-shrink: 0;
    width: 140px;
    min-height: 100px;
    overflow: hidden;
}

.blog-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.blog-book:hover .blog-book-cover img {
    transform: scale(1.05);
}

/* Book content */
.blog-book-content {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.blog-book-date {
    font-family: 'Dosis', sans-serif;
    font-size: 15px;
    color: #1f94d2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.blog-book-title {
    font-family: 'Dosis', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #24292f;
    margin: 0 0 6px;
    line-height: 1.3;
}

.blog-book-excerpt {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    color: #57606a;
    line-height: 1.5;
    margin: 0 0 8px;
}

.blog-book-summary {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    color: #57606a;
    line-height: 1.6;
    margin: 0 0 12px;
}

/* Tags */
.blog-book-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.blog-book-tag {
    background: #ddf4ff;
    color: #0969da;
    font-family: 'Dosis', sans-serif;
    font-size: 14px;
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid #54aeff;
}

/* Read link */
.blog-book-read {
    font-family: 'Dosis', sans-serif;
    font-size: 16px;
    color: #1f94d2;
    transition: color 0.2s ease;
}

.blog-book:hover .blog-book-read {
    color: #1a78ab;
}

/* "Voir plus" card */
.blog-book-more {
    justify-content: center;
    border: 2px dashed #b8d4e8;
    background: transparent;
    padding: 20px;
    text-align: center;
}
.blog-book-more .blog-book-content {
    padding: 0;
}
.blog-book-more .blog-book-read {
    font-size: 16px;
    color: #1f94d2;
}
.blog-book-more:hover {
    border-color: #1f94d2;
    background: #fff;
}

/* Open book (first/latest article) */
.blog-entry-open .blog-book {
    flex-direction: column;
    border-left: 4px solid #1f94d2;
}

.blog-entry-open .blog-book-cover {
    width: 100%;
    height: 200px;
}

.blog-entry-open .blog-book-content {
    padding: 20px 24px;
}

.blog-entry-open .blog-book-title {
    font-size: 17px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .photo-carousel .swiper-slide {
        width: 220px !important;
        height: 275px !important;
    }
    .photo-carousel {
        height: 330px;
    }
    .section-projects {
        padding: 50px 0 50px;
    }
    .project-card-header {
        padding: 24px 20px 20px;
    }
    .project-name {
        font-size: 1.5rem;
    }
    .diagram-desktop {
        display: none;
    }
    .diagram-mobile {
        display: block;
    }
    .project-diagram svg {
        max-width: 320px;
    }
    .section-blog {
        padding: 50px 0;
    }
    .blog-timeline {
        padding-left: 44px;
    }
    .blog-timeline::before {
        left: 16px;
    }
    .blog-timeline-dot {
        left: -33px;
    }
    .blog-year-label {
        left: -49px;
    }
    .blog-entry-open .blog-book-cover {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .photo-carousel .swiper-slide {
        width: 180px !important;
        height: 225px !important;
    }
    .photo-carousel {
        height: 280px;
    }

    .about-links {
        justify-content: center;
    }
    .section-projects {
        padding: 40px 0 40px;
    }
    .project-card-header {
        padding: 20px 16px 16px;
    }
    .project-tag {
        font-size: 12px;
        padding: 4px 10px;
    }
    .project-description {
        font-size: 14px;
    }
    .section-blog {
        padding: 40px 0;
    }
    .blog-timeline {
        padding-left: 34px;
    }
    .blog-timeline::before {
        left: 10px;
    }
    .blog-timeline-dot {
        left: -29px;
    }
    .blog-year-label {
        left: -45px;
    }
    .blog-book {
        flex-direction: column;
    }
    .blog-book-cover {
        width: 100%;
        height: 110px;
    }
    .blog-entry-open .blog-book-cover {
        height: 130px;
    }
    .blog-book-tag {
        padding: 2px 8px;
    }
}
