/* ---------- Polices (2 graisses : Regular 400 + Bold 700) ---------- */
@font-face {
  font-family: "Helvetica Site";
  src: url("fonts/Helvetica.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Helvetica Site";
  src: url("fonts/Helvetica-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --bg: #fff;
  --fg: #000;
  --muted: #6b6b6b;      /* gris lisible (contraste AA sur blanc) */
  --text-2: #3a3a3a;       /* texte courant secondaire (descriptions) */
  --line: #e2e2e2;         /* filets */
  --tile: #f0f0f0;         /* fond des médias pendant le chargement */
  --col: clamp(220px, 19vw, 380px);   /* largeur d'une colonne (nav + grille) */
  --gap: clamp(12px, 1.4vw, 20px);
  --pad: clamp(16px, 1.7vw, 28px);
  --font: "Helvetica Site", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --hl: #ffe600;           /* couleur de surlignage (changée au survol par JS) */
  --hl-ink: #000;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--fg); }
body {
  font-family: var(--font); font-weight: 400; letter-spacing: -0.05em;
  display: flex; flex-direction: column; overflow: hidden;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a, button { color: inherit; text-decoration: none; }
input, button { font-family: inherit; letter-spacing: inherit; }
::selection { background: var(--hl); color: var(--hl-ink); }

/* Hiérarchie typographique — sans graisse intermédiaire :
   Bold  = logo, titres, années, intertitres, légendes d'images
   Regular = tout le reste ; le gris (--muted) crée le 2e niveau. */

/* Accessibilité : textes pour lecteurs d'écran, lien d'évitement */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: var(--pad); top: 8px; z-index: 100;
  background: var(--fg); color: var(--bg); padding: .5rem .7rem; font-size: 13px;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.scroller:focus { outline: none; }
.noscript { padding: 0 var(--pad); max-width: 60ch; font-size: 15px; line-height: 1.45; }
.noscript img { display: block; max-width: 100%; height: auto; margin: 1rem 0; }
.empty { padding: 0 var(--pad); color: var(--muted); }

/* ---------- Surlignage (tous les éléments cliquables) ---------- */
.hl {
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  padding: .06em .22em; margin: -.06em -.22em;
}
a:hover .hl, button:hover .hl, a:focus-visible .hl, button:focus-visible .hl,
.is-active .hl, .hl.is-active {
  background: var(--hl); color: var(--hl-ink);
}
a:focus-visible, button:focus-visible { outline: none; }
.logo:focus-visible .hl, .infos-link:focus-visible .hl { outline: 2px solid var(--fg); outline-offset: 2px; }
.nav-arrow:focus-visible, .pl-btn:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; }

/* ---------- Header ---------- */
.header {
  flex: none; display: flex; align-items: flex-start; gap: var(--gap);
  padding: var(--pad) var(--pad) calc(var(--pad) * 1.15);
}
.brand { flex: none; width: var(--col); display: flex; flex-direction: column; align-items: flex-start; gap: 1.4rem; }
.logo { font-weight: 700; font-size: clamp(20px, 1.55vw, 27px); line-height: 1.05; }
.infos-link { font-size: 12px; text-transform: uppercase; }

.nav-wrap { flex: 1; min-width: 0; position: relative; }
.nav {
  min-width: 0; display: flex; gap: calc(var(--gap) * 2);
  overflow-x: auto; scrollbar-width: none;
  padding: 0 .4em; margin: 0 -.4em;
}
.nav::-webkit-scrollbar { display: none; }
/* Menu défilable (seulement quand il dépasse) : fondu sur les bords + flèches */
.nav-wrap.is-scrollable .nav {
  --fl: 56px; --fr: 56px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%);
}
.nav-wrap.is-scrollable.at-start .nav { --fl: 0px; }
.nav-wrap.is-scrollable.at-end .nav { --fr: 0px; }
.nav-arrow {
  position: absolute; top: 50%; z-index: 2; width: 26px; height: 26px; margin-top: -4px;
  display: none; place-items: center; background: var(--bg); color: var(--fg);
  border: 1px solid var(--fg); cursor: pointer;
}
.nav-arrow.prev { left: -6px; }
.nav-arrow.next-a { right: -6px; }
.nav-arrow:hover, .nav-arrow:focus-visible { background: var(--hl); color: var(--hl-ink); border-color: var(--hl); }
.nav-wrap.is-scrollable:not(.at-start) .nav-arrow.prev,
.nav-wrap.is-scrollable:not(.at-end) .nav-arrow.next-a { display: grid; }
.year-group { flex: none; }
.year {
  font-size: 11px; font-weight: 700; line-height: 1.2;
  padding-bottom: .5rem; margin-bottom: .35rem; border-bottom: 1px solid var(--fg);
}
.year-list {
  display: grid; grid-auto-flow: column;
  grid-template-rows: repeat(var(--rows, 4), auto);
  grid-auto-columns: var(--navcol, var(--col)); column-gap: var(--gap);
}
.nav-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .3rem .35em; margin: 0 -.35em;
  font-size: 14.5px; line-height: 1.3; white-space: nowrap;
}
.nav-item .t { flex: none; }
.nav-item .d { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Survol : un seul surlignage continu sur toute la ligne (nom + date) */
.nav-item:hover, .nav-item:focus-visible, .nav-item.is-active { background: var(--hl); color: var(--hl-ink); }
.nav-item:hover .d, .nav-item:focus-visible .d, .nav-item.is-active .d { color: var(--hl-ink); }

/* ---------- Scroll horizontal ---------- */
.scroller {
  flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.scroller::-webkit-scrollbar { display: none; }
.track {
  height: 100%; display: flex; align-items: flex-start; gap: var(--gap);
  padding: 0 var(--pad) calc(var(--pad) + 6px); width: max-content;
  transition: opacity .3s ease;
}
.track.is-leaving { opacity: 0; }

.progress {
  position: fixed; left: 0; bottom: 0; height: 2px; width: 100%; z-index: 5;
  background: var(--fg); transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- Tuiles ---------- */
.column { position: relative; display: flex; flex-direction: column; gap: var(--gap); flex: none; }
.column:has(.is-focused) { z-index: 10; }
.tile { position: relative; display: block; flex: none; overflow: hidden; background: var(--tile); transition: opacity .4s; }
.tile .frame { position: absolute; inset: 0; overflow: hidden; }
.tile picture { display: block; width: 100%; height: 100%; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .4s; }
.tile img { opacity: 0; }
.tile img.loaded { opacity: 1; }
/* États des médias */
.tile.is-error::after {
  content: "Média indisponible"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12px; color: var(--muted); background: var(--tile);
}
.tile.is-error img, .tile.is-error video { visibility: hidden; }
.tile.is-video-error .player-bar, .tile.is-video-error .pl-big { display: none; }
/* vidéos sans lecture auto (économie de données / animations réduites) : pastille ▶ */
a.tile.is-video.no-autoplay::before {
  content: ""; position: absolute; left: 50%; top: 50%; z-index: 2; margin: -12px 0 0 -8px;
  border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 0 6px rgba(0,0,0,.5)); pointer-events: none;
}
.player.is-buffering::after {
  content: "Chargement…"; position: absolute; left: 10px; top: 10px; z-index: 3;
  font-size: 11px; color: #fff; background: rgba(0,0,0,.6); padding: 4px 6px;
}

/* Survol des images : cadre de couleur + légende de la même couleur */
a.tile:hover, a.tile:focus-visible { background: var(--hl); }
a.tile:hover .frame, a.tile:focus-visible .frame { inset: clamp(8px, .8vw, 12px); }
.tile .label {
  position: absolute; left: 0; bottom: 0; z-index: 2; max-width: 100%;
  display: flex; flex-direction: column;
  background: var(--hl); color: var(--hl-ink); padding: .4rem .6rem .45rem;
  visibility: hidden;
}
.label-title { font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label-more { font-size: 11px; white-space: nowrap; max-height: 0; overflow: hidden; }
a.tile:hover .label, a.tile:focus-visible .label { visibility: visible; }

/* Survol prolongé : les autres images s'effacent */
body.is-focus .tile:not(.is-focused) { opacity: .12; }
.tile.is-focused .label-more { max-height: 2em; margin-top: .2rem; }

/* ---------- Lecteur vidéo (page projet) ---------- */
.player-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  font-size: 11px; line-height: 1; color: #fff;
  opacity: 0; transition: opacity .2s;
}
.player:hover .player-bar, .player.is-paused .player-bar, .player.is-scrubbing .player-bar,
.player:focus-within .player-bar { opacity: 1; }
@media (hover: none) { .player-bar { opacity: 1; } }
.player video { cursor: pointer; }
.pl-btn {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px;
  background: none; border: 0; color: #fff; cursor: pointer;
}
.pl-btn:hover, .pl-btn:focus-visible { background: var(--hl); color: var(--hl-ink); }
.pl-time { flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }

.tl { position: relative; flex: 1; min-width: 60px; height: 22px; cursor: pointer; touch-action: none; }
.tl-track { position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; background: rgba(255,255,255,.3); overflow: hidden; transition: height .15s, margin .15s; }
.tl:hover .tl-track, .is-scrubbing .tl-track { height: 6px; margin-top: -3px; }
.tl-buf, .tl-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); }
.tl-buf { background: rgba(255,255,255,.4); }
.tl-fill { background: var(--hl); }
.tl-knob {
  position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  background: #fff; opacity: 0; pointer-events: none; will-change: transform;
}
.tl:hover .tl-knob, .is-scrubbing .tl-knob, .tl:focus-visible .tl-knob { opacity: 1; }
.tl:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }
.tl-tip {
  position: absolute; bottom: 100%; left: 0; transform: translateX(-50%); margin-bottom: 4px;
  background: var(--hl); color: var(--hl-ink); padding: 4px 5px; font-variant-numeric: tabular-nums;
  opacity: 0; pointer-events: none;
}
.tl:hover .tl-tip, .is-scrubbing .tl-tip { opacity: 1; }

.volume { flex: none; display: flex; align-items: center; gap: 4px; }
.volume:hover .vol-range, .volume:focus-within .vol-range { width: 70px; opacity: 1; }
@media (hover: none) { .vol-range { width: 60px; opacity: 1; } }
.vol-btn .w1, .vol-btn .w2 { opacity: 0; }
.vol-btn .x { opacity: 1; }
.volume[data-level="1"] .w1, .volume[data-level="2"] .w1, .volume[data-level="2"] .w2 { opacity: 1; }
.volume:not([data-level="0"]) .x { opacity: 0; }
.vol-range {
  -webkit-appearance: none; appearance: none; width: 0; height: 18px; opacity: 0;
  transition: width .2s, opacity .2s;
  background: transparent; cursor: pointer; --fill: 0%;
}
.vol-range::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, var(--hl) var(--fill), rgba(255,255,255,.3) var(--fill)); }
.vol-range::-moz-range-track { height: 3px; background: rgba(255,255,255,.3); }
.vol-range::-moz-range-progress { height: 3px; background: var(--hl); }
.vol-range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; background: #fff; border: 0; border-radius: 0; }
.vol-range::-moz-range-thumb { width: 12px; height: 12px; background: #fff; border: 0; border-radius: 0; }
.vol-range:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }
.pl-big {
  position: absolute; left: 50%; top: 50%; z-index: 2; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  display: grid; place-items: center; background: var(--hl); color: var(--hl-ink);
  pointer-events: none; opacity: 0;
}
.pl-big svg { width: 26px; height: 26px; }
.player.is-paused:hover .pl-big { opacity: 1; }
.player.is-scrubbing .pl-big { opacity: 0 !important; }

/* ---------- Page projet ---------- */
.project-info {
  flex: none; width: clamp(260px, 24vw, 420px); height: 100%;
  display: flex; flex-direction: column; gap: 2rem;
  padding-right: calc(var(--gap) * .5);
}
.project-info .head { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.project-title { font-size: clamp(30px, 2.6vw, 46px); font-weight: 700; line-height: .98; }
.project-facts {
  display: grid; grid-template-columns: auto 1fr; column-gap: 0;
  margin-top: 1.4rem; border-top: 1px solid var(--fg);
  font-size: 12px; line-height: 1.3;
}
.project-facts dt, .project-facts dd { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.project-facts dt { color: var(--muted); padding-right: 1.4rem; }
.project-facts dd { font-variant-numeric: tabular-nums; }
.project-desc { margin-top: 1.6rem; }
.project-desc p { font-size: 15px; line-height: 1.42; color: var(--text-2); max-width: 36ch; }
.project-desc p + p { margin-top: .8em; }
.project-desc.is-placeholder p { color: var(--muted); }
.project-links { list-style: none; margin-top: 1.4rem; font-size: 13px; line-height: 1.3; }
.project-links li { padding: .2rem 0; }
.project-links a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.project-links a:hover, .project-links a:focus-visible { text-decoration: none; }
/* Légendes sous les médias */
.media-fig { flex: none; margin: 0; }
.media-caption {
  margin-top: 8px; font-size: 12px; line-height: 1.25; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn { white-space: nowrap; font-size: 12px; text-transform: uppercase; cursor: pointer; background: none; border: 0; }
.back { flex: none; align-self: flex-start; }
.project-end { flex: none; width: var(--col); height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: .6rem; padding-right: var(--pad); }
.project-end small { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.next { align-self: flex-start; font-size: clamp(24px, 2.1vw, 36px); font-weight: 700; line-height: 1.05; }

/* ---------- Page infos ---------- */
.infos-col { flex: none; width: calc(var(--col) * 1.6); }
.infos-col.big p { font-size: clamp(24px, 2.1vw, 34px); line-height: 1.12; max-width: 22ch; }
.infos-col.big p:first-child { font-weight: 700; }
.infos-col.big p + p { margin-top: 1.1rem; color: var(--muted); }
.infos-col.small { width: var(--col); }
.infos-col h2 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding-bottom: .5rem; margin-bottom: .35rem; border-bottom: 1px solid var(--fg);
}
.infos-col li { list-style: none; font-size: 14.5px; line-height: 1.3; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.infos-col section + section { margin-top: 2.2rem; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  :root { --col: 64vw; }
  .header { flex-direction: column; gap: 1.1rem; }
  .brand { flex-direction: row; align-items: baseline; justify-content: space-between; width: 100%; }
  .nav-wrap { width: 100%; }
  .year-list { grid-template-rows: repeat(3, auto); }
  .project-info { width: 78vw; }
  .nav-item { padding-top: .45rem; padding-bottom: .45rem; }
  .pl-btn { width: 36px; height: 36px; }
  .tl { height: 32px; }
  .infos-link, .logo { padding: .2rem 0; }
  .infos-col, .infos-col.small { width: 78vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
