/* ==========================================================================
   Portfolio Antoine Basset — design system partagé
   Encre marine + bordeaux, sur papier froid.
   ========================================================================== */

:root {
    --paper: #f4f5f7;
    --surface: #ffffff;
    --ink: #131a33;
    --muted: #586079;
    --line: #d9dce4;
    --bordeaux: #8a1538;
    --bordeaux-dark: #6b0f2a;
    --bordeaux-soft: #f3e4e9;

    --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
    --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;

    --container: 1120px;
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --radius: 6px;
    --header-h: 72px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img,
video,
iframe {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 0.6em;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4.25rem);
}

h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
}

h3 {
    font-size: 1.375rem;
}

p {
    margin: 0 0 1em;
}

a {
    color: var(--bordeaux);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--bordeaux-dark);
}

:focus-visible {
    outline: 2px solid var(--bordeaux);
    outline-offset: 3px;
    border-radius: 2px;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0.5rem;
    background: var(--ink);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 2000;
}

.skip-link:focus {
    left: 0.5rem;
}

/* ---------- En-tête ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(244, 245, 247, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}

.brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
}

.brand:hover {
    color: var(--ink);
}

.brand span {
    color: var(--bordeaux);
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    display: block;
    padding: 0.5rem 0.85rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.975rem;
    font-weight: 500;
    border-radius: var(--radius);
}

.nav-links a:hover {
    color: var(--ink);
}

.nav-links a[aria-current="page"] {
    color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--bordeaux);
    border-radius: 0;
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.55rem 0.7rem;
    cursor: pointer;
    color: var(--ink);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
}

@media (max-width: 760px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        padding: 0.5rem var(--gutter) 1rem;
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-links a {
        padding: 0.8rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--line);
    }

    .nav-links a[aria-current="page"] {
        box-shadow: none;
        color: var(--bordeaux);
    }
}

/* ---------- Boutons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.4rem;
    border-radius: var(--radius);
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    font: inherit;
    font-size: 0.975rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    background: var(--bordeaux);
    border-color: var(--bordeaux);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
}

.btn-ghost:hover {
    background: var(--ink);
    border-color: var(--ink);
}

.btn[disabled] {
    opacity: 0.6;
    cursor: progress;
}

/* ---------- Sections génériques ---------- */

.page {
    padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(4rem, 9vw, 6rem);
}

.page-intro {
    max-width: 44rem;
    margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.page-intro p {
    color: var(--muted);
    font-size: 1.15rem;
}

.section + .section {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    padding-top: clamp(3rem, 6vw, 4rem);
    border-top: 1px solid var(--line);
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.section-head h2 {
    margin: 0;
}

.muted {
    color: var(--muted);
}

.tags {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
}

/* ---------- Accueil ---------- */

.hero {
    padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(3rem, 7vw, 5rem);
    border-bottom: 1px solid var(--line);
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
    grid-template-areas:
        "main photo"
        "main now";
    column-gap: clamp(2.5rem, 6vw, 5rem);
    align-items: start;
}

.hero-main {
    grid-area: main;
}

.hero-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3.5rem, 9.5vw, 8.75rem);
    line-height: 0.88;
    letter-spacing: -0.045em;
    margin: 0 0 clamp(2rem, 4vw, 3rem);
    font-variation-settings: "wdth" 85;
}

.hero-name .line-2 {
    display: block;
    color: var(--bordeaux);
    padding-left: clamp(0rem, 6vw, 5.5rem);
}

.hero-lead {
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    line-height: 1.5;
    max-width: 36rem;
    margin-bottom: 1.75rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hero-photo {
    grid-area: photo;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 60% 30%;
    border-radius: var(--radius);
    margin-bottom: 1.75rem;
}

.now {
    grid-area: now;
    border-left: 2px solid var(--bordeaux);
    padding-left: 1.25rem;
    margin: 0;
}

.now dt {
    font-size: 0.875rem;
    color: var(--muted);
}

.now dd {
    margin: 0 0 1rem;
    font-weight: 500;
}

.now dd:last-child {
    margin-bottom: 0;
}

@media (max-width: 860px) {
    .hero-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "photo"
            "main"
            "now";
    }

    .hero-photo {
        width: min(220px, 55%);
    }

    .now {
        margin-top: 2.5rem;
    }
}

/* ---------- Projets ---------- */

.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font: inherit;
    font-size: 0.925rem;
    color: var(--muted);
    cursor: pointer;
}

.filter-btn:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.filter-btn.active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(2.5rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 2.5rem);
}

.project-card {
    cursor: pointer;
    outline: none;
}

.project-card[hidden] {
    display: none;
}

.project-media {
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--line);
    margin-bottom: 1.1rem;
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-media img,
.project-card:focus-visible .project-media img {
    transform: scale(1.03);
}

.project-card:focus-visible .project-media {
    outline: 2px solid var(--bordeaux);
    outline-offset: 3px;
}

.project-card h3 {
    margin-bottom: 0.3rem;
}

.project-type {
    color: var(--bordeaux);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.project-card .project-summary {
    color: var(--muted);
    margin-bottom: 0.9rem;
}

.project-links {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-weight: 500;
    font-size: 0.95rem;
}

.project-card .project-details-src {
    display: none;
}

@media (max-width: 760px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Fenêtre de détails */

.project-details {
    width: min(860px, calc(100% - 2rem));
    max-height: calc(100vh - 3rem);
    padding: 0;
    border: none;
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    overflow: auto;
}

.project-details::backdrop {
    background: rgba(19, 26, 51, 0.7);
}

.project-details[open] {
    position: fixed;
}

.details-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.details-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.details-body {
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.details-body .project-summary {
    color: var(--ink);
}

.details-body section {
    margin-top: 2rem;
}

.details-video {
    aspect-ratio: 16 / 9;
}

.details-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--radius);
}

/* ---------- À propos ---------- */

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
}

.portrait {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
}

.about-aside .links {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
}

.about-aside .links li {
    border-top: 1px solid var(--line);
}

.about-aside .links a {
    display: flex;
    justify-content: space-between;
    padding: 0.7rem 0;
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
}

.about-aside .links a:hover {
    color: var(--bordeaux);
}

.about-aside .links a span {
    color: var(--muted);
    font-weight: 400;
}

.about-body {
    max-width: 40rem;
}

.about-body .section {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--line);
}

.about-body .lead {
    font-size: 1.3rem;
    line-height: 1.5;
}

.focus-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.focus-list h3 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

.focus-list p {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0;
}

@media (max-width: 860px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .portrait {
        max-width: 280px;
    }

    .focus-list {
        grid-template-columns: 1fr;
    }
}

/* CV */

.cv-dialog {
    width: min(900px, calc(100% - 2rem));
    max-height: calc(100vh - 3rem);
    padding: 1.25rem;
    border: none;
    border-radius: 10px;
    background: var(--surface);
}

.cv-dialog::backdrop {
    background: rgba(19, 26, 51, 0.7);
}

.cv-dialog-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cv-dialog-bar h2 {
    font-size: 1.4rem;
    margin: 0;
}

.cv-dialog-bar div {
    display: flex;
    gap: 0.5rem;
}

.cv-dialog img {
    width: 100%;
    border: 1px solid var(--line);
}

/* ---------- Timeline (Expériences) ---------- */

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 2rem;
    padding: 2rem 0;
    border-top: 1px solid var(--line);
}

.timeline-item:first-child {
    border-top: none;
    padding-top: 0;
}

.timeline-date {
    color: var(--muted);
    font-size: 0.95rem;
    padding-top: 0.2rem;
}

.timeline-item.is-current .timeline-date {
    color: var(--bordeaux);
    font-weight: 600;
}

.timeline-item h3 {
    margin-bottom: 0.2rem;
}

.timeline-org {
    font-weight: 500;
    margin-bottom: 0.9rem;
}

.timeline-body {
    max-width: 42rem;
}

.timeline-body ul {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
}

.timeline-body li {
    margin-bottom: 0.35rem;
}

.timeline-body li::marker {
    color: var(--bordeaux);
}

@media (max-width: 680px) {
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

.skills {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
}

.skills h3 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.skills ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.skills li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--line);
}

@media (max-width: 860px) {
    .skills {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- Contact ---------- */

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
}

.contact-list {
    margin: 0;
}

.contact-list div {
    padding: 1rem 0;
    border-top: 1px solid var(--line);
}

.contact-list dt {
    font-size: 0.875rem;
    color: var(--muted);
}

.contact-list dd {
    margin: 0.15rem 0 0;
    font-weight: 500;
}

.reveal-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 500;
    color: var(--bordeaux);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.form-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.form-panel h2 {
    font-size: 1.6rem;
}

.form-note {
    color: var(--muted);
    font-size: 0.95rem;
}

.user-connected {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 0;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.user-connected[hidden] {
    display: none;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.user-connected p {
    margin: 0;
    line-height: 1.3;
}

.user-email {
    color: var(--muted);
    font-size: 0.9rem;
}

.user-connected .btn {
    margin-left: auto;
    padding: 0.5rem 0.9rem;
    font-size: 0.875rem;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font: inherit;
}

.form-group input[readonly] {
    color: var(--muted);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: 2px solid var(--bordeaux);
    outline-offset: 0;
    border-color: transparent;
    background: var(--surface);
}

.form-group textarea {
    min-height: 160px;
    resize: vertical;
}

.form-status {
    margin: 1rem 0 0;
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.form-status[hidden] {
    display: none;
}

.form-status.is-success {
    background: #e3f1e8;
    color: #1d5b34;
}

.form-status.is-error {
    background: var(--bordeaux-soft);
    color: var(--bordeaux-dark);
}

@media (max-width: 860px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Pied de page ---------- */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 2rem 0;
    color: var(--muted);
    font-size: 0.925rem;
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-footer ul {
    display: flex;
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer a {
    color: var(--muted);
}

.site-footer a:hover {
    color: var(--bordeaux);
}

/* ---------- Mouvement ---------- */

@media (prefers-reduced-motion: no-preference) {
    .hero-photo {
        animation: fade 0.9s 0.2s ease both;
    }

    @keyframes fade {
        from {
            opacity: 0;
        }
    }

    .hero-name {
        animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    }

    .hero-name .line-2 {
        animation: rise 0.8s 0.12s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    }

    @keyframes rise {
        from {
            opacity: 0;
            transform: translateY(0.25em);
        }
        to {
            opacity: 1;
            transform: none;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

a.project-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

a.project-card:hover h3 {
    color: var(--bordeaux);
}

.aside-name {
    font-size: 1.5rem;
    margin-bottom: 0.15rem;
}

.aside-role {
    color: var(--muted);
    margin: 0;
}

.about-aside .links-btn {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0.7rem 0;
    background: none;
    border: none;
    font: inherit;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}

.about-aside .links-btn:hover {
    color: var(--bordeaux);
}

.about-aside .links-btn span {
    color: var(--muted);
    font-weight: 400;
}

.project-card {
    scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.project-card:target .project-media {
    outline: 2px solid var(--bordeaux);
    outline-offset: 4px;
}

/* Galerie de la fenêtre de détails : 1, 2 ou 3 images par rangée */

.details-gallery {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.details-gallery[hidden] {
    display: none;
}

.gallery-block {
    margin: 0;
}

.gallery-caption {
    margin-top: 0.75rem;
}

.gallery-caption h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin: 0 0 0.25rem;
}

.gallery-caption p {
    color: var(--muted);
    margin: 0;
}

.gallery-row {
    display: grid;
    gap: 1rem;
}

.gallery-row--1 {
    grid-template-columns: 1fr;
}

.gallery-row--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-row img,
.gallery-row video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--line);
}

.gallery-row--1 img,
.gallery-row--1 video {
    aspect-ratio: 16 / 9;
}

.gallery-row--2 img {
    aspect-ratio: 4 / 3;
}

.gallery-row--3 img {
    aspect-ratio: 1 / 1;
}

/* Images cliquables : ouvrent l'image agrandie */
.gallery-row img[role="button"] {
    cursor: zoom-in;
}

.gallery-row img:focus-visible {
    outline: 3px solid var(--bordeaux);
    outline-offset: 3px;
}

/* Mode « image entière » (data-galerie="entiere") : pas de rognage */
.details-gallery--entiere .gallery-row {
    align-items: start;
}

.details-gallery--entiere .gallery-row img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(70vh, 36rem);
    aspect-ratio: auto;
    object-fit: contain;
    justify-self: center;
}

/* Image agrandie */
.image-zoom {
    max-width: calc(100% - 2rem);
    max-height: calc(100vh - 2rem);
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    cursor: zoom-out;
}

.image-zoom::backdrop {
    background: color-mix(in srgb, var(--ink) 85%, transparent);
}

.image-zoom img {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
}

@media (max-width: 560px) {
    .details-gallery--entiere .gallery-row--2 {
        grid-template-columns: 1fr;
    }

    .gallery-row--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-row--3 img:first-child {
        grid-column: 1 / -1;
        aspect-ratio: 16 / 9;
    }
}

/* ---------- Frise animée (Parcours) ---------- */

.frise {
    position: relative;
    padding: 1rem 0;
}

.frise-track {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    background: var(--line);
    border-radius: 3px;
    overflow: hidden;
}

.frise-progress {
    width: 100%;
    height: 100%;
    background: var(--bordeaux);
    transform-origin: top center;
}

.frise-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.frise-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 4rem minmax(0, 1fr);
    align-items: start;
}

.frise-item + .frise-item {
    margin-top: clamp(2.5rem, 6vw, 4.5rem);
}

.frise-dot {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    width: 18px;
    height: 18px;
    margin-top: 1.6rem;
    border-radius: 50%;
    background: var(--paper);
    border: 3px solid var(--bordeaux);
    box-shadow: 0 0 0 6px var(--paper);
    position: relative;
    z-index: 1;
}

.frise-item.is-current .frise-dot {
    background: var(--bordeaux);
}

.frise-date {
    grid-row: 1;
    margin: 1.35rem 0 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--muted);
}

.frise-item.is-current .frise-date {
    color: var(--bordeaux);
}

.frise-card {
    grid-row: 1;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.5rem 1.6rem 1.1rem;
}

.frise-card h3 {
    margin-bottom: 0.2rem;
}

.frise-card ul {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
}

.frise-card li {
    margin-bottom: 0.35rem;
}

.frise-card li::marker {
    color: var(--bordeaux);
}

/* Petite flèche de la carte vers la ligne */
.frise-card::before {
    content: "";
    position: absolute;
    top: 1.65rem;
    width: 14px;
    height: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    transform: rotate(45deg);
}

/* Cartes impaires à gauche, paires à droite */
.frise-item:nth-child(odd) .frise-card {
    grid-column: 1;
}

.frise-item:nth-child(odd) .frise-card::before {
    right: -8px;
    border-left: none;
    border-bottom: none;
}

.frise-item:nth-child(odd) .frise-date {
    grid-column: 3;
}

.frise-item:nth-child(even) .frise-card {
    grid-column: 3;
}

.frise-item:nth-child(even) .frise-card::before {
    left: -8px;
    border-right: none;
    border-top: none;
}

.frise-item:nth-child(even) .frise-date {
    grid-column: 1;
    text-align: right;
}

/* Mobile : ligne à gauche, toutes les cartes à droite */
@media (max-width: 760px) {
    .frise-track {
        left: 9px;
        transform: none;
    }

    .frise-item {
        grid-template-columns: 2.5rem minmax(0, 1fr);
    }

    .frise-dot {
        grid-column: 1;
        justify-self: start;
        margin-top: 0.3rem;
    }

    .frise-item:nth-child(n) .frise-date {
        grid-column: 2;
        grid-row: 1;
        margin: 0 0 0.75rem;
        text-align: left;
    }

    .frise-item:nth-child(n) .frise-card {
        grid-column: 2;
        grid-row: 2;
    }

    .frise-item:nth-child(n) .frise-card::before {
        display: none;
    }
}
