/* =============================================================================
   Better Call R&A — Romain Vallade & Antonin Sgambato
   Refonte fidèle de bettercall-ra.com : fond gris très sombre, typographie fine,
   projets en bandeaux vidéo plein écran, menu plein écran.
   Fira Sans tient lieu de Freight Sans (police Adobe de l'ancien site).
   ========================================================================== */

@font-face { font-family: "Fira Sans"; font-weight: 300; font-display: swap; src: url("../assets/fonts/fira-sans-300-latin.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 400; font-display: swap; src: url("../assets/fonts/fira-sans-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 500; font-display: swap; src: url("../assets/fonts/fira-sans-500-latin.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --fond: #202020;
  --fond-haut: rgba(32, 32, 32, 0.88);
  --noir: #111;
  --texte: #ffffff;
  --texte-doux: rgba(255, 255, 255, 0.66);
  --filet: rgba(255, 255, 255, 0.2);
  --police: "Fira Sans", "Freight Sans Pro", "Helvetica Neue", Arial, sans-serif;
  --entete: 96px;
  --marge: clamp(16px, 2.6vw, 32px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --bandeau: 3 / 1;   /* proportion des bandeaux (l'ancien site : 2.4 / 1) */
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--entete); }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 400 16px/1.6 var(--police);
  -webkit-font-smoothing: antialiased;
}
body.is-bloque { overflow: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ol, ul { margin: 0; padding: 0; list-style: none; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--texte); outline-offset: 3px; }
.evitement { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 10px 14px; background: var(--texte); color: var(--fond); }
.evitement:focus { left: 8px; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ----------------------------------------------------------------- En-tête */
.entete {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  height: var(--entete);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--marge);
  background: var(--fond-haut);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.entete__signature {
  display: flex; flex-direction: column;
  font: 400 13px/1.42 var(--police);
  text-decoration: none;
}
.entete__signature strong { font-weight: 500; }
.entete__signature span { color: var(--texte-doux); }
.burger { position: relative; width: 44px; height: 44px; margin-right: -8px; z-index: 41; }
.burger i {
  position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--texte);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.burger i:nth-child(1) { top: 16px; }
.burger i:nth-child(2) { top: 21.5px; }
.burger i:nth-child(3) { top: 27px; }
.burger[aria-expanded="true"] i:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] i:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Menu plein écran */
.menu {
  position: fixed; inset: 0; z-index: 25;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 56px;
  padding: var(--entete) var(--marge) 40px;
  background: var(--fond);
  animation: apparait 0.35s var(--ease);
}
@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }
.menu__liens { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.menu__liens a {
  position: relative;
  font: 300 clamp(28px, 3.2vw, 38px)/1.2 var(--police);
  text-decoration: none; padding-bottom: 4px;
  transition: opacity 0.3s var(--ease), letter-spacing 0.45s var(--ease);
}
/* survol : un trait se dessine de gauche à droite, et repart vers la droite à la sortie */
.menu__liens a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor;
  transform: scaleX(0); transform-origin: right center;
  transition: transform 0.45s var(--ease);
}
.menu__liens a:hover::after, .menu__liens a:focus-visible::after, .menu__liens a[aria-current]::after { transform: scaleX(1); transform-origin: left center; }
.menu__liens:hover a:not(:hover) { opacity: 0.45; }
.menu__liens a:hover { letter-spacing: 0.02em; }
.menu__petits { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; font-size: 14px; }
.menu__petits a { text-decoration: none; color: var(--texte-doux); }
.menu__petits a:hover { color: var(--texte); }

main { padding-top: var(--entete); }

/* ---------------------------------------------------------------- Bandeaux */
.bandeau {
  position: relative; display: grid; place-items: center;
  aspect-ratio: var(--bandeau);          /* très large : plusieurs projets à l'écran */
  min-height: 180px;
  overflow: hidden; background: var(--noir);
  text-decoration: none;
}
/* hauteur souvent fractionnaire : chaque bandeau chevauche le précédent d'1 px, pas de liseré */
.bandeaux li + li { margin-top: -1px; }
.bandeau__media {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.6s var(--ease);
}
.bandeau::after {                      /* voile pour la lisibilité du titre */
  content: ""; position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.3);
  transition: background 0.5s var(--ease);
}
.bandeau:hover::after, .bandeau:focus-visible::after { background: rgba(0, 0, 0, 0.12); }
.bandeau:hover .bandeau__media { transform: scale(1.025); }
.bandeau:focus-visible { outline-offset: -4px; }
.bandeau__titre {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 0.34em;
  padding: 0 var(--marge); text-align: center;
  font: 300 clamp(30px, 3.6vw, 54px)/1.15 var(--police);
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.4);
}
.bandeau__titre small {
  display: block; margin-bottom: 8px;
  font: 400 13px/1 var(--police); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85;
}
.fleche { width: 0.62em; height: 0.62em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 0.4s var(--ease); }
.bandeau:hover .fleche { transform: translateX(4px); }

/* ------------------------------------------------------------- Page projet */
.lecteur {
  --r: 1.7778;
  position: relative; aspect-ratio: var(--r);
  /* lecteur compact, comme l'ancien site : de l'air autour, toujours entier à l'écran */
  width: min(calc(100% - 2 * var(--marge)), 1120px, calc((100vh - var(--entete) - 120px) * var(--r)));
  margin: 0 auto; background: #000;
}
.lecteurs { padding-top: clamp(32px, 5vw, 72px); }
.lecteurs figure { margin: 0; }
.lecteurs figure + figure { margin-top: clamp(32px, 4vw, 56px); }
.lecteurs figcaption { margin-top: 12px; text-align: center; color: var(--texte-doux); font-size: 15px; }
.lecteur iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lecteur__jouer { position: absolute; inset: 0; display: grid; place-items: center; text-decoration: none; }
.lecteur__jouer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lecteur__jouer::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.18); transition: background 0.4s var(--ease); }
.lecteur__jouer:hover::after { background: rgba(0, 0, 0, 0.04); }
.lecteur__icone {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: clamp(44px, 4vw, 60px); aspect-ratio: 1;
  border: 1.5px solid var(--texte); border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}
.lecteur__icone svg { width: 30%; margin-left: 8%; fill: var(--texte); }
.lecteur__jouer:hover .lecteur__icone { transform: scale(1.06); background: rgba(0, 0, 0, 0.32); }

.fiche__tete { max-width: 760px; margin: 0 auto; padding: clamp(40px, 6vw, 76px) var(--marge) clamp(36px, 4.5vw, 60px); text-align: center; }
.fiche__titre { font: 300 clamp(32px, 4vw, 56px)/1.12 var(--police); }
.fiche__infos { margin-top: 14px; color: var(--texte-doux); }
.fiche__credit { margin-top: 4px; color: var(--texte-doux); font-size: 14px; }

/* Grille d'extraits : deux colonnes bord à bord, comme les GIF de l'ancien site */
.grille { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; margin-bottom: clamp(48px, 6vw, 96px); }
/* les vignettes tombent souvent sur des demi-pixels : chaque vidéo déborde d'1 px sous sa voisine,
   pour qu'aucun liseré n'apparaisse à la jointure */
.grille__item { position: relative; aspect-ratio: 16 / 9; background: var(--noir); }
.grille__item .bandeau__media { inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transition: none; }

/* Pages cachées : générique, pages de références, mur d'extraits */
.generique { margin: 18px 0 0; padding: 0; list-style: none; color: var(--texte-doux); font-size: 15px; line-height: 1.8; }
.fiche--references .fiche__tete { padding-bottom: clamp(24px, 3vw, 40px); }
.references { display: grid; gap: clamp(48px, 6vw, 88px); padding-bottom: clamp(48px, 6vw, 96px); }
.reference header { max-width: 760px; margin: 0 auto 18px; padding: 0 var(--marge); text-align: center; }
.reference h2 { font: 300 clamp(24px, 2.6vw, 34px)/1.2 var(--police); }
.reference header p { margin-top: 4px; color: var(--texte-doux); }
.grille--mur { grid-template-columns: repeat(3, 1fr); }
.grille--scope .grille__item { aspect-ratio: 2.39 / 1; }

/* ------------------------------------------------------- Page de texte */
.texte {
  max-width: 720px; margin: 0 auto;
  padding: clamp(56px, 9vw, 120px) var(--marge) clamp(72px, 10vw, 140px);
}
.texte h1 { font: 300 clamp(28px, 3.2vw, 42px)/1.25 var(--police); margin-bottom: 32px; }
.texte p { margin-bottom: 1.1em; color: var(--texte-doux); font-size: 18px; }
.texte p strong { color: var(--texte); font-weight: 400; }
.texte a { color: var(--texte); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.contact { margin-top: clamp(56px, 7vw, 96px); padding-top: clamp(40px, 5vw, 56px); border-top: 1px solid var(--filet); }
.contact h2 { font: 300 clamp(24px, 2.6vw, 32px)/1.3 var(--police); margin-bottom: 28px; }
.contact__personnes { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.contact__personnes h3 { margin: 0 0 6px; font: 400 18px/1.3 var(--police); }
.contact__personnes p { margin: 0; font-size: 16px; }
.contact__personnes a { text-decoration: none; border-bottom: 1px solid var(--filet); }
.contact__personnes a:hover { border-color: var(--texte); }
.texte--centre { text-align: center; min-height: calc(100vh - var(--entete) - 80px); display: flex; flex-direction: column; justify-content: center; }

/* ------------------------------------------------------------------- Pied */
.pied {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px;
  padding: 24px var(--marge);
  font-size: 13px; color: var(--texte-doux);
}
.pied__liens { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.pied a, .pied button { text-decoration: none; color: inherit; }
.pied a:hover, .pied button:hover { color: var(--texte); }
.pied button { font-size: 13px; padding: 4px 0; }

/* --------------------------------------------- Petites animations au survol
   Légères et courtes ; coupées si le système demande de réduire les animations. */
.entete__signature span { transition: color 0.35s var(--ease); }
.entete__signature:hover span { color: var(--texte); }
.burger i { transition: transform 0.3s var(--ease), opacity 0.2s, left 0.3s var(--ease), right 0.3s var(--ease); }
.burger:hover i:nth-child(2) { left: 18px; }                 /* le trait du milieu se raccourcit */
.burger:hover i:nth-child(3) { right: 16px; }
.burger[aria-expanded="true"]:hover i { left: 13px; right: 13px; }

.bandeau__titre { transition: transform 0.5s var(--ease); }
.bandeau:hover .bandeau__titre { transform: translateY(-3px); }
.fleche circle { transition: fill 0.4s var(--ease); }
.bandeau:hover .fleche circle { fill: rgba(255, 255, 255, 0.16); }
.bandeau__titre small { transition: letter-spacing 0.5s var(--ease); }
.bandeau:hover .bandeau__titre small { letter-spacing: 0.16em; }

.lecteur__jouer { overflow: hidden; }
.lecteur__jouer img { transition: transform 1.2s var(--ease); }
.lecteur__jouer:hover img { transform: scale(1.03); }

/* liens du pied et des coordonnées : trait qui se dessine de gauche à droite */
.pied__liens a, .pied__liens button, .menu__petits a { position: relative; }
.pied__liens a::after, .pied__liens button::after, .menu__petits a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right center; transition: transform 0.4s var(--ease);
}
.pied__liens a:hover::after, .pied__liens button:hover::after, .menu__petits a:hover::after { transform: scaleX(1); transform-origin: left center; }
.contact__personnes a { transition: border-color 0.35s var(--ease); }
.texte a { transition: text-underline-offset 0.3s var(--ease); }
.texte a:hover { text-underline-offset: 5px; }

/* Page /debug */
.debug { max-width: 960px; }
.debug h2 { margin: 48px 0 12px; font: 300 24px/1.3 var(--police); }
.debug__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.debug__table th, .debug__table td { padding: 9px 10px; border-top: 1px solid var(--filet); text-align: left; vertical-align: top; }
.debug__table th { width: 30%; font-weight: 400; color: var(--texte-doux); }
.debug__table td { word-break: break-word; }
.debug__etat { width: 90px; white-space: nowrap; }
.debug__table tr.is-ok .debug__etat { color: #7fd18b; }
.debug__table tr.is-ko .debug__etat, .debug__table tr.is-ko td { color: #ff8a7a; }
.debug__video { width: 100%; max-width: 480px; margin-top: 14px; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.debug__vimeo { width: 100%; max-width: 640px; margin: 14px 0 0; }
.debug__copier { padding: 10px 18px; border: 1px solid var(--texte); border-radius: 999px; font-size: 15px; transition: background 0.3s var(--ease), color 0.3s var(--ease); }
.debug__copier:hover { background: var(--texte); color: var(--fond); }
.debug__texte { width: 100%; margin-top: 12px; padding: 10px; background: #111; color: var(--texte); border: 1px solid var(--filet); font: 12px/1.5 ui-monospace, monospace; }

/* ---------------------------------------------------------------- Réactif */
@media (max-width: 760px) {
  :root { --entete: 88px; }
  .entete__signature { font-size: 12px; }
  .grille { grid-template-columns: 1fr; }
  .grille--mur { grid-template-columns: 1fr 1fr; }
  .contact__personnes { grid-template-columns: 1fr; }
  .texte p { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .bandeau__media, .fleche, .lecteur__icone, .bandeau__titre, .bandeau__titre small, .fleche circle,
  .lecteur__jouer img, .burger i, .pied__liens a::after, .pied__liens button::after, .menu__petits a::after { transition: none; }
  .bandeau:hover .bandeau__titre, .lecteur__jouer:hover img { transform: none; }
  .menu { animation: none; }
  .menu__liens a, .menu__liens a::after { transition: none; }
}
