/* FibroMate — feuille de style unique. Noir, encre, rouge PLA. Fontes système.
   Contrastes calculés sur --noir (#0a0a0b) :
   encre 17,4:1 · gris-fort 11,8:1 · gris 7,4:1 · rouge 5,1:1 · blanc/rouge-pla 6,7:1 */

:root {
  /* couleurs */
  --noir:       #0a0a0b;
  --noir-2:     #131315;
  --noir-3:     #1b1b1e;
  --encre:      #f2f0ee;
  --gris-fort:  #cbc7c3;
  --gris:       #a19d99;
  --rouge:      #e8482f;
  --rouge-pla:  #a6342a;
  --filet:      rgba(242, 240, 238, 0.14);
  --filet-fort: rgba(242, 240, 238, 0.24);

  /* échelle d’espacement */
  --e1: 0.25rem;
  --e2: 0.5rem;
  --e3: 0.75rem;
  --e4: 1rem;
  --e5: 1.5rem;
  --e6: 2rem;
  --e7: 3rem;
  --e8: 4.5rem;
  --section: clamp(4.5rem, 9vh, 8rem);

  /* échelle typographique */
  --t-xs:   0.75rem;
  --t-sm:   0.8125rem;
  --t-base: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  --t-md:   clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --t-lg:   clamp(1.25rem, 1.1rem + 0.72vw, 1.6rem);
  --t-xl:   clamp(1.7rem, 1.32rem + 1.7vw, 2.6rem);
  --t-2xl:  clamp(2.3rem, 1.5rem + 3.2vw, 3.9rem);

  /* gabarit */
  --mesure:    88rem;
  --gouttiere: clamp(1.25rem, 4.6vw, 4.5rem);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--noir);
  color: var(--encre);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }

h1, h2, h3 {
  margin: 0;
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.028em;
  text-wrap: balance;
}
h1 { font-size: var(--t-2xl); letter-spacing: -0.038em; }
h2 { font-size: var(--t-xl); }
h3 {
  font-size: var(--t-md);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.012em;
}

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--encre); }
a:focus-visible,
video:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--rouge);
  outline-offset: 3px;
  border-radius: 1px;
}
main:focus { outline: none; }

/* ---------- utilitaires ---------- */

.mesure {
  max-width: var(--mesure);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}

/* petites capitales mesurées, filet fin en tête */
.rubrique {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 var(--e5);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--gris);
}
.rubrique::before {
  content: "";
  flex: 0 0 1.75rem;
  height: 1px;
  background: var(--rouge);
}

.intro {
  max-width: 46ch;
  margin-top: var(--e5);
  font-size: var(--t-lg);
  line-height: 1.42;
  letter-spacing: -0.013em;
  color: var(--gris-fort);
}

figure { margin: 0; }

figcaption {
  max-width: 44ch;
  margin-top: var(--e3);
  font-size: var(--t-sm);
  line-height: 1.5;
  color: var(--gris);
}

.evitement {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 50;
  padding: 0.9rem 1.4rem;
  background: var(--rouge-pla);
  color: #fff;
  text-decoration: none;
}
.evitement:focus { left: 0; }

/* chiffres : chasse tabulaire partout où ils sont des données */
.crete,
.chiffre,
.coordonnees,
.liste-fiche dd,
.score .detail {
  font-variant-numeric: tabular-nums lining-nums;
}

/* ---------- bouton et lien d’appel ---------- */

.action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--e4) var(--e6);
  margin: 0;
}

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.8rem 1.9rem;
  background: var(--rouge-pla);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  border-radius: 2px;
  transition: background-color 180ms var(--ease-out),
              transform 140ms var(--ease-out);
}
.bouton:active { transform: scale(0.985); }

.lien-tel {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--gris-fort);
  text-decoration: none;
  border-bottom: 1px solid var(--filet-fort);
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .bouton:hover { background-color: #b73c2f; }
  .lien-tel:hover { color: var(--encre); border-bottom-color: var(--rouge); }
}

/* ---------- couverture ---------- */

.couverture {
  display: grid;
  align-content: center;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  max-width: var(--mesure);
  margin-inline: auto;
  padding: clamp(3rem, 9vh, 6rem) var(--gouttiere) clamp(3.5rem, 10vh, 7rem);
}

.marque {
  margin: 0 0 clamp(1.25rem, 3.5vh, 2.25rem);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gris-fort);
}

.couverture h1 { max-width: 15ch; }

.lede {
  max-width: 34ch;
  margin: clamp(1.1rem, 2.6vh, 1.75rem) 0 clamp(1.75rem, 4vh, 2.5rem);
  font-size: var(--t-lg);
  line-height: 1.38;
  letter-spacing: -0.013em;
  color: var(--gris-fort);
}

.crete {
  display: grid;
  gap: 0;
  margin: clamp(2rem, 5vh, 3rem) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--t-sm);
  letter-spacing: 0.005em;
  color: var(--gris-fort);
  border-top: 1px solid var(--filet);
}
.crete li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--filet);
}

.couverture-image img {
  width: 100%;
  height: auto;
  background: var(--noir-2);
  outline: 1px solid var(--filet);
  outline-offset: -1px;
}

@media (min-width: 40rem) {
  .crete {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    border-bottom: 1px solid var(--filet);
  }
  .crete li {
    padding: 0.85rem clamp(1rem, 2vw, 1.75rem);
    border-bottom: 0;
    border-left: 1px solid var(--filet);
  }
  .crete li:first-child { padding-left: 0; border-left: 0; }
}

@media (min-width: 64rem) {
  .couverture {
    min-height: 100svh;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
    align-items: center;
  }
  .couverture-texte { align-self: center; }
}

/* ---------- 1. vues endoluminales ---------- */

.vues { padding: var(--section) 0; }

.pellicule {
  display: flex;
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
  margin-top: clamp(2.5rem, 6vh, 4rem);
  padding: 0 var(--gouttiere) var(--e4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--noir-3) transparent;
  overscroll-behavior-x: contain;
}
.pellicule figure {
  flex: 0 0 min(72vw, 22rem);
  scroll-snap-align: start;
}
.pellicule img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--noir-2);
  outline: 1px solid var(--filet);
  outline-offset: -1px;
}
.pellicule figcaption { max-width: none; }

@media (min-width: 64rem) {
  .pellicule {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(0.9rem, 1.5vw, 1.5rem);
    max-width: var(--mesure);
    margin-inline: auto;
    padding-bottom: 0;
    overflow: visible;
  }
  .pellicule figure { flex: none; }
}

/* ---------- 2 et 3. duos image + texte ---------- */

.duo {
  display: grid;
  gap: clamp(2rem, 4.5vw, 4rem);
  align-items: center;
  max-width: var(--mesure);
  margin-inline: auto;
  padding: var(--section) var(--gouttiere);
}
.duo img {
  width: 100%;
  height: auto;
  background: var(--noir-2);
  outline: 1px solid var(--filet);
  outline-offset: -1px;
}
.duo-texte h2 { margin-bottom: var(--e5); }
.duo-texte p { max-width: 46ch; color: var(--gris-fort); }
.duo-texte p + p { margin-top: 1em; }

.service {
  max-width: none;
  background: var(--noir-2);
}
.service > * {
  width: 100%;
  max-width: 44rem;
  justify-self: center;
}

@media (min-width: 56rem) {
  .objet { grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); }
  .service {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    max-width: none;
    padding-inline: max(var(--gouttiere), calc((100vw - var(--mesure)) / 2 + var(--gouttiere)));
  }
  .service > * { max-width: none; justify-self: stretch; }
  .service .duo-image { order: 2; }
}

/* ---------- 4. évaluation ---------- */

.notes { padding: var(--section) 0; }

.scores {
  display: grid;
  max-width: var(--mesure);
  margin: clamp(2.5rem, 6vh, 4rem) auto;
  padding-inline: var(--gouttiere);
  border-top: 1px solid var(--filet-fort);
  border-bottom: 1px solid var(--filet-fort);
}
.score {
  display: flex;
  flex-direction: column;
  padding: clamp(1.6rem, 3.5vw, 2.4rem) 0;
}
.score .chiffre {
  order: -1;
  margin: 0 0 var(--e3);
  font-size: clamp(3.1rem, 6.4vw, 4.6rem);
  font-weight: 650;
  line-height: 0.88;
  letter-spacing: -0.05em;
  color: var(--encre);
}
.score .sur {
  margin-left: 0.14em;
  font-size: 0.28em;
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: 0.88em;
  color: var(--gris);
}
.score dt {
  max-width: 22ch;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.008em;
}
.score .detail {
  max-width: 24ch;
  margin: var(--e2) 0 0;
  font-size: var(--t-sm);
  line-height: 1.45;
  color: var(--gris);
}
.score--bas .chiffre { color: var(--rouge); }
.score + .score { border-top: 1px solid var(--filet); }

@media (min-width: 44rem) {
  .scores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score { padding-inline: clamp(1.25rem, 3vw, 2.4rem); }
  .score:nth-child(odd)  { padding-left: 0; }
  .score:nth-child(even) { padding-right: 0; border-left: 1px solid var(--filet); }
  .score + .score { border-top: 0; }
  .score:nth-child(n + 3) { border-top: 1px solid var(--filet); }
}
@media (min-width: 72rem) {
  .scores { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .score { padding-inline: clamp(1.1rem, 2vw, 2rem); }
  .score:nth-child(n + 2) { border-left: 1px solid var(--filet); border-top: 0; }
  .score:first-child { padding-left: 0; border-left: 0; }
  .score:last-child  { padding-right: 0; }
}

/* lignes de base alignées entre les quatre notes */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 44rem) {
    .scores { grid-template-rows: repeat(2, auto auto auto); }
    .score {
      display: grid;
      grid-row: span 3;
      grid-template-rows: subgrid;
      align-content: start;
    }
  }
  @media (min-width: 72rem) {
    .scores { grid-template-rows: auto auto auto; }
  }
}

.reserves {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  margin-top: clamp(2rem, 4vh, 3rem);
}
.reserves h3 { margin-bottom: var(--e3); }
.reserves p { max-width: 48ch; color: var(--gris-fort); }
.reserves > div { padding-top: var(--e5); border-top: 1px solid var(--filet); }

@media (min-width: 56rem) {
  .reserves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 5. fabrication ---------- */

.fabrication {
  padding: var(--section) 0;
  background: var(--noir-2);
}
.films {
  display: grid;
  gap: clamp(1.5rem, 3.5vw, 3rem);
  align-items: start;
  max-width: var(--mesure);
  margin: clamp(2.5rem, 6vh, 4rem) auto 0;
  padding-inline: var(--gouttiere);
}
.films video {
  width: 100%;
  height: auto;
  max-height: min(70vh, 32rem);
  background: var(--noir-3);
  outline: 1px solid var(--filet);
  outline-offset: -1px;
}
@media (min-width: 56rem) {
  .films { grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr); }
  .films video { width: auto; max-width: 100%; }
}

/* ---------- 6. la suite ---------- */

.suite { padding: var(--section) 0; }
.suite h2 { max-width: 20ch; margin-bottom: var(--e5); }
.suite p { max-width: 54ch; color: var(--gris-fort); }

/* ---------- 7. fiche technique ---------- */

.fiche {
  padding: var(--section) 0;
  border-top: 1px solid var(--filet);
}
.liste-fiche { margin: clamp(2rem, 5vh, 3rem) 0 0; }
.liste-fiche > div {
  display: grid;
  gap: var(--e1) var(--e6);
  padding: 0.95rem 0;
  border-top: 1px solid var(--filet);
}
.liste-fiche > div:last-child { border-bottom: 1px solid var(--filet); }
.liste-fiche dt {
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--gris);
}
.liste-fiche dd {
  max-width: 58ch;
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--gris-fort);
}
@media (min-width: 46rem) {
  .liste-fiche > div { grid-template-columns: 13rem minmax(0, 1fr); }
}

/* ---------- 8. contact ---------- */

.contact {
  padding: var(--section) 0;
  background: var(--noir-2);
}
.contact h2 { max-width: 20ch; }

.coordonnees {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--e3) var(--e7);
  margin: clamp(1.75rem, 4vh, 2.5rem) 0 var(--e4);
  font-style: normal;
}
.coordonnees a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--rouge);
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 72, 47, 0.38);
  transition: border-color 160ms var(--ease-out);
}
.coordonnees .tel {
  font-size: clamp(1.85rem, 1.2rem + 2.2vw, 2.9rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}
.coordonnees .courriel {
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}
@media (hover: hover) and (pointer: fine) {
  .coordonnees a:hover { border-bottom-color: var(--rouge); }
}

.note-contact {
  margin: 0 0 clamp(1.75rem, 4vh, 2.5rem);
  color: var(--gris-fort);
}

.mention {
  max-width: 50ch;
  margin-top: clamp(2rem, 5vh, 3rem);
  padding-top: var(--e5);
  border-top: 1px solid var(--filet);
  font-size: var(--t-sm);
  line-height: 1.55;
  color: var(--gris);
}

/* ---------- pied ---------- */

.pied {
  padding: clamp(3rem, 6vh, 4.5rem) 0 clamp(3.5rem, 7vh, 5rem);
  border-top: 1px solid var(--filet);
  font-size: var(--t-sm);
  line-height: 1.6;
  color: var(--gris);
}
.pied p { max-width: 60ch; margin-bottom: 0.35em; }
.pied-lien { margin-top: var(--e2); }
.pied a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--gris-fort);
  text-decoration-color: var(--rouge);
  text-underline-offset: 0.22em;
}
@media (hover: hover) and (pointer: fine) {
  .pied a:hover { color: var(--encre); }
}

/* ---------- mentions légales (page secondaire, non réécrite) ---------- */

.bandeau {
  padding: var(--e4) 0;
  border-bottom: 1px solid var(--filet);
}
.bandeau .page,
.pied .page,
.texte-legal.page {
  max-width: var(--mesure);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}
.bandeau .page {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e1) var(--e5);
  align-items: baseline;
  justify-content: space-between;
}
.bandeau .marque { margin: 0; }
.bandeau .marque a { color: var(--encre); }
.bandeau-contact {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--gris);
  font-variant-numeric: tabular-nums lining-nums;
}
.bandeau-contact a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--gris-fort);
}

.texte-legal {
  max-width: 46rem;
  margin-inline: auto;
  padding: clamp(3rem, 7vh, 5rem) var(--gouttiere);
}
.texte-legal h1 { font-size: var(--t-xl); margin-bottom: var(--e6); }
.texte-legal h2 {
  font-size: var(--t-md);
  margin: var(--e7) 0 var(--e3);
  letter-spacing: 0.01em;
}
.texte-legal p, .texte-legal address { color: var(--gris-fort); }
.texte-legal a { color: var(--rouge); text-underline-offset: 0.2em; }
.texte-legal .retour {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}
.a-completer { color: var(--rouge); font-style: italic; }

/* ---------- entrée de couverture et apparitions au défilement ---------- */

/* entrée de couverture : CSS pur, fonctionne sans JavaScript */
.couverture-texte > *,
.couverture-image {
  animation: leve 620ms var(--ease-out) both;
}
.couverture-texte > *:nth-child(2) { animation-delay: 50ms; }
.couverture-texte > *:nth-child(3) { animation-delay: 100ms; }
.couverture-texte > *:nth-child(4) { animation-delay: 150ms; }
.couverture-texte > *:nth-child(5) { animation-delay: 200ms; }
.couverture-image { animation-delay: 120ms; }

@keyframes leve {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.js .anim {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 560ms var(--ease-out), transform 560ms var(--ease-out);
}
.js .anim.vu { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .anim { opacity: 1; transform: none; }
}
