/* ==========================================================================
   Eduardo Munoz — feuille de style de base (mobile d'abord)
   Les adaptations pour grand écran sont dans desktop.css,
   la page projet et les transitions dans project.css.

   Sommaire
   1.  Variables
   2.  Base
   3.  Header
   4.  Menu mobile
   5.  Boutons
   6.  Sections et titres
   7.  Présentation
   8.  Citation
   9.  BUT MMI
   10. Réalisations
   11. Contact
   12. Mentions légales / 404
   13. Footer
   14. Animations
   ========================================================================== */


/* ---------- 1. Variables ---------- */
:root {
    --navy: #02153D;
    --ink: #000A20;
    --red: #A60C0C;
    --paper: #F5F5F5;
    --light: #F1F1F1;                             /* texte clair sur fond marine */
    --line: rgba(0, 10, 32, 0.2);

    --gutter: clamp(1.25rem, 5vw, 2.5rem);
    --header-h: 4.25rem;
    --photo-scale: 0.85;                          /* taille du portrait (1 = taille d'origine) */
    --radius: 4px;                                /* boutons, catégories, burger */

    --expo: cubic-bezier(0.16, 1, 0.3, 1);       /* décélération douce, utilisée partout */
    --inout: cubic-bezier(0.7, 0, 0.2, 1);
    --display: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
}


/* ---------- 2. Base ---------- */
* {
    margin: 0;
    padding: 0;
    list-style: none;
    text-decoration: none;
}

/* box-sizing uniquement sur le contenu : le header et le footer gardent leur calcul d'origine */
main *, main *::before, main *::after,
#mobile-menu, #mobile-menu * {
    box-sizing: border-box;
}

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

body {
    background: var(--paper) url('../images/fondo.png');
    color: var(--ink);
    font-family: 'Mulish', sans-serif;
    line-height: 1.65;
    overflow-x: hidden;
}
body.menu-open { overflow: hidden; }

a { color: inherit; }
img { display: block; max-width: 100%; }

:focus-visible {
    outline: 3px solid var(--red);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}


/* ---------- 3. Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    box-sizing: border-box;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0 var(--gutter);
    border-top: 10px solid var(--navy);           /* en pixels entiers : pas de couture floue avec le trapèze */
    background: rgba(245, 245, 245, 0.78);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    transition: box-shadow 0.4s ease, background-color 0.4s ease;
    animation: fade 0.9s ease backwards;
}
.site-header.is-scrolled {
    background: rgba(245, 245, 245, 0.92);
    box-shadow: 0 10px 30px -20px rgba(0, 10, 32, 0.45);
}

/* Logo + nom */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--navy);
    transition: color 0.4s ease;
}
.brand img { transition: transform 0.7s var(--expo), filter 0.4s ease; }
.brand:hover img { transform: rotate(-14deg) scale(1.1); }
.brand-name { white-space: nowrap; }
.brand-name span { font-weight: 500; }

/* Liens (masqués sur mobile, affichés dans desktop.css) */
.site-nav { display: none; position: relative; }
.site-nav ul { display: flex; gap: 0.25rem; }
.site-nav a {
    display: block;
    padding: 0.7rem 1.1rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: rgba(0, 10, 32, 0.7);
    transition: color 0.3s ease;
}
.site-nav a:hover,
.site-nav a.is-active { color: var(--navy); }
.site-nav a.is-active { font-weight: 700; }

.site-nav li { animation: drop-in 0.9s var(--expo) both; }
.site-nav li:nth-child(1) { animation-delay: 0.35s; }
.site-nav li:nth-child(2) { animation-delay: 0.43s; }
.site-nav li:nth-child(3) { animation-delay: 0.51s; }
.site-nav li:nth-child(4) { animation-delay: 0.59s; }

/* Trait sous le lien actif (positionné par navigation.js) */
.nav-indicator {
    position: absolute;
    left: 0;
    bottom: 0.25rem;
    width: var(--w, 0px);
    height: 3px;
    background: var(--navy);
    border-radius: 2px;
    transform: translateX(var(--x, 0px));
    opacity: 0;
    transition: transform 0.7s var(--expo), width 0.7s var(--expo), opacity 0.3s ease;
}
.nav-indicator.ready { opacity: 1; }

.site-header .cv-link {
    display: none;
    padding: 0.5rem 1.1rem;
    animation: drop-in 0.9s var(--expo) 0.6s both;
}

/* Barre de progression de lecture */
.scroll-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--navy);
    transform-origin: left;
    transform: scaleX(var(--p, 0));
}

/* Bouton burger */
.burger {
    flex: none;
    width: 3rem;                                  /* 48 px : zone cliquable minimale */
    height: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: var(--navy);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.4s ease;
}
.burger div {
    width: 1.3rem;
    height: 2px;
    background: var(--light);
    transition: transform 0.5s var(--expo), opacity 0.2s ease, background-color 0.4s ease;
}
.burger[aria-expanded="true"] { background: var(--light); }
.burger[aria-expanded="true"] div { background: var(--navy); }
.burger[aria-expanded="true"] div:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] div:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] div:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu ouvert : l'en-tête passe en clair sur le fond marine */
body.menu-open .site-header {
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
body.menu-open .brand { color: var(--light); }
body.menu-open .brand img { filter: invert(1) brightness(2); }
body.menu-open .scroll-progress { opacity: 0; }


/* ---------- 4. Menu mobile ---------- */
#mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    padding: 2rem var(--gutter);
    background: var(--navy);
    color: var(--light);
    clip-path: circle(0 at calc(100% - 2.4rem) 2.4rem);
    visibility: hidden;
    transition: clip-path 0.8s var(--expo), visibility 0s linear 0.8s;
}
#mobile-menu.open {
    clip-path: circle(150% at calc(100% - 2.4rem) 2.4rem);
    visibility: visible;
    transition: clip-path 0.9s var(--expo), visibility 0s;
}

#mobile-menu a {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2.2rem, 11vw, 3.4rem);
    line-height: 1.1;
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity 0.4s ease, transform 0.6s var(--expo);
}
#mobile-menu a:hover { text-decoration: underline 4px var(--red); text-underline-offset: 8px; }
#mobile-menu.open a { opacity: 1; transform: none; }
#mobile-menu.open a:nth-child(1) { transition-delay: 0.25s; }
#mobile-menu.open a:nth-child(2) { transition-delay: 0.32s; }
#mobile-menu.open a:nth-child(3) { transition-delay: 0.39s; }
#mobile-menu.open a:nth-child(4) { transition-delay: 0.46s; }
#mobile-menu.open a:nth-child(5) { transition-delay: 0.53s; }
#mobile-menu .menu-cv { margin-top: 1rem; font-weight: 500; font-size: 1.3rem; color: #cfd6e6; }

/* Rideau de secours pour les navigateurs sans View Transitions */
#curtain {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: var(--navy);
    pointer-events: none;
    clip-path: inset(100% 0 0 0);
}


/* ---------- 5. Boutons ---------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 1.7rem;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
    border: 2px solid var(--navy);
    border-radius: var(--radius);
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    transition: color 0.4s var(--expo), transform 0.3s var(--expo);
}
.btn[disabled] { cursor: progress; opacity: 0.75; }

/* Remplissage qui monte depuis le bas au survol */
.btn::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    transform: translateY(101%);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    transition: transform 0.5s var(--expo), border-radius 0.5s var(--expo);
}
.btn:hover::before,
.btn:focus-visible::before { transform: none; border-radius: 0; }

.btn-primary { background: var(--navy); color: var(--light); }
.btn-primary::before { background: var(--red); }
.btn-primary:hover { border-color: var(--red); }

.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost::before { background: var(--navy); }
.btn-ghost:hover { color: var(--light); }


/* ---------- 6. Sections et titres ---------- */
.block {
    position: relative;
    scroll-margin-top: 3.5rem;
    padding: 2.25rem var(--gutter);
}

/* Texte masqué qui se lève (titres de section et nom de la présentation) */
.line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.1em;
}
.line > span { display: inline-block; }

/* Titre de section + filet qui se dessine en dessous */
.sec-title { margin-bottom: 1.75rem; }
.sec-title h2 {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.015em;
    color: var(--navy);
}
.sec-title::after {
    content: "";
    display: block;
    width: 100%;
    height: 3px;
    margin-top: 0.8rem;
    background: var(--navy);
    transform-origin: left;
}

/* Animation à l'entrée de la section (classe .in ajoutée par ui.js) */
html.js .sec-title .line > span { transition: transform 1.1s var(--expo); }
html.js .sec-title::after { transition: transform 1.4s var(--expo) 0.2s; }
html.js .block:not(.in) .sec-title .line > span { transform: translateY(110%); }
html.js .block:not(.in) .sec-title::after { transform: scaleX(0); }


/* ---------- 7. Présentation ---------- */
.me {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 2.5rem;
    padding-bottom: 3rem;
}

/* Portrait : eduardo.png + deux motifs (deco-a en haut à gauche, deco-b sous la photo).
   --pw = largeur de la photo ; tout le reste se calcule à partir d'elle. */
.me-photo {
    --pw: calc(min(11rem, 28vh) * var(--photo-scale));
    justify-self: start;
    width: calc(var(--pw) * 1.52);
    padding-bottom: calc(var(--pw) * 0.42);      /* place pour le motif du bas */
}
.portrait {
    position: relative;
    width: var(--pw);
    margin-left: calc(var(--pw) * 0.52);         /* place pour le motif de gauche */
}
.photo-clip {
    overflow: hidden;
    border-radius: 2px;
    animation: clip-up 1.5s var(--expo) 0.15s both;
}
.photo-clip img {
    width: 100%;
    height: auto;
    transform-origin: 50% 100%;
    animation: settle 2s var(--expo) 0.15s both;
}

/* Motifs : arrivent en glissant depuis leur coin, puis flottent doucement (déphasés) */
.deco { position: absolute; }
.deco img { width: 100%; height: auto; }
.deco-a {
    top: 0;
    right: 100%;
    width: 48%;
    margin-right: 4.2%;
    animation: deco-in-a 1.3s var(--expo) 0.7s backwards;
}
.deco-b {
    top: 100%;
    right: 1.3%;
    width: 84.3%;
    margin-top: 3.4%;
    animation: deco-in-b 1.3s var(--expo) 0.85s backwards;
}
.deco-a img { animation: float-a 9s ease-in-out 2.2s infinite alternate; }
.deco-b img { animation: float-b 11s ease-in-out 2.4s infinite alternate; }

/* Nom */
.me-name {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2.6rem, 12vw, 4.2rem);
    line-height: 0.92;
    letter-spacing: -0.03em;
    color: var(--navy);
}
.me-name .line { display: inline-block; }
.me-name .line > span { animation: line-up 1.3s var(--expo) both; }
.me-name .line:nth-child(1) > span { animation-delay: 0.3s; }
.me-name .line:nth-child(2) > span { animation-delay: 0.45s; }

.me-rule {
    display: block;
    height: 3px;
    margin: 1.4rem 0 1.1rem;
    background: var(--navy);
    transform-origin: left;
    animation: draw 1.6s var(--expo) 0.8s both;
}

/* Métier : le mot change en glissant vers le haut, en boucle */
.me-role {
    height: 1.3em;
    overflow: hidden;
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(1.5rem, 5vw, 2.4rem);
    line-height: 1.3;
    color: var(--red);
    animation: fade 1s ease 1.2s both;
}
.roll-list { display: block; animation: roll 12s var(--inout) 2.6s infinite; }
.roll-list b { display: block; height: 1.3em; font-weight: 700; white-space: nowrap; }

/* Texte de présentation */
.me-desc { margin-top: 2rem; }
.me-desc > * { animation: rise 1.1s var(--expo) both; }
.me-desc > :nth-child(1) { animation-delay: 1.3s; }
.me-desc > :nth-child(2) { animation-delay: 1.4s; }
.me-desc > :nth-child(3) { animation-delay: 1.5s; }
.me-desc > :nth-child(4) { animation-delay: 1.65s; }
.me-desc h2 {
    margin-bottom: 0.8rem;
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.9rem;
    line-height: 1.2;
    color: var(--navy);
}
.me-desc p { font-size: 1.15rem; margin-bottom: 1rem;}

.me-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.6rem; }


/* ---------- 8. Citation : les mots s'allument au fil du défilement ---------- */
#quote { padding-top: 1rem; padding-bottom: 1.5rem; }
#quote p {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(1.45rem, 4.4vw, 2.2rem);
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--navy);
}
#quote .w { transition: opacity 0.5s ease, color 0.5s ease; }
html.js #quote .w:not(.lit) { opacity: 0.18; }
#quote cite {
    display: block;
    margin-top: 1.2rem;
    font-size: 1.2em;
    font-style: normal;
    font-weight: 600;
    color: var(--red);
}


/* ---------- 9. C'est quoi le BUT MMI ? ---------- */
.mmi-intro { margin-bottom: 2rem; font-size: 1.15em; }

.mmi-pillars { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.mmi-pillars li {
    padding: 1.4rem 1.5rem 1.5rem;
    background: #fff;
    border-top: 4px solid var(--navy);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px -28px rgba(2, 21, 61, 0.45);
}
.mmi-pillars h3 {
    margin-bottom: 0.6rem;
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.35rem;
    line-height: 1.15;
    color: var(--navy);
}
.mmi-pillars p { font-size: 1rem; line-height: 1.6; }

/* Apparition en cascade quand la section entre à l'écran */
html.js .mmi-pillars li { transition: opacity 0.8s ease, transform 1s var(--expo); }
html.js .mmi-pillars li:nth-child(2) { transition-delay: 0.12s; }
html.js .mmi-pillars li:nth-child(3) { transition-delay: 0.24s; }
html.js .block:not(.in) .mmi-pillars li { opacity: 0; transform: translateY(1.5rem); }


/* ---------- 10. Réalisations ---------- */

/* Filtres sur deux niveaux : grandes catégories (onglets), puis leurs catégories (boutons) */
.filters {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    margin: 0.6rem 0 2.2rem;
}
.filters[hidden],
.filters-main[hidden],
.filters-sub[hidden] { display: none; }

.filters button {
    padding: 0.65rem 1.35rem;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--navy);
    background: transparent;
    border: 2px solid var(--navy);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.filters button:hover { background: rgba(2, 21, 61, 0.08); }
.filters button[aria-pressed="true"] { background: var(--navy); color: var(--light); }

/* Grandes catégories : onglets centrés, soulignés en rouge */
.filters-main {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 2.2rem;
}
.filters .filters-main button {
    position: relative;
    padding: 0.5rem 0.2rem 0.7rem;
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 800;
    color: rgba(2, 21, 61, 0.5);
    background: none;
    border: none;
    border-radius: 0;
    transition: color 0.3s ease;
}
.filters .filters-main button::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--red);
    transform: scaleX(0);
    transition: transform 0.5s var(--expo);
}
.filters .filters-main button:hover,
.filters .filters-main button[aria-pressed="true"] { color: var(--navy); background: none; }
.filters .filters-main button[aria-pressed="true"]::after { transform: scaleX(1); }

/* Catégories de la grande catégorie choisie */
.filters-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding-left: 0.9rem;
    border-left: 3px solid var(--navy);
}
.filters-sub button { padding: 0.6rem 1.2rem; font-size: 1rem; border-width: 1px; }

/* Grille des projets */
#realisations {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
    gap: 2.5rem 2.25rem;
}

.project[hidden] { display: none; }

.project-link {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

/* Vignette (l'ombre à 0 sert de point de départ à l'effet de survol de desktop.css) */
.thumb-frame {
    position: relative;
    box-shadow: 0 0 0 var(--navy);
    transition: transform 0.5s var(--expo), box-shadow 0.5s var(--expo);
}
.project .thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--navy);
    clip-path: inset(0);
    transition: clip-path 1.2s var(--expo);
}
.project .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.4s var(--expo);
}
.project-link:hover .thumb img,
.project-link:focus-visible .thumb img { transform: scale(1.07); }

/* Titre + année */
.project h3 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1.15;
    color: var(--navy);
}
.project h3 span { flex: none; font-weight: 700; font-size: 1rem; color: var(--red); }

/* Étiquettes de catégories (aussi utilisées sur la page projet) */
.categories { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.categories > span {
    padding: 0.35rem 0.7rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    color: var(--navy);
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--navy);
    border-radius: var(--radius);
}

/* Description courte, affichée en entier */
.project p { flex: 1; font-size: 0.95rem; }

/* Lien « Voir le projet » (mobile / tactile ; remplacé par un bandeau au survol sur desktop) */
.project-cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    color: var(--navy);
}
.project-cta::after {
    content: "";
    width: 0.55em;
    height: 0.55em;
    border-top: 2px solid var(--red);
    border-right: 2px solid var(--red);
    transform: rotate(45deg);
    transition: transform 0.5s var(--expo);
}
.project-link:hover .project-cta::after { transform: translateX(6px) rotate(45deg); }

/* Révélation des cartes : le visuel se dévoile, puis le texte monte */
html.js .project h3,
html.js .project .categories,
html.js .project p,
html.js .project .project-cta { transition: opacity 0.9s ease, transform 1s var(--expo); }

html.js .project:not(.is-in) .thumb { clip-path: inset(0 0 100% 0); }
html.js .project:not(.is-in) .thumb img { transform: scale(1.3); }
html.js .project:not(.is-in) h3,
html.js .project:not(.is-in) .categories,
html.js .project:not(.is-in) p,
html.js .project:not(.is-in) .project-cta { opacity: 0; transform: translateY(18px); }

/* Chargement / erreur */
.skeleton .thumb {
    background: linear-gradient(100deg, #dfe3ea 30%, #eef0f4 50%, #dfe3ea 70%) 0 0 / 220% 100%;
    animation: shimmer 1.4s linear infinite;
}
.skeleton .bar { height: 1.2rem; margin-top: 1rem; background: #dfe3ea; border-radius: 2px; }
.skeleton .bar + .bar { width: 60%; }

.projects-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-left: 8px solid var(--red);
}


/* ---------- 11. Contact ---------- */
#contact { display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
#contact .sec-title { grid-column: 1 / -1; margin-bottom: 0; }

#contact-text p { max-width: 34rem; margin-bottom: 1.4rem; font-size: 1.125rem; }

.mail-link {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 1.8rem;
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(1.15rem, 4.4vw, 1.6rem);
    color: var(--navy);
    overflow-wrap: anywhere;
}

/* Réseaux sociaux */
#socials { display: flex; flex-wrap: wrap; gap: 0.8rem; }
#socials > li > a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem 0.55rem 0.8rem;
    font-weight: 600;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.55);
    border: 2px solid var(--navy);
    border-radius: var(--radius);
    transition: background-color 0.3s ease, color 0.3s ease;
}
#socials > li > a:hover { background: var(--navy); color: var(--light); }
#socials img { width: 24px; height: 24px; transition: filter 0.3s ease; }
#socials > li > a:hover img { filter: invert(1) brightness(2); }

/* Formulaire */
#contact-form { display: flex; flex-direction: column; gap: 1.5rem; }

/* le gap de #contact-form ne s'applique qu'à ses enfants directs : même espacement à l'intérieur */
.form-fields,
.form-row { display: flex; flex-direction: column; gap: 1.5rem; }

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-weight: 700; font-size: 0.95rem; color: var(--navy); }

.field input,
.field textarea {
    padding: 0.7rem 0.2rem;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    border: none;
    border-bottom: 2px solid var(--ink);
    border-radius: 0;
    resize: vertical;
    /* trait rouge qui se dessine au focus */
    background: linear-gradient(var(--red), var(--red)) left bottom / 0 3px no-repeat transparent;
    transition: background-size 0.6s var(--expo);
}
.field input:focus,
.field textarea:focus { outline: none; background-size: 100% 3px; }

.field input::placeholder,
.field textarea::placeholder { color: rgba(0, 10, 32, 0.62); }   /* contraste ≥ 4,5:1 */

/* Erreur signalée par la couleur ET par une bordure plus épaisse + un fond teinté */
.field input:user-invalid,
.field textarea:user-invalid {
    border-bottom: 3px solid var(--red);
    background-color: rgba(166, 12, 12, 0.05);
}

.field-hint { align-self: flex-end; font-size: 0.8rem; color: rgba(0, 10, 32, 0.65); }

/* Champ piège à robots, invisible */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; }
.form-fields > .form-actions { margin-top: -1rem; }   /* le bouton reste proche du message */

#form-status { flex: 1 1 14rem; min-height: 1.5em; font-weight: 600; line-height: 1.4; }
#form-status.success { color: #0B5E2B; }
#form-status.error { color: var(--red); }
#form-status.error::before { content: "⚠ "; }        /* indice visuel en plus de la couleur */

/* Message envoyé */
.form-done {
    display: none;
    padding: 1.6rem;
    background: rgba(255, 255, 255, 0.65);
    border-left: 8px solid var(--navy);
}
.form-done strong {
    display: block;
    margin-bottom: 0.4rem;
    font-family: var(--display);
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--navy);
}
#contact-form.sent .form-fields { display: none; }
#contact-form.sent .form-done { display: block; animation: rise 0.9s var(--expo) both; }


/* ---------- 12. Mentions légales / 404 ---------- */
#legal {
    margin: clamp(0.5rem, 3vw, 1.5rem);          /* les marges se resserrent avec la fenêtre */
    padding: clamp(0.75rem, 4vw, 1.5rem);
    color: var(--light);
    background-color: rgba(2, 21, 61, 0.98);
    border-radius: 1em;
    overflow-wrap: break-word;
}
#legal > section {
    display: flex;
    flex-direction: column;
    gap: 1em;
    padding: clamp(0.5rem, 3vw, 2rem);
}
/* le lien de retour et le titre s'alignent sur le texte des sections */
#legal > .back-link,
#legal > .titre { margin-left: clamp(0.5rem, 3vw, 2rem); }

.titre {
    margin-top: 2rem;
    font-family: var(--display);
    font-weight: 800;
}
#legal h2 { font-family: var(--display); line-height: 1.2; }
#legal p { max-width: 70ch; }                  /* longueur de ligne confortable */
#legal a { text-decoration: underline; text-underline-offset: 3px; }

/* « Retour à l'accueil » : le soulignement se dessine au survol, la flèche recule */
#legal .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding-bottom: 4px;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) left bottom / 0 2px no-repeat;
    transition: background-size 0.6s var(--expo);
}
#legal .back-link .arrow { display: inline-block; transition: transform 0.6s var(--expo); }
#legal .back-link:hover,
#legal .back-link:focus-visible { background-size: 100% 2px; }
#legal .back-link:hover .arrow,
#legal .back-link:focus-visible .arrow { transform: translateX(-6px); }


/* ---------- 13. Footer ---------- */
footer {
    margin-top: 1rem;
    padding: 1rem 0;
    font-size: 14px;
    color: var(--light);
    background-color: var(--navy);
}
footer > ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0.5rem;
}
footer a { text-decoration: underline; text-underline-offset: 3px; }


/* ---------- 14. Animations ---------- */
@keyframes line-up   { from { transform: translateY(110%) rotate(2deg); } to { transform: none; } }
@keyframes draw      { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes clip-up   { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
@keyframes settle    { from { transform: scale(1.3); } to { transform: none; } }
@keyframes rise      { from { opacity: 0; transform: translateY(1.6rem); } to { opacity: 1; transform: none; } }
@keyframes fade      { from { opacity: 0; } to { opacity: 1; } }
@keyframes drop-in   { from { opacity: 0; transform: translateY(-0.8rem); } to { opacity: 1; transform: none; } }
@keyframes deco-in-a { from { opacity: 0; transform: translate(-1.2rem, -1.2rem); } to { opacity: 1; transform: none; } }
@keyframes deco-in-b { from { opacity: 0; transform: translate(1.2rem, 1.2rem); } to { opacity: 1; transform: none; } }
@keyframes float-a   { from { transform: translate(0, 0); } to { transform: translate(-0.35rem, -0.3rem); } }
@keyframes float-b   { from { transform: translate(0, 0); } to { transform: translate(0.35rem, 0.3rem); } }
@keyframes shimmer   { to { background-position: -220% 0; } }

/* 4 mots + le premier répété pour boucler sans saut ; chaque pas dure ~2,4 s */
@keyframes roll {
    0%, 20%  { transform: translateY(0); }
    25%, 45% { transform: translateY(-1.3em); }
    50%, 70% { transform: translateY(-2.6em); }
    75%, 95% { transform: translateY(-3.9em); }
    100%     { transform: translateY(-5.2em); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .roll-list b:not(:first-child) { display: none; }
    #quote .w { opacity: 1 !important; }
}
