* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

:root{
    --text: #111111;
    --line: rgba(20, 20, 20, 0.72);
    --left-bg: #ededed;
    --mid-bg: #e6e6e6;
    --right-bg: #a8b6d8;
}

html {
    scroll-behavior: smooth;
}

body {
    
    color: var(--text);
    min-height: 100vh;
    background: linear-gradient(
        90deg,
        var(--left-bg) 0%,
        #ececec 28%,
        var(--mid-bg) 44%,
        #d8deed 70%,
        var(--right-bg) 100%
    );
}

.history-page {
    width: 100%;
}

.history-wrapper {
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: 95px 90px 120px;
}

.back {
    margin-bottom: 95px;
}

.back a {
    text-decoration: none;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: opacity 0.25s ease;
}

.back a:hover {
    opacity: 0.65;
}

.timeline {
    position: relative;
    min-height: 1680px;
    isolation: isolate;
}

/* SVG lignes desktop */
.timeline-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.timeline-lines .line-path {
    fill: none;
    stroke: var(--line);
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

/* blocs */
.timeline-item {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 620px) 1fr;
    column-gap: 85px;
    align-items: start;
    width: 100%;
}

.timeline-item.reverse {
    grid-template-columns: 1fr minmax(0, 620px);
}

/* positionnement vertical */
.item-2023 {
    padding-top: 155px;
}

.item-2024 {
    margin-top: 285px;
}

.item-2025 {
    margin-top: 310px;
}

/* texte */
.text-box {
    position: relative;
    z-index: 3;
    max-width: 620px;
}

.text-box p {
    font-size: 16px;
    line-height: 1.48;
    color: #1b1b1b;
    margin-bottom: 14px;
}

.text-box p:last-child {
    margin-bottom: 0;
}

/* année */
.year-box {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: flex-start;
}

.year-box h2 {
    font-size: clamp(4.2rem, 8vw, 6.4rem);
    font-weight: 300;
    line-height: 0.92;
    letter-spacing: -0.06em;
    color: #101010;
}

/* placements proches de la maquette */
.item-2023 .text-box {
    justify-self: start;
}

.item-2023 .year-box {
    justify-self: end;
    padding-top: 5px;
}

.item-2024 .year-box {
    justify-self: start;
    padding-top: 6px;
}

.item-2024 .text-box {
    justify-self: end;
}

.item-2025 .text-box {
    justify-self: start;
}

.item-2025 .year-box {
    justify-self: end;
    padding-top: 5px;
}

/* =========================
   ANIMATIONS DESKTOP
   ========================= */

@media (min-width: 1101px) {

    .reveal .text-box {
        opacity: 0;
        transform: translateY(55px);
        transition:
            opacity 0.8s ease,
            transform 0.8s ease;
    }

    .reveal .year-box {
        opacity: 0;
        transform: translateY(28px);
        transition:
            opacity 0.75s ease 0.12s,
            transform 0.75s ease 0.12s;
    }

    .reveal .text-box p {
        opacity: 0;
        transform: translateY(18px);
        transition:
            opacity 0.55s ease,
            transform 0.55s ease;
    }

    .reveal.visible .text-box {
        opacity: 1;
        transform: translateY(0);
    }

    .reveal.visible .year-box {
        opacity: 1;
        transform: translateY(0);
    }

    .reveal.visible .text-box p:nth-child(1) {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.12s;
    }

    .reveal.visible .text-box p:nth-child(2) {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.26s;
    }

    .reveal.visible .text-box p:nth-child(3) {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.38s;
    }

    .item-2023 .year-box,
    .item-2025 .year-box {
        transform: translateX(18px) translateY(28px);
    }

    .item-2024 .year-box {
        transform: translateX(-18px) translateY(28px);
    }

    .reveal.visible.item-2023 .year-box,
    .reveal.visible.item-2025 .year-box,
    .reveal.visible.item-2024 .year-box {
        transform: translateX(0) translateY(0);
    }
}

/* =========================
   TABLETTE
   ========================= */

@media (max-width: 1100px) {
    body {
        background: linear-gradient(180deg, #efefef 0%, #d3daeb 100%);
    }

    .history-wrapper {
        padding: 70px 34px 90px;
    }

    .back {
        margin-bottom: 55px;
    }

    .timeline {
        min-height: auto;
        padding-left: 28px;
    }

    .timeline::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 8px;
        width: 1px;
        height: calc(100% - 8px);
        background: rgba(25, 25, 25, 0.32);
        z-index: 0;
    }

    .timeline-lines {
        display: none;
    }

    .timeline-item,
    .timeline-item.reverse {
        display: block;
        margin-top: 0;
        margin-bottom: 55px;
        padding-top: 0;
    }

    .item-2023,
    .item-2024,
    .item-2025 {
        margin-top: 0;
        padding-top: 0;
    }

    .timeline-item::before {
        content: "";
        position: absolute;
        left: -24px;
        top: 22px;
        width: 11px;
        height: 11px;
        background: #101010;
        border-radius: 50%;
        z-index: 1;
    }

    .year-box,
    .item-2023 .year-box,
    .item-2024 .year-box,
    .item-2025 .year-box {
        justify-self: start;
        margin-bottom: 14px;
        padding-top: 0;
    }

    .text-box,
    .item-2023 .text-box,
    .item-2024 .text-box,
    .item-2025 .text-box {
        max-width: 100%;
        justify-self: start;
    }

    .text-box {
        background: rgba(255, 255, 255, 0.30);
        border: 1px solid rgba(255, 255, 255, 0.32);
        backdrop-filter: blur(2px);
        border-radius: 20px;
        padding: 18px 16px;
    }

    .year-box h2 {
        font-size: clamp(3.4rem, 10vw, 5rem);
    }

    .text-box p {
        font-size: 15px;
        line-height: 1.6;
    }

    /* animations plus simples sur tablette/mobile */
    .reveal .text-box,
    .reveal .year-box,
    .reveal .text-box p {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 700px) {
    .history-wrapper {
        padding: 30px 18px 50px;
    }

    .back {
        margin-bottom: 34px;
    }

    .back a {
        font-size: 13px;
    }

    .timeline {
        padding-left: 20px;
    }

    .timeline::before {
        left: 6px;
    }

    .timeline-item {
        margin-bottom: 38px;
    }

    .timeline-item::before {
        left: -16px;
        top: 18px;
        width: 10px;
        height: 10px;
    }

    .year-box {
        margin-bottom: 10px;
    }

    .year-box h2 {
        font-size: clamp(2.9rem, 14vw, 4rem);
        letter-spacing: -0.05em;
    }

    .text-box {
        padding: 16px 14px;
        border-radius: 16px;
    }

    .text-box p {
        font-size: 14px;
        line-height: 1.62;
    }
}

/* =========================
   PETIT MOBILE
   ========================= */

@media (max-width: 420px) {
    .history-wrapper {
        padding: 22px 14px 40px;
    }

    .timeline {
        padding-left: 18px;
    }

    .timeline::before {
        left: 5px;
    }

    .timeline-item::before {
        left: -14px;
        width: 9px;
        height: 9px;
        top: 17px;
    }

    .year-box h2 {
        font-size: 2.55rem;
    }

    .text-box {
        padding: 14px 12px;
        border-radius: 14px;
    }

    .text-box p {
        font-size: 13.4px;
        line-height: 1.6;
    }
}