/* Styles généraux : couleurs, typographie, mise en page des pages. */

/* Police Source Sans 3 (Adobe, licence SIL OFL 1.1 : assets/polices/OFL.txt), hébergée sur le site :
   aucune requête vers Google Fonts, donc aucune adresse IP de visiteur transmise à un tiers.
   Police variable : un seul fichier couvre les graisses 400 à 700. */
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/polices/source-sans-3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/polices/source-sans-3-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Police des titres : Instrument Serif (licence SIL OFL 1.1 : assets/polices/OFL-instrument-serif.txt),
   hébergée sur le site elle aussi. Une seule graisse, en romain et en italique. */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/polices/instrument-serif-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/polices/instrument-serif-italique-latin.woff2") format("woff2");
}

/* Thème « atlas » : papier crème, encre bleu nuit, vert de carte, et un vermillon pour les repères */
:root {
  --bg: #F4F1EA;
  --surface: #FFFDF8;
  --ink: #17212D;
  --muted: #5A6472;
  --line: #E3DDD0;
  --accent: #0E6B57;
  --repere: #C43E14;
  --navy: #141E2A;
  --navy-2: #1D2A38;
  --on-navy: #F4F1EA;
  --on-navy-muted: #A8B2BE;
  --navy-line: rgba(244, 241, 234, .14);
  --navy-accent: #7FD8B8;
  --todo-bg: #FFE9A8;
  --todo-ink: #4D3A00;
  --ochre: #9A5A00;
  --ochre-bg: #F8EBD6;
  /* Carte topographique du bandeau d'accueil (lues par preparerRelief dans app.js) : courbes en bistre, comme sur les cartes IGN */
  --courbe: rgba(146, 98, 52, .17);
  --courbe-forte: rgba(146, 98, 52, .42);
  --courbe-texte: rgba(128, 82, 38, .9);
  --eau: rgba(46, 124, 186, .6);
  --carroyage: rgba(23, 33, 45, .34);
  /* Estompage (ombrage du relief) : couleur des versants à l'ombre et au soleil, et leur force */
  --ombrage: 70, 48, 26;
  --ombrage-force: .42;
  --lumiere: 255, 253, 246;
  --lumiere-force: .55;
  --ombre: 0 1px 2px rgba(23, 33, 45, .05), 0 18px 40px -18px rgba(23, 33, 45, .28);
  --rayon: 16px;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  /* Largeur du contenu et marges latérales : la page occupe l'écran, les marges suivent sa largeur */
  --maxw: 1560px;
  --gouttiere: clamp(20px, 4vw, 56px);
}
/* Thème sombre : celui de l'appareil, sauf si le visiteur a choisi avec le bouton de l'en-tête
   (data-theme sur <html>, posé par le petit script en tête d'index.html). Les deux blocs sont identiques. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  --bg: #0F161F;
  --surface: #16202C;
  --ink: #EDE9E0;
  --muted: #A9B2BD;
  --line: #273342;
  --accent: #7FD8B8;
  --repere: #FF8A5C;
  --navy: #0A1017;
  --navy-2: #121B26;
  --todo-bg: #5A4710;
  --todo-ink: #FFE9A8;
  --ochre: #F2B65A;
  --ochre-bg: #2A2112;
  --courbe: rgba(222, 178, 128, .09);
  --courbe-forte: rgba(222, 178, 128, .26);
  --courbe-texte: rgba(226, 186, 140, .75);
  --eau: rgba(110, 178, 230, .6);
  --carroyage: rgba(237, 233, 224, .3);
  --ombrage: 0, 0, 0;
  --ombrage-force: .8;
  --lumiere: 180, 200, 220;
  --lumiere-force: .12;
  --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -18px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F161F;
    --surface: #16202C;
    --ink: #EDE9E0;
    --muted: #A9B2BD;
    --line: #273342;
    --accent: #7FD8B8;
    --repere: #FF8A5C;
    --navy: #0A1017;
    --navy-2: #121B26;
    --todo-bg: #5A4710;
    --todo-ink: #FFE9A8;
    --ochre: #F2B65A;
    --ochre-bg: #2A2112;
    --courbe: rgba(222, 178, 128, .09);
    --courbe-forte: rgba(222, 178, 128, .26);
    --courbe-texte: rgba(226, 186, 140, .75);
    --eau: rgba(110, 178, 230, .6);
    --carroyage: rgba(237, 233, 224, .3);
    --ombrage: 0, 0, 0;
    --ombrage-force: .8;
    --lumiere: 180, 200, 220;
    --lumiere-force: .12;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -18px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* Taille de texte qui grandit avec l'écran : 16 px de base sur téléphone, jusqu'à 19 px sur grand écran.
   Toutes les tailles en rem suivent. */
html { font-size: clamp(16px, calc(12.5px + .35vw), 19px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
/* Grands titres en serif, graisse unique : l'italique sert d'accent */
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.005em; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: max(var(--gouttiere), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gouttiere), env(safe-area-inset-right, 0px));
}

mark.todo {
  background: var(--todo-bg);
  color: var(--todo-ink);
  padding: 0 4px;
  border-radius: 3px;
}

/* ---------- En-tête : bande de papier translucide, le contenu défile dessous ---------- */
.entete {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.entete .wrap { display: flex; align-items: center; gap: 24px; padding-block: 12px; }
.nom { text-decoration: none; font-family: var(--serif); font-size: 1.6rem; line-height: 1; margin-right: auto; }
.nom small { display: block; margin-top: 4px; font-family: var(--sans); font-size: .82rem; color: var(--muted); }
.menu { display: flex; gap: 2px; }
.menu a {
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: color .15s ease, background-color .15s ease;
}
.menu a:hover { color: var(--ink); }
.menu a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--accent) 11%, transparent); }
.cv-entete {
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  transition: background-color .15s ease;
}
.cv-entete:hover { background: var(--accent); }
/* Bouton clair / sombre : la lune en thème clair, le soleil en thème sombre */
.theme {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease, transform .3s ease;
}
.theme:hover { border-color: var(--ink); transform: rotate(-15deg); }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme .soleil { display: none; }
:root[data-theme="dark"] .theme .soleil { display: block; }
:root[data-theme="dark"] .theme .lune { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .soleil { display: block; }
  :root:not([data-theme="light"]) .theme .lune { display: none; }
}
/* Barre de lecture des pages de projet : un trait sous l'en-tête qui avance avec le défilement */
.progression {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--repere));
  transform: scaleX(var(--lu, 0));
  transform-origin: left;
}
:root[data-page="projet"] .progression { display: block; }
.burger {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 16px;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
}
@media (max-width: 1100px) {
  .burger { display: block; }
  .menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -20px rgba(23, 33, 45, .35);
    padding: 8px max(20px, env(safe-area-inset-left, 0px)) 16px;
  }
  .menu a { border-radius: 10px; }
  .menu.ouvert { display: flex; }
  .cv-entete { padding: 7px 14px; }
}

/* ---------- Boutons : pastilles à l'encre ---------- */
.boutons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn.principal { background: var(--ink); color: var(--bg); }
.btn.principal:hover { background: var(--accent); }
.btn.secondaire { border-color: color-mix(in srgb, var(--ink) 28%, transparent); color: var(--ink); }
.btn.secondaire:hover { border-color: var(--ink); background: var(--surface); }

/* ---------- Accueil ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--ink);
  background: radial-gradient(55% 75% at 82% 45%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%), var(--bg);
  border-bottom: 1px solid var(--line);
}
/* Les courbes s'effacent derrière le texte et ressortent autour du portrait */
.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(100deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, .35) 38%, #000 68%);
  mask-image: linear-gradient(100deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, .35) 38%, #000 68%);
}
.hero-grille {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 72px;
  align-items: center;
  padding-block: clamp(56px, 7.5vw, 104px) clamp(64px, 8vw, 104px);
}
.hero h1 { font-size: clamp(3.4rem, 8.5vw, 7rem); line-height: .92; letter-spacing: -.02em; }
.hero-poste { margin-top: 20px; max-width: 46ch; font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.4; color: var(--accent); font-weight: 600; }
.hero-intro { margin-top: 20px; max-width: 66ch; color: var(--muted); font-size: 1.1rem; }
.hero-intro a { color: var(--accent); font-weight: 600; }
.hero-infos { display: flex; flex-wrap: wrap; gap: 12px 48px; margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); max-width: 66ch; }
.hero-infos dt { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hero-infos dd { margin: 4px 0 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
/* Pastille « disponible » qui pulse doucement */
.hero-infos div:first-child dd::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1FA37A;
  box-shadow: 0 0 0 0 rgba(31, 163, 122, .5);
  animation: dispo 2.4s ease-out infinite;
}
@keyframes dispo { 0% { box-shadow: 0 0 0 0 rgba(31, 163, 122, .5); } 70%, 100% { box-shadow: 0 0 0 9px rgba(31, 163, 122, 0); } }
/* Portrait : un cercle entouré d'une zone tampon en pointillés, avec un repère vermillon */
.hero-portrait { position: relative; margin: 26px; }
.hero-portrait::before {
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  animation: tampon 80s linear infinite;
}
.hero-portrait::after {
  content: "";
  position: absolute;
  top: 9%;
  right: 3%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--repere);
  box-shadow: 0 0 0 4px var(--bg), 0 6px 14px rgba(196, 62, 20, .45);
}
@keyframes tampon { to { transform: rotate(360deg); } }
.hero-photo {
  display: block;
  width: clamp(220px, 22vw, 300px);
  height: clamp(220px, 22vw, 300px);
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  border: 6px solid var(--surface);
  box-shadow: var(--ombre);
}
/* Arrivée sur l'accueil : le texte monte par étapes, le portrait apparaît */
@media (prefers-reduced-motion: no-preference) {
  .hero-grille > div:first-child > *, .hero-portrait { animation: monte .9s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-poste { animation-delay: .1s; }
  .hero-intro { animation-delay: .2s; }
  .hero-infos { animation-delay: .3s; }
  .hero .boutons { animation-delay: .4s; }
  .hero-portrait { animation-name: apparait; animation-duration: 1.1s; animation-delay: .25s; }
}
@keyframes monte { from { opacity: 0; transform: translateY(22px); } }
@keyframes apparait { from { opacity: 0; transform: scale(.92); } }
@media (prefers-reduced-motion: reduce) {
  .hero-portrait::before, .hero-infos div:first-child dd::before { animation: none; }
}

/* Apparition au fil du défilement (classes posées par app.js, seulement si les animations sont permises) */
.a-reveler {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease var(--retard, 0ms), transform .7s cubic-bezier(.2, .7, .2, 1) var(--retard, 0ms);
}
.a-reveler.revele { opacity: 1; transform: none; }

/* Transitions entre les pages (navigateurs qui gèrent les « view transitions ») :
   l'en-tête et le pied restent en place, le contenu se fond */
.entete { view-transition-name: entete; }
.pied { view-transition-name: pied; }
::view-transition-old(root) { animation: .2s ease both fondu-sortie; }
::view-transition-new(root) { animation: .45s cubic-bezier(.2, .7, .2, 1) both fondu-entree; }
@keyframes fondu-sortie { to { opacity: 0; } }
@keyframes fondu-entree { from { opacity: 0; transform: translateY(12px); } }

.bloc { padding-top: clamp(64px, 7vw, 104px); }
.bloc h2 { font-size: clamp(2.3rem, 4vw, 3.3rem); line-height: 1.02; margin-bottom: 28px; }
.bloc h2 + .chapo { margin-top: -14px; }
/* Accueil : chaque rubrique est numérotée, comme les entrées d'une légende */
.hero ~ .wrap { counter-reset: rubrique; }
.hero ~ .wrap > .bloc { counter-increment: rubrique; }
.hero ~ .wrap > .bloc > h2::before,
.hero ~ .wrap > .bloc > .bloc-entete > h2::before {
  content: counter(rubrique, decimal-leading-zero);
  display: block;
  margin-bottom: 12px;
  font: 600 .78rem/1 var(--mono);
  letter-spacing: .14em;
  color: var(--repere);
}
.bloc-entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.bloc-entete h2 { margin-bottom: 0; }
.bloc-entete a { color: var(--accent); font-weight: 600; text-decoration: none; padding-bottom: 4px; }
.bloc-entete a:hover { text-decoration: underline; text-underline-offset: 4px; }
main { padding-bottom: 112px; min-height: 60vh; }

.titre-page { font-size: clamp(3rem, 6.5vw, 5rem); line-height: .98; letter-spacing: -.015em; }
.chapo { margin: 16px 0 40px; max-width: 72ch; color: var(--muted); font-size: 1.15rem; }

/* Cartes projets : 3 par ligne sur grand écran, 2 sur tablette, 1 sur téléphone.
   L'image est montée dans la carte, avec une marge, comme une planche. */
.grille-projets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 28px; }
.projet {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.projet:hover { transform: translateY(-4px); box-shadow: var(--ombre); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.projet-image { margin: 10px 10px 0; border-radius: 13px; aspect-ratio: 16 / 10; background: var(--navy-2); display: grid; place-items: center; overflow: hidden; position: relative; }
.projet-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.projet:hover .projet-image img:not(.contenir) { transform: scale(1.04); }
.projet-image img.contenir { position: absolute; inset: 0; object-fit: contain; }
/* Au survol, des coins de cadrage se posent sur l'image, comme un viseur */
.projet-image::after {
  --c: rgba(255, 255, 255, .95);
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(var(--c), var(--c)) top left / 20px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 2px 20px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 20px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 2px 20px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 20px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 2px 20px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 20px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 2px 20px no-repeat;
  filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, .55));
  transition: opacity .25s ease, inset .35s cubic-bezier(.2, .7, .2, 1);
}
.projet:hover .projet-image::after, .projet:focus-visible .projet-image::after { opacity: 1; inset: 16px; }

/* Accueil : le premier projet à la une, en bandeau (image à gauche, texte à droite), les deux suivants dessous */
@media (min-width: 700px) {
  .grille-projets.vedette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vedette > .projet:first-child { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .vedette > .projet:first-child { flex-direction: row; align-items: stretch; }
  .vedette > .projet:first-child .projet-image { flex: 0 0 58%; margin: 10px 0 10px 10px; }
  .vedette > .projet:first-child .projet-texte { justify-content: center; gap: 14px; padding: 40px clamp(32px, 3.5vw, 56px); }
  .vedette > .projet:first-child .projet-lien { margin-top: 10px; }
  .vedette > .projet:first-child h3 { font-size: clamp(2.4rem, 3.2vw, 3.3rem); }
  .vedette > .projet:first-child p { font-size: 1.1rem; }
}
.projet-texte { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.projet-cadre { font-size: .92rem; line-height: 1.4; color: var(--muted); display: flex; align-items: center; gap: 10px; }
@media (prefers-reduced-motion: reduce) { .projet, .projet:hover, .projet-image img { transition: none; transform: none !important; } }
/* Logos larges (SNCF, IDGEO…) : on fixe la hauteur, la largeur suit dans une limite */
.logo-projet { height: 32px; width: auto; max-width: 96px; flex: none; border-radius: 6px; object-fit: contain; }
.logo-projet.sur-blanc { background: #FFFFFF; padding: 3px 6px; border: 1px solid var(--line); }
.infos-projet dd.avec-logo { display: flex; align-items: center; gap: 10px; }
.infos-projet .logo-projet { height: 40px; max-width: 120px; border: 1px solid var(--line); }
.projet h3 { font-family: var(--serif); font-weight: 400; font-size: 1.75rem; line-height: 1.08; letter-spacing: -.005em; }
.projet p { color: var(--muted); font-size: 1rem; }
.projet-lien { margin-top: auto; padding-top: 8px; color: var(--accent); font-weight: 600; font-size: 1rem; }
.projet-lien::after { content: "→"; display: inline-block; margin-left: 6px; transition: transform .2s ease; }
.projet:hover .projet-lien::after { transform: translateX(4px); }

/* Carte de situation (vignette des projets sans image) */
/* Positionnée en absolu : une hauteur en % n'est pas résolue dans la grille,
   et le SVG débordait en bas. Le viewBox garde les proportions et centre le dessin. */
.situation { position: absolute; inset: 7% 0; width: 100%; height: 86%; overflow: visible; }
.situation path { fill: #1F3550; stroke: rgba(255, 255, 255, .28); stroke-width: .8; }
.situation .territoire { fill: #24496B; stroke: var(--navy-accent); stroke-width: 1.2; }
.situation .point { fill: var(--navy-accent); }
.situation .halo { fill: none; stroke: var(--navy-accent); stroke-width: 1.2; opacity: .55; }
.situation text { fill: var(--on-navy); font: 600 13px var(--sans); }

/* Formation (page Parcours) */
.formations .chapo { margin-top: -12px; }
/* Une fiche par formation : présentation à gauche, contenu (blocs, modules) à droite sur grand écran */
.formation { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 56px; padding: clamp(24px, 3vw, 36px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); }
.formation + .formation { margin-top: 24px; }
.formation-gauche, .formation-droite { display: grid; gap: 12px; align-content: start; }
.formation p { max-width: 72ch; }
.formation h3 { font-family: var(--serif); font-weight: 400; font-size: 2rem; line-height: 1.05; }
.formation-meta { margin-top: -8px; color: var(--muted); }
.formation-intro { color: var(--muted); }
.formation-contenu { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 18px 32px; margin: 0; }
.formation-contenu dt { font-weight: 600; }
.formation-contenu dd { margin: 2px 0 0; color: var(--muted); font-size: 1rem; }
@media (min-width: 1100px) {
  .formation { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .formation-droite { padding-left: 40px; border-left: 1px solid var(--line); }
  .formation-contenu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.formation a { color: var(--accent); font-weight: 600; text-decoration: none; }
.formation a:hover { text-decoration: underline; }
.formation-liens { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 1rem; }

/* Compétences */
.competences { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.competences > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); padding: 30px; }
.competences h3 { font-family: var(--serif); font-weight: 400; font-size: 1.85rem; line-height: 1.08; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.competences dl { margin: 0; }
.competences dt { font-weight: 600; font-size: 1rem; margin-top: 14px; }
.competences dt:first-child { margin-top: 0; }
.competences dd { margin: 2px 0 0; color: var(--muted); font-size: 1rem; }
/* Recommandations : extraits de lettres, sans guillemets géants ni bordure décorative */
.recommandations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.recommandation { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); padding: 30px; display: flex; flex-direction: column; gap: 16px; }
.recommandation blockquote { margin: 0; }
.recommandation blockquote p { margin: 0; line-height: 1.6; }
.bloc .recommandation blockquote p { font-family: var(--serif); font-size: 1.32rem; line-height: 1.42; }
.recommandation figcaption { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; font-size: .95rem; }
.recommandation-auteur { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recommandation-auteur b { color: var(--ink); }
.recommandation-auteur > span { color: var(--muted); }
.recommandation .lien-projet { margin-top: 6px; }
/* Aperçu de la première page de la lettre, cliquable */
.lettre-apercu { flex: none; display: block; width: 92px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #FFFFFF; }
.lettre-apercu img { display: block; width: 100%; height: auto; }
.lettre-apercu:hover { border-color: var(--accent); }
/* Liens vers un PDF : lire / télécharger */
.liens-pdf { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; }
.recommandation a, .formation-certificat a { color: var(--accent); font-weight: 600; text-decoration: none; }
.recommandation a:hover, .formation-certificat a:hover { text-decoration: underline; }
.formation-certificat { font-size: .97rem; }
.projet-cote .recommandation { padding: 22px; }
.projet-cote .recommandation figcaption { flex-direction: column; }

/* ---------- Rubrique « Recommandations » : une lettre par encadré ----------
   À gauche le texte (citation principale, qualités, autres passages), à droite la lettre originale. */
.lettres { display: grid; gap: 40px; }
.lettre {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 32px 56px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(24px, 4vw, 48px);
}
.lettre-texte { display: grid; gap: 28px; min-width: 0; }
.lettre-entete { display: flex; align-items: center; gap: 16px; }
.lettre-entete div { display: flex; flex-direction: column; gap: 2px; }
.lettre-entete b { font-size: 1.2rem; }
.lettre-entete span { color: var(--muted); font-size: .95rem; line-height: 1.4; }
/* Citation principale : grands guillemets, texte en gras */
.lettre-citation { position: relative; margin: 0; padding-left: 56px; }
.lettre-citation::before {
  content: "«";
  position: absolute;
  left: 0;
  top: -14px;
  font-family: var(--serif);
  font-size: 5rem;
  line-height: 1;
  color: var(--repere);
}
.lettre-citation p { font-family: var(--serif); font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.3; max-width: 46ch; }
.lettre h3 { margin-bottom: 12px; font-family: var(--mono); font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.lettre-qualites ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lettre-qualites li { padding: 5px 14px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 11%, transparent); color: var(--accent); font-weight: 600; font-size: .95rem; }
.lettre-passages { display: grid; gap: 14px; }
.lettre-passages h3 { margin-bottom: 0; }
.lettre-passages blockquote { margin: 0; padding-left: 18px; border-left: 3px solid var(--line); }
.lettre-passages p { line-height: 1.6; max-width: 75ch; }
.lettre-contexte { color: var(--muted); font-size: .95rem; padding-top: 18px; border-top: 1px solid var(--line); }
.lettre .lien-projet { margin-top: -16px; color: var(--accent); font-weight: 600; text-decoration: none; }
.lettre .lien-projet:hover { text-decoration: underline; }
/* La lettre originale, présentée comme une feuille posée sur la page */
.lettre-document { display: grid; gap: 12px; justify-items: start; }
.lettre-feuille {
  display: block;
  width: 100%;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 10px 28px -12px rgba(19, 32, 47, .35);
  transform: rotate(1.2deg);
  transition: transform .25s ease, box-shadow .25s ease;
}
.lettre-feuille img { display: block; width: 100%; height: auto; border: 0; border-radius: 4px; }
.lettre-feuille:hover, .lettre-feuille:focus-visible { transform: rotate(0) translateY(-4px); box-shadow: 0 16px 36px -14px rgba(19, 32, 47, .45); }
.lettre-document .liens-pdf a { color: var(--accent); font-weight: 600; text-decoration: none; }
.lettre-document .liens-pdf a:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .lettre-feuille { transition: none; } }
@media (max-width: 900px) {
  .lettre { grid-template-columns: minmax(0, 1fr); }
  .lettre-document { max-width: 280px; }
  .lettre-citation { padding-left: 38px; }
  .lettre-citation::before { font-size: 3.2rem; }
}

/* Formation : validation des blocs */
.formation-obtenu { font-weight: 600; color: var(--accent); }

/* Savoir-être : une carte par qualité, avec la citation et la lettre d'où elle vient */
.savoir-etre { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.savoir-etre li { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); padding: 26px 30px; }
.savoir-etre h3 { font-family: var(--mono); font-size: .76rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.savoir-etre p { font-family: var(--serif); font-style: italic; font-size: 1.45rem; line-height: 1.3; }
.savoir-etre a { margin-top: auto; padding-top: 6px; font-size: .95rem; color: var(--muted); text-decoration: none; }
.savoir-etre a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 1000px) { .savoir-etre { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .savoir-etre { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- Centres d'intérêt : une carte illustrée par passion, animée au survol ---------- */
.interets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.interet { display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.interet:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: var(--ombre); }
.interet h3 { margin: 8px 12px 0; font-family: var(--serif); font-weight: 400; font-size: 1.7rem; line-height: 1.05; }
.interet p { margin: 0 8px; color: var(--muted); line-height: 1.55; }
.interet-illu {
  position: relative;
  height: 160px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 9%, var(--bg));
}
.interet-badge { position: absolute; bottom: 10px; left: 10px; padding: 3px 10px; border-radius: 6px; background: var(--navy); color: #FFB15C; font-size: .78rem; letter-spacing: .02em; }

/* Lecture : une étagère de livres ; au survol, les livres se soulèvent l'un après l'autre */
.etagere { display: flex; align-items: flex-end; gap: 5px; height: 122px; padding: 0 10px; border-bottom: 6px solid #8A6A45; border-radius: 0 0 3px 3px; }
.etagere span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: var(--h);
  border-radius: 3px 3px 1px 1px;
  background: var(--c);
  box-shadow: inset -4px 0 0 rgba(0, 0, 0, .18), inset 0 6px 0 rgba(255, 255, 255, .14);
  color: #FFFFFF;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  transition: transform .3s ease;
  transition-delay: calc(var(--i) * 60ms);
}
.interet-lecture:hover .etagere span { transform: rotate(180deg) translateY(10px); }
.interet-lecture:hover .etagere span:nth-child(3) { transform: rotate(180deg) translateY(16px) rotate(-4deg); }

/* Basket : demi-terrain en traits fins, ballon qui rebondit au survol */
.terrain { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: .35; }
.ballon { position: relative; width: 66px; height: 66px; margin-bottom: 18px; }
.ballon circle { fill: #E07B2A; stroke: #6E3510; stroke-width: 3; }
.ballon path { fill: none; stroke: #6E3510; stroke-width: 3; stroke-linecap: round; }
.ombre-ballon { position: absolute; bottom: 30px; width: 46px; height: 8px; border-radius: 50%; background: rgba(9, 20, 35, .25); }
.interet-basket:hover .ballon { animation: rebond .8s cubic-bezier(.45, 0, .55, 1) infinite; }
.interet-basket:hover .ombre-ballon { animation: ombre .8s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes rebond { 0%, 100% { transform: translateY(0) scale(1.06, .94); } 50% { transform: translateY(-38px) rotate(160deg); } }
@keyframes ombre { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.55); opacity: .45; } }

/* Musique : égaliseur ; au survol, les barres dansent */
.interet-musique .interet-illu { grid-template-columns: auto auto auto; justify-content: center; gap: 20px; }
.micro { width: 34px; height: 48px; }
.micro rect { fill: #B7720E; }
.micro path { fill: none; stroke: #B7720E; stroke-width: 3.2; stroke-linecap: round; }
.interet-musique:hover .micro { animation: micro .6s ease-in-out infinite alternate; transform-origin: bottom; }
@keyframes micro { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
.note { width: 38px; height: 48px; fill: var(--accent); stroke: var(--accent); stroke-width: 3; }
.note path { fill: none; }
.egaliseur { display: flex; align-items: flex-end; gap: 5px; height: 90px; }
.egaliseur i { width: 9px; height: var(--h); border-radius: 3px; background: linear-gradient(var(--navy-accent), var(--accent)); transform-origin: bottom; }
.interet-musique:hover .egaliseur i { animation: danse .6s ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes danse { from { transform: scaleY(.3); } to { transform: scaleY(1.05); } }

/* Rencontres et découvertes : un itinéraire en pointillés entre trois repères ; au survol, on avance */
.itineraire { width: 100%; height: 100%; padding: 6px 4px; overflow: visible; }
.itineraire .trace { fill: none; stroke: var(--muted); stroke-width: 2.5; stroke-dasharray: 2 7; stroke-linecap: round; }
.itineraire .repere path { stroke: rgba(0, 0, 0, .2); stroke-width: 1; }
.itineraire .r0 path { fill: var(--accent); }
.itineraire .r1 path { fill: #B7720E; }
.itineraire .r2 path { fill: #8C3B3B; }
.itineraire .repere circle { fill: #FFFFFF; }
.itineraire text { fill: var(--ink); font: 700 11.5px var(--sans); }
.itineraire .repere { transition: transform .3s ease; transform-box: fill-box; transform-origin: bottom; }
.interet-decouvertes:hover .trace { animation: marche 1.4s linear infinite; }
.interet-decouvertes:hover .r2 { transform: translateY(-4px); }
@keyframes marche { to { stroke-dashoffset: -36; } }

@media (prefers-reduced-motion: reduce) {
  .interet, .etagere span, .itineraire .repere { transition: none; }
  .interet:hover, .interet-lecture:hover .etagere span, .interet-decouvertes:hover .r2 { transform: none; }
  .interet-lecture:hover .etagere span { transform: rotate(180deg); }
  .interet-basket:hover .ballon, .interet-basket:hover .ombre-ballon, .interet-musique:hover .egaliseur i, .interet-musique:hover .micro, .interet-decouvertes:hover .trace { animation: none; }
}
@media (max-width: 1100px) { .interets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .interets { grid-template-columns: 1fr; gap: 16px; } }

/* Langues : même carte que les compétences, une colonne par langue */
.langues { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); padding: 30px; }
.langues h3 { font-family: var(--serif); font-weight: 400; font-size: 1.85rem; line-height: 1.08; margin-bottom: 18px; }
.langues-liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px; }
.langue-nom { display: block; font-weight: 600; }
.langue-niveau { display: block; margin-top: 2px; color: var(--muted); font-size: 1rem; }
.langue-niveau b { color: var(--ink); }
.echelle { display: flex; gap: 4px; margin-top: 10px; max-width: 280px; }
.echelle span { flex: 1; padding: 3px 0; border-radius: 999px; text-align: center; font-size: .8rem; font-weight: 600; background: var(--line); color: var(--muted); }
.echelle span.atteint { background: var(--accent); color: var(--surface); }
.langues-note { margin-top: 16px; font-size: .92rem; color: var(--muted); }

/* ---------- Page projet ---------- */
.entete-projet {
  color: var(--ink);
  background: radial-gradient(50% 90% at 90% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%), var(--bg);
  border-bottom: 1px solid var(--line);
  padding-block: 44px 48px;
}
.retour { color: var(--muted); text-decoration: none; font-weight: 600; }
.retour:hover { color: var(--accent); }
/* Même lien sur une page à fond clair (rubrique Recommandations) */
.retour-page { display: inline-block; margin-bottom: 16px; color: var(--muted); text-decoration: none; font-weight: 600; }
.retour-page:hover { color: var(--accent); }
.entete-projet h1 { margin-top: 24px; font-size: clamp(2.4rem, 4.8vw, 4.2rem); line-height: 1; letter-spacing: -.015em; max-width: 24ch; }
.infos-projet {
  display: grid;
  /* 4 colonnes, ou 5 quand le projet a un état (champ statut) */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px 24px;
  margin: 36px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.infos-projet dt { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.infos-projet dd { margin: 6px 0 0; font-weight: 600; }
.note-lien { margin-top: 12px; font-size: .95rem; color: var(--muted); }
/* Outils du projet, mis en avant en haut de la page (dans l'en-tête) */
.outils-projet { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.outils-projet h2 { margin: 0 0 12px; font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.entete-projet .outils li { background: var(--surface); font-weight: 600; }

/* État d'un projet personnel (champ statut) : texte coloré, sans pastille */
.projet-cadre .statut { margin-left: auto; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.statut.en-cours { color: var(--accent); }
.statut.bloque { color: var(--ochre); }
.infos-projet dd.statut.en-cours { color: var(--accent); }
.infos-projet dd.statut.bloque { color: var(--ochre); }
/* Encadré « Où en est le projet », en tête de la page */
.contenu-projet .etat-projet { padding: 18px 22px; border-left: 4px solid var(--ochre); background: var(--ochre-bg); border-radius: 0 12px 12px 0; }
.contenu-projet .etat-projet h2 { font-size: 1.6rem; margin-bottom: 6px; }
.contenu-projet .etat-projet + section { margin-top: 32px; }

/* Page projet : le récit (texte et images) ; quand le projet a une recommandation, elle est dans une colonne à droite */
.contenu-projet { padding-top: 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px 64px; align-items: start; }
.projet-principal { min-width: 0; }
.contenu-projet section { margin-top: 52px; }
.contenu-projet section:first-child { margin-top: 0; }
.contenu-projet h2 { font-size: clamp(1.9rem, 2.6vw, 2.4rem); line-height: 1.05; margin-bottom: 16px; }
.projet-principal p { max-width: 100ch; }
.contenu-projet p + p { margin-top: 14px; }
.couverture { margin: 0 0 44px; }
.projet-cote h2 { font-size: 1.9rem; }
.outils { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.outils li { padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .95rem; }
.projets-voisins { grid-column: 1 / -1; }
@media (min-width: 1100px) {
  .contenu-projet.avec-cote { grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); }
  .projet-cote { padding-left: 32px; border-left: 1px solid var(--line); }
}

figure { margin: 0; }
figure img { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--line); }
figure a { display: block; cursor: zoom-in; }
figcaption { margin-top: 8px; font-size: .95rem; color: var(--muted); }
.visuels { display: grid; gap: 20px; margin-top: 28px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.visuels > * { grid-column: 1 / -1; }          /* par défaut, une image occupe toute la largeur */
.visuels > .telephone { grid-column: auto; }   /* les captures de téléphone se rangent côte à côte */
/* Vitrine des captures de téléphone (galerieTelephones dans app.js) */
.galerie-tel {
  margin-top: 32px;
  padding: 32px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--surface);
}
/* Les écrans sur une ligne ; s'ils ne tiennent pas (téléphone), on les fait défiler du doigt */
.tel-ecrans {
  list-style: none;
  margin: 0;
  padding: 16px 12px 12px;   /* place pour la pastille numérotée et l'écran qui se soulève au survol */
  display: flex;
  gap: clamp(14px, 1.8vw, 30px);
  justify-content: safe center;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
/* Les écrans se partagent la largeur (130 à 210 px) ; en dessous de 130 px, on les fait défiler */
.tel-ecrans li { flex: 1 1 0; min-width: 130px; max-width: 210px; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tel-cadre {
  position: relative;
  display: block;
  width: 100%;
  padding: 6px;
  border-radius: 28px;
  background: #0A111C;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10), 0 14px 30px rgba(9, 20, 35, .28);
  transition: transform .2s ease, box-shadow .2s ease;
}
.tel-cadre:hover { transform: translateY(-6px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 22px 40px rgba(9, 20, 35, .34); }
.tel-cadre img { display: block; width: 100%; aspect-ratio: 9 / 19.5; object-fit: cover; object-position: top; border: 0; border-radius: 22px; }
@media (prefers-reduced-motion: reduce) { .tel-cadre, .tel-cadre:hover { transition: none; transform: none; } }
/* Numéro en pastille sur le coin de l'écran, titre centré dessous ; les mêmes numéros repèrent les légendes */
.tel-num { position: absolute; z-index: 1; top: -10px; left: -10px; box-shadow: 0 0 0 3px var(--surface); }
.tel-titre { font-weight: 600; font-size: .98rem; line-height: 1.3; text-align: center; }
.tel-num, .tel-legendes i {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  font-style: normal;
  font-size: .8rem;
  font-weight: 700;
}
.tel-ecrans .tel-num { width: 30px; height: 30px; font-size: .9rem; }
.tel-legendes { list-style: none; margin: 28px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 14px 32px; }
.tel-legendes li { display: flex; gap: 12px; align-items: flex-start; }
.tel-legendes i { margin-top: 2px; }
.tel-legendes p { margin: 0; max-width: none; color: var(--muted); font-size: .97rem; }
.tel-legendes b { color: var(--ink); }

/* Galeries séparées d'un projet (galerieSection dans app.js) */
.galerie-intro { margin-top: -4px; color: var(--muted); }

/* Captures d'écran : chaque image dans une fenêtre de navigateur. Deux colonnes qui gardent
   la hauteur naturelle des captures (pas de recadrage), dans l'ordre : colonne de gauche puis de droite. */
.galerie-ecrans { columns: 2 380px; column-gap: 32px; margin-top: 24px; }
.ecran { break-inside: avoid; margin: 0 0 32px; }
.ecran-fenetre, .carte-papier { text-decoration: none; }
.ecran-fenetre {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(9, 20, 35, .14);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ecran-fenetre:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(9, 20, 35, .2); }
.ecran-barre { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.ecran-barre i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.ecran-barre span {
  flex: 1;
  margin-left: 10px;
  padding: 2px 12px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ecran-fenetre img { display: block; width: 100%; height: auto; border: 0; border-radius: 0; }

/* Vidéo de démonstration : le lecteur dans une fenêtre, puis les chapitres */
.video-fenetre { margin-top: 24px; }
.video-fenetre:hover { transform: none; }
.video-fenetre video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.chapitres { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.chapitres button {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.chapitres button b { color: var(--accent); font-variant-numeric: tabular-nums; }
.chapitres button:hover { border-color: var(--muted); }
.chapitres button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Cartes d'exemple : présentées comme des planches imprimées (marge blanche, ombre légère), en grille */
.galerie-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 32px; margin-top: 24px; }
.carte-planche { margin: 0; }
/* Schémas (format "planche") : même papier, en deux colonnes qui gardent la hauteur de chaque schéma */
.galerie-planches { columns: 2 380px; column-gap: 32px; margin-top: 24px; }
.galerie-planches .carte-planche { break-inside: avoid; margin-bottom: 32px; }
.carte-papier {
  display: block;
  padding: 10px;
  background: #FFFFFF;
  border: 1px solid #D9DFE5;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(9, 20, 35, .08), 0 12px 28px rgba(9, 20, 35, .14);
  transition: transform .2s ease, box-shadow .2s ease;
}
.carte-papier:hover { transform: translateY(-3px) rotate(-.3deg); box-shadow: 0 1px 2px rgba(9, 20, 35, .08), 0 18px 36px rgba(9, 20, 35, .2); }
.carte-papier img { display: block; width: 100%; height: auto; border: 0; border-radius: 0; }
.carte-planche figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.carte-planche figcaption b { color: var(--ink); font-size: 1.05rem; }
@media (prefers-reduced-motion: reduce) { .ecran-fenetre, .carte-papier, .ecran-fenetre:hover, .carte-papier:hover { transition: none; transform: none; } }

/* Atlas des ZAEnR, classé par type d'énergie (atlasParType dans app.js) */
.filtres-enr { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.filtres-enr button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.filtres-enr button:hover { border-color: var(--muted); }
.filtres-enr button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.filtres-enr button span { font-weight: 400; color: var(--muted); }
.pastille { display: inline-block; flex: none; width: 11px; height: 11px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .25); }
/* auto-fit : quand un seul type est affiché, ses planches s'élargissent */
.planches { display: grid; gap: 32px; margin-top: 24px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.planches .carte-planche { max-width: 720px; }
/* Cartothèque : lien vers le projet sous chaque carte */
.carto-projet { margin-top: 6px; color: var(--accent); font-weight: 600; text-decoration: none; }
.carto-projet:hover { text-decoration: underline; }   /* une planche seule (filtre) ne s'étire pas sur toute la largeur */
.planches figcaption { display: flex; flex-direction: column; gap: 2px; }
.planches figcaption b { color: var(--ink); }
.planches figcaption span { display: inline-flex; align-items: center; gap: 6px; }

.visuel-a-ajouter {
  padding: 28px 20px;
  border: 2px dashed var(--todo-bg);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
}

.projets-voisins {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.projets-voisins a { text-decoration: none; font-weight: 600; }
.projets-voisins a:hover { color: var(--accent); }
.projets-voisins a:last-child { text-align: right; }
.projets-voisins span { display: block; font-weight: 400; font-size: .9rem; color: var(--muted); }

/* ---------- Contact ---------- */
.coordonnees {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--rayon);
  padding: 4px 30px;
}
/* Sur grand écran, les coordonnées se rangent sur deux colonnes */
@media (min-width: 1000px) {
  .coordonnees { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; }
  .coordonnees > div:nth-last-child(2) { border-bottom: 0; }
}
.coordonnees > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.coordonnees > div:last-child { border-bottom: 0; }
.coordonnees dt { font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.coordonnees dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-weight: 600; overflow-wrap: anywhere; }
.coordonnees a { color: var(--accent); }

/* ---------- Mentions légales : des encadrés répartis en colonnes ---------- */
.mentions { columns: 3 24rem; column-gap: 28px; }
.mentions > section {
  break-inside: avoid;
  margin: 0 0 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--rayon);
  padding: 30px;
}
.mentions h2 { font-size: 1.9rem; line-height: 1.05; margin-bottom: 14px; }
.mentions p + p, .mentions p + ul { margin-top: 12px; }
.mentions ul { margin: 0; padding-left: 1.2em; }
.mentions li + li { margin-top: 8px; }
.mentions a { color: var(--accent); }
.maj { color: var(--muted); font-size: .95rem; }
.copier {
  font: inherit;
  font-size: .85rem;
  padding: 3px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}
.copier:hover { border-color: var(--muted); }

/* ---------- Pied de page ----------
   Fixé en bas de l'écran, comme l'en-tête en haut. Sa hauteur réelle (--hauteur-pied, mesurée
   dans app.js) est réservée en bas de la page pour qu'il ne cache jamais le contenu. */
body { padding-bottom: var(--hauteur-pied, 56px); }
.pied { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--navy); color: var(--on-navy-muted); font-size: .95rem; border-top: 1px solid var(--navy-line); }
.pied .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 24px; padding-block: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
.pied-liens { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.pied a { color: var(--on-navy); text-decoration: none; }
.pied a:hover { text-decoration: underline; }

/* Bouton « revenir en haut », juste au-dessus du pied de page, à droite */
.haut {
  position: fixed;
  z-index: 60;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--hauteur-pied, 56px) + 16px);
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  box-shadow: 0 8px 22px -6px rgba(23, 33, 45, .45);
}
.haut svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.haut:hover { background: var(--accent); }

/* ---------- Visionneuse (images et documents) ----------
   Ouverte par-dessus le site, qui reste visible derrière, assombri et légèrement flou. */
html.v-ouverte { overflow: hidden; }
.visionneuse {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #EDF1F6;
  font-family: var(--sans);
  overflow: hidden;
}
.visionneuse::backdrop { background: rgba(6, 10, 18, .76); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.v-scene { width: 100%; height: 100%; display: grid; place-items: center; padding: 76px 88px 24px; }
.v-cadre { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 100%; }
.v-image { max-width: min(1500px, calc(100vw - 176px)); max-height: calc(100vh - 210px); max-height: calc(100dvh - 210px); border-radius: 6px; overflow: hidden; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); }
.v-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(1500px, calc(100vw - 176px));
  max-height: calc(100vh - 210px);
  max-height: calc(100dvh - 210px);
  border: 0;
  border-radius: 0;
  cursor: zoom-in;
}
/* Taille réelle : on parcourt l'image en faisant défiler le cadre */
.visionneuse.zoome .v-image { width: min(1500px, calc(100vw - 176px)); height: calc(100vh - 210px); height: calc(100dvh - 210px); overflow: auto; }
.visionneuse.zoome .v-image img { max-width: none; max-height: none; cursor: zoom-out; }
.v-legende { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; max-width: 900px; margin: 0; text-align: center; color: #E6EBF2; font-size: .98rem; line-height: 1.5; }
#v-compteur { color: #9FB0C4; font-weight: 600; font-variant-numeric: tabular-nums; }
#v-compteur:empty { display: none; }
.v-actions:empty { display: none; }
.v-actions a { display: inline-block; padding: 8px 18px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .45); color: #FFFFFF; font-weight: 600; text-decoration: none; }
.v-actions a:hover { background: #FFFFFF; color: #13202F; }
/* Bouton fermer : un cercle blanc avec un X ; flèches précédente / suivante en cercles discrets */
.v-fermer, .v-nav { position: fixed; z-index: 2; display: grid; place-items: center; width: 50px; height: 50px; padding: 0; border-radius: 50%; cursor: pointer; }
.v-fermer { top: 18px; right: 18px; border: 0; background: #FFFFFF; color: #13202F; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.v-fermer:hover { background: var(--navy-accent); }
.v-nav { top: 50%; transform: translateY(-50%); border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); color: #FFFFFF; }
.v-nav:hover { background: rgba(255, 255, 255, .28); }
.v-prec { left: 18px; }
.v-suiv { right: 18px; }
.v-fermer svg, .v-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
/* Téléphone : flèches plus petites sur les bords, à mi-hauteur ; plus de place pour la légende */
@media (max-width: 700px) {
  .v-scene { padding: 76px 12px 20px; }
  .v-image, .v-image img, .visionneuse.zoome .v-image { max-width: calc(100vw - 24px); }
  .v-image, .v-image img { max-height: calc(100vh - 280px); max-height: calc(100dvh - 280px); }
  .visionneuse.zoome .v-image { width: calc(100vw - 24px); height: calc(100vh - 280px); height: calc(100dvh - 280px); }
  .v-nav { width: 40px; height: 40px; background: rgba(6, 10, 18, .6); }
  .v-prec { left: 6px; }
  .v-suiv { right: 6px; }
  .v-legende { font-size: .9rem; }
}

/* Rappel affiché uniquement en local (voir rappelLocal dans app.js) */
.rappel-local {
  position: fixed;
  left: 16px;
  bottom: calc(var(--hauteur-pied, 56px) + 16px);
  z-index: 1000;
  max-width: min(420px, calc(100% - 32px));
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--todo-bg);
  color: var(--todo-ink);
  font-size: .9rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
}
.rappel-local a { color: inherit; font-weight: 600; margin-left: 4px; }
.rappel-local button { margin-left: 8px; border: 0; background: none; color: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; }

/* ---------- Écrans moyens et petits ---------- */
@media (max-width: 900px) {
  .hero-grille { grid-template-columns: 1fr; gap: 28px; padding-block: 40px 56px; }
  .hero-portrait { order: -1; justify-self: start; margin: 18px; }
  .hero-portrait::before { inset: -14px; }
  .hero-portrait::after { width: 14px; height: 14px; }
  .hero-photo { width: 132px; height: 132px; border-width: 4px; }
  .competences { grid-template-columns: 1fr; }
  .langues-liste { grid-template-columns: 1fr; gap: 16px; }
  .recommandations { grid-template-columns: 1fr; }
  .infos-projet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .grille-projets { grid-template-columns: 1fr; }
  .coordonnees > div { grid-template-columns: 1fr; gap: 2px; }
  .projets-voisins { grid-template-columns: 1fr; }
  .projets-voisins a:last-child { text-align: left; }
  .nom small { display: none; }
  /* En-tête de téléphone : nom, thème, CV et menu tiennent sur une ligne */
  .entete .wrap { gap: 8px; }
  .nom { font-size: 1.4rem; white-space: nowrap; }
  .theme { width: 36px; height: 36px; }
  .cv-entete { padding: 7px 12px; }
  .burger { padding: 7px 12px; }
}
