/* ============================================================
   FIERI / Hyper-Mer — page de présentation, version BASE
   Système : BASE (Z:\base-design-system) — panneau d'instruments
   achromatique, IBM Plex Mono, radius 0, filets 1px, jaune #e7d52e
   réservé au vivant (ici : les particules de la remontée, la lampe
   active).
   ============================================================ */

/* ── fonts ─────────────────────────────────────────── */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Regular-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-SemiBold-latin.woff2") format("woff2");
}

/* ── page tokens (extensions BASE) ─────────────────── */
/* Dérogation assumée au jaune BASE : sur CETTE page, la couleur du
   vivant est l'océan. Quatre profondeurs de bleu, de la surface au fond. */
:root {
  --ocean-1: #6fd0e3;   /* eaux claires   */
  --ocean-2: #3fa7c4;   /* pélagique      */
  --ocean-3: #2e7f9e;   /* abyssal        */
  --ocean-4: #205f7a;   /* hadal          */
  --accent: var(--ocean-2);
  --accent-fill: var(--ocean-2);
  --chunk-ink: #d0d0d0;
  --part-dim: rgba(255, 255, 255, 0.9);    /* bulles blanches : confusion bulles/étoiles voulue */

  /* Échelle typographique agrandie : × 1.25 le 2026-08-29 (la page se lisait
     trop petit), puis encore × 1.25 le 2026-09-14 (demande MBR : le style BASE
     reste trop petit pour une page de lecture), soit × 1.5625 par rapport à
     BASE. On surcharge ici plutôt que dans tokens.css, qui reste le fichier
     BASE canonique partagé avec les autres projets.
     Le JS lit --fs-body pour le texte rendu en canvas : garder ce nom. */
  --fs-micro: 12.5px;     /* 8    × 1.5625 */
  --fs-label: 13.25px;    /* 8.5  × 1.5625 */
  --fs-section: 14px;     /* 9    × 1.5625 */
  --fs-hint: 15px;        /* 9.5  × 1.5625 */
  --fs-value: 15.5px;     /* 10   × 1.5625 */
  --fs-menu: 16.5px;      /* 10.5 × 1.5625 */
  --fs-body: 18px;        /* 11.5 × 1.5625 */
  --fs-base: 18.75px;     /* 12   × 1.5625 */
  --fs-input: 19.5px;     /* 12.5 × 1.5625 */
  --fs-title: 23.5px;     /* 15   × 1.5625 */
  --bar-masthead: 60px;   /* la barre suit, sinon le wordmark touche les bords */
}
html[data-mode="clair"] {
  --accent: #176a82;              /* océan assombri, lisible sur blanc */
  --accent-fill: #3fa7c4;         /* les remplissages gardent l'océan franc */
  --chunk-ink: #2c2c2c;
  --part-dim: rgba(0, 0, 0, 0.20);
}

/* ── reset ─────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  transition: background var(--xfade) ease, color var(--xfade) ease;
  padding-top: var(--bar-masthead);
  padding-bottom: var(--bar-status);
}
a { color: inherit; text-decoration: none; }
button {
  font-family: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}
img, video { display: block; max-width: 100%; }

.lamp {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--dim);
  vertical-align: middle;
  flex: none;
}
.lamp--accent { background: var(--accent-fill); }

/* ── canvas de la remontée ─────────────────────────── */
#remontee {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* ── jauge de profondeur ───────────────────────────── */
#depth-rail {
  position: fixed;
  left: 10px;
  top: calc(var(--bar-masthead) + 24px);
  bottom: calc(var(--bar-status) + 24px);
  width: 1px;
  z-index: 90;
}
.rail-track {
  position: absolute;
  inset: 0;
  background: var(--track);
}
.rail-fill {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 0%;
  background: var(--fill);
}
.rail-mark {
  position: absolute;
  left: 8px;
  transform: translateY(-50%);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  white-space: nowrap;
}
@media (max-width: 1100px) { #depth-rail { display: none; } }

/* ── masthead ──────────────────────────────────────── */
#masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--bar-masthead);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 var(--edge);
  background: var(--chrome);
  border-bottom: 1px solid var(--line);
  z-index: 100;
  transition: background var(--xfade) ease;
}
.wordmark {
  font-size: 19.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--ink);
  white-space: nowrap;
}
#mast-nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
#mast-nav::-webkit-scrollbar { display: none; }
#mast-nav a {
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lab);
  white-space: nowrap;
  transition: color var(--fdback) ease;
}
#mast-nav a:hover { color: var(--ink); transition-duration: var(--fdin); }
.mast-tools { display: flex; align-items: center; gap: 14px; flex: none; }
.mode-toggle {
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lab);
  transition: color var(--fdback) ease;
}
.mode-toggle:hover { color: var(--ink); transition-duration: var(--fdin); }

/* ── hero ──────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 2;
  min-height: calc(88vh - var(--bar-masthead));
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--edge);
}
.hero h1 {
  /* titre seul en Cormorant, la serif fine de la version du 25 août (demande MBR 2026-08-29) */
  font-family: 'Cormorant', Georgia, serif;
  font-size: clamp(48px, 10vw, 120px);
  font-weight: 300;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ink);
  line-height: 1;
}
@media (max-width: 640px) {
  .hero h1 { letter-spacing: 0.15em; text-indent: 0.15em; }
}
/* tout le bloc hero en blanc plein (demande MBR 2026-08-29) : les gris de la
   rampe BASE affaiblissaient l'entrée de page */
.hero-subtitle {
  margin-top: 26px;
  font-size: var(--fs-title);
  color: var(--ink);
  letter-spacing: 0.06em;
}
.hero-meta {
  margin-top: 10px;
  font-size: var(--fs-hint);
  color: var(--ink);
  letter-spacing: 0.04em;
}

/* ── sections ──────────────────────────────────────── */
.section { position: relative; z-index: 2; border-bottom: 1px solid var(--line); }
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 72px var(--edge) 88px;
}
.section-head { margin-bottom: 44px; }
.section-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: var(--fs-section);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--sec);
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: clamp(28px, 4vw, 40.5px);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-2);
}
.section p { max-width: 68ch; font-size: var(--fs-body); }
.section p + p, .section .chunk + p, .section p + .chunk { margin-top: 1em; }
.section strong { font-weight: 600; color: var(--ink); }
.section p a { color: var(--ink); border-bottom: 1px solid var(--line-2); }
.section p a:hover { border-color: var(--ink); }
.chunk--wide { max-width: 74ch; }

/* pretext chunks : le canvas remplace visuellement le paragraphe */
.chunk { position: relative; margin: 1.4em 0; max-width: 74ch; min-width: 0; }
.chunk canvas { display: block; width: 100%; max-width: 100%; }
.chunk.is-canvas > p {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.chunk--lead { max-width: 100%; }

/* éléments bousculés hors pretext (titres, labels, tableaux) */
.jostle-sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.is-jostle { position: relative; }
.is-jostle > canvas { display: block; width: 100%; max-width: 100%; }
.zone-row dt .dt-text { flex: 1; min-width: 0; }

.pull-quote {
  margin: 2em 0 0.5em;
  padding-left: 20px;
  border-left: 1px solid var(--line-2);
  font-size: var(--fs-title);
  line-height: 1.55;
  color: var(--sec);
  letter-spacing: 0.02em;
  max-width: 46ch;
}

.spec-heading {
  font-size: var(--fs-section);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--sec);
  margin: 40px 0 14px;
}
.spec-heading--accent { color: var(--accent); }
.section-head + .spec-heading, .chunk + .spec-heading { margin-top: 32px; }

.meta-note { font-size: var(--fs-hint); color: var(--lab); }
.text-link {
  font-size: var(--fs-value);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sec);
  border-bottom: 1px solid var(--line-2);
  transition: color var(--fdback) ease;
}
.text-link:hover { color: var(--ink); transition-duration: var(--fdin); }

/* ── figures : n&b, filet 1px ──────────────────────── */
figure img, figure video {
  width: 100%;
  filter: grayscale(1) contrast(1.05);
  box-shadow: 0 0 0 1px var(--line);
}
figcaption {
  margin-top: 8px;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lab);
}
figcaption a { border-bottom: 1px solid var(--line-2); }
figcaption a:hover { color: var(--ink); }

.figure-full { margin-top: 24px; }
.figure-full img { box-shadow: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.container-cap {
  display: block;
  max-width: 1140px;
  margin: 8px auto 0;
  padding: 0 var(--edge) 32px;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lab);
}
p.container-cap { text-transform: none; font-size: var(--fs-hint); letter-spacing: 0.04em; }

.figure-block { margin: 32px 0; }

/* ── grilles ───────────────────────────────────────── */
.projet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  align-items: start;
}
.projet-grid > *, .two-col > *, .three-col > * { min-width: 0; }
.projet-figure { position: sticky; top: calc(var(--bar-masthead) + 24px); }
@media (max-width: 860px) {
  .projet-grid { grid-template-columns: 1fr; }
  .projet-figure { position: static; max-width: 340px; }
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 24px;
}
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; gap: 24px; } }

.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 960px) { .three-col { grid-template-columns: 1fr; gap: 16px; } }
.col-block > .spec-heading:first-child { margin-top: 0; }

.image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 56px;
}
.image-grid figure { background: var(--bg); }
.image-grid img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  box-shadow: none;
}
.grid-cap { padding: 6px 10px 10px; margin-top: 0; }
@media (max-width: 600px) { .image-grid { grid-template-columns: 1fr; } }
.image-grid + .container-cap { margin-top: 12px; }

/* ── listes ────────────────────────────────────────── */
.ref-list { list-style: none; }
.ref-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
  color: var(--val);
  line-height: 1.55;
}
.ref-list li:last-child { border-bottom: none; }
.ref-list strong { color: var(--ink); font-weight: 600; }
.ref-list a { border-bottom: 1px solid var(--line-2); }
.ref-list a:hover strong { border-color: var(--ink); }

/* ── filiations : un seul paragraphe ───────────────── */
.filiations-par {
  max-width: 74ch;
  font-size: var(--fs-body);
  line-height: 1.8;
  color: var(--val);
}

/* ── zones (univers) ───────────────────────────────── */
.zone-list { display: block; }
.zone-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.zone-row:last-child { border-bottom: none; }
.zone-row dt {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: var(--fs-value);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sec);
}
.zone-row.is-active dt { color: var(--ink); }
.zone-row dd { font-size: var(--fs-body); color: var(--val); max-width: 68ch; }
.zone-row.is-active dd { color: var(--body); }
@media (max-width: 700px) {
  .zone-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ── splat ─────────────────────────────────────────── */
.splat-block { position: relative; margin-top: 40px; max-width: 74ch; }
.splat-canvas-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
  box-shadow: 0 0 0 1px var(--line);
}
.splat-canvas-wrap canvas { width: 100%; height: 100%; filter: grayscale(1); }
.splat-loading {
  position: absolute;
  top: 0; left: 0; right: 0;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  transition: opacity var(--fdback) ease;
  z-index: 2;
}
.splat-loading.done { opacity: 0; pointer-events: none; }
.splat-loading-text {
  font-size: var(--fs-hint);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #5f5f5f;
  text-align: center;
  line-height: 2;
}
html[data-mode="clair"] .splat-canvas-wrap,
html[data-mode="clair"] .splat-loading { background: #000; } /* le nuage reste sombre */

/* ── footer ────────────────────────────────────────── */
#site-footer { position: relative; z-index: 2; }
#site-footer .container { padding-top: 56px; padding-bottom: 72px; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
}
.footer-title { font-size: 19.5px; font-weight: 600; letter-spacing: 0.2em; color: var(--ink); }
.footer-artist { margin: 8px 0 12px; font-size: var(--fs-body); color: var(--sec); }
.footer-right .spec-heading { margin-top: 0; }
.footer-doc { margin-top: 18px; font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); }

/* ── status bar ────────────────────────────────────── */
#statusbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--bar-status);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--edge);
  background: var(--chrome);
  border-top: 1px solid var(--line);
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hud);
  z-index: 100;
  transition: background var(--xfade) ease;
}
.status-left { display: flex; align-items: center; gap: 8px; }

/* ── responsive ────────────────────────────────────── */
@media (max-width: 760px) {
  #mast-nav { display: none; }
  .container { padding: 48px 20px 56px; }
  :root { --edge: 20px; }
}

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

/* ── comparaison avant / après (9 octobre 2026) ────────
   La photo de l'appareil reste en couleur, l'image de FIERI
   est grise comme toutes les figures. Deux curseurs côte à
   côte, empilés sur téléphone. */
.cmp-block { padding-top: 8px; padding-bottom: 48px; }
.cmp-block .meta-note { margin: 4px 0 20px; }
.cmp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 760px) { .cmp-grid { grid-template-columns: 1fr; } }
.cmp-figure { margin: 0; min-width: 0; }
.cmp {
  --pos: 50%;
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
  user-select: none;
  touch-action: pan-y;
}
.cmp img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  box-shadow: none;
}
.cmp-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.cmp-before img { filter: none; }
.cmp-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos);
  width: 1px; background: var(--ink);
  pointer-events: none;
}
.cmp-handle::after {
  content: "";
  position: absolute; top: 50%; left: 0;
  width: 14px; height: 14px;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border: 1px solid var(--ink);
}
.cmp-range {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0; opacity: 0;
  cursor: ew-resize;
}
.cmp:has(.cmp-range:focus-visible) .cmp-handle,
.cmp:has(.cmp-range:focus-visible) .cmp-handle::after { background: var(--accent); border-color: var(--accent); }
.cmp-tag {
  position: absolute; top: 8px;
  padding: 2px 6px;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
  pointer-events: none;
}
.cmp-tag--l { left: 8px; }
.cmp-tag--r { right: 8px; }

/* ── logos des soutiens (20 octobre 2026) ──────────────
   Même principe que la page Les murmures : intertitre « Avec le
   soutien de » puis une grille de cartes à filet 1px, sans lien.
   Les fichiers sont noirs sur transparent ; le CSS les passe en
   gris et les inverse en mode sombre. Les deux logos doivent peser
   le même poids (condition de la Fondation Givel : logo montré « au
   même titre que d'autres institutions »), d'où une hauteur par
   logo, réglée à surface d'encre à peu près égale. */
.footer-right .footer-support { margin-top: 32px; }
.footer-logo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 440px;
}
.footer-logo-card {
  display: grid;
  place-items: center;
  min-height: 88px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.footer-logo { max-width: 100%; width: auto; height: auto; object-fit: contain; }
.footer-logo--cprn { max-height: 64px; }
.footer-logo--givel { max-height: 46px; }
:root:not([data-mode="clair"]) .footer-logo { filter: grayscale(1) invert(1); opacity: 0.75; }
html[data-mode="clair"] .footer-logo { filter: grayscale(1); opacity: 0.85; }
.footer-support + .footer-doc { margin-top: 24px; }
/* téléphones étroits : moins de marge latérale pour que Givel garde sa taille */
@media (max-width: 360px) { .footer-logo-card { padding: 12px 8px; } }
