/* ════════════════════════════════════════════════════════════════════════
   psy.topilo.dev

   Registre : la fiche technique d'un instrument, pas la page d'un service en
   ligne. Encre marine sur papier de protocole, une seule couleur chaude — un
   ocre imprimerie — réservée à ce qui compte : l'action, et les repères d'âge.

   Signature : la règle des 33 tranches d'étalonnage, qui n'existe que dans ce
   métier et qui porte la seule vraie animation de la page.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  --encre: #0f1d33;
  --encre-douce: #4a5a75;
  --papier: #eef1f6;
  --blanc: #ffffff;
  --trait: #c8d1e0;
  --ocre: #a8761a;

  --serif: 'IBM Plex Serif', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --marge: clamp(1.25rem, 5vw, 5rem);
  --colonne: 68rem;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
code { font-family: var(--mono); font-size: .875em; }

:focus-visible { outline: 2px solid var(--ocre); outline-offset: 3px; }

.evitement {
  position: absolute;
  left: -100vw;
  background: var(--encre);
  color: var(--papier);
  padding: .75rem 1rem;
}
.evitement:focus { left: 1rem; top: 1rem; z-index: 10; }

/* ── en-tête ─────────────────────────────────────────────────────────── */

.tete {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.5rem var(--marge);
  max-width: var(--colonne);
  margin: 0 auto;
}

.marque {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: -.02em;
  margin: 0;
}
.marque span { color: var(--encre-douce); font-weight: 400; }

.tete-liens { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.tete-liens a {
  font-size: .875rem;
  color: var(--encre-douce);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.tete-liens a:hover { color: var(--encre); border-bottom-color: var(--ocre); }

/* ── thèse ───────────────────────────────────────────────────────────── */

.titre {
  max-width: var(--colonne);
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 7rem) var(--marge) clamp(2rem, 5vw, 3.5rem);
}

.chapeau {
  font-family: var(--mono);
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ocre);
  margin: 0 0 1.5rem;
}

.titre h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.75rem, 8vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -.025em;
  margin: 0 0 1.75rem;
  max-width: 18ch;
}
.titre h1 em { font-style: italic; color: var(--encre-douce); }

.conduite {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.65;
  color: var(--encre-douce);
  max-width: 54ch;
  margin: 0 0 2.5rem;
}

.actions { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin: 0; }
.apres-bouton { font-family: var(--mono); font-size: .8125rem; color: var(--encre-douce); }

.bouton {
  display: inline-block;
  background: var(--encre);
  color: var(--papier);
  text-decoration: none;
  font-weight: 500;
  font-size: .9375rem;
  padding: .8125rem 1.5rem;
  border: 1px solid var(--encre);
  transition: background .18s ease, color .18s ease;
}
.bouton:hover { background: var(--ocre); border-color: var(--ocre); color: var(--blanc); }
.bouton.fantome { background: transparent; color: var(--encre-douce); border-color: var(--trait); }
.bouton.fantome:hover { background: transparent; color: var(--encre); border-color: var(--encre); }

/* ── la règle des tranches ───────────────────────────────────────────── */

.regle { padding: 0 var(--marge) clamp(3rem, 7vw, 5rem); max-width: var(--colonne); margin: 0 auto; }

.regle ol {
  display: flex;
  align-items: flex-end;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--encre);
}

.regle li {
  flex: 1 1 0;
  height: 14px;
  border-left: 1px solid var(--trait);
  position: relative;
}
.regle li:first-child { border-left: none; }
.regle li[data-age] { height: 30px; border-left-color: var(--encre); }
.regle li.fin { height: 30px; }

.regle li span {
  position: absolute;
  bottom: calc(100% + .5rem);
  left: 0;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--encre-douce);
  white-space: nowrap;
}
.regle li:first-child span { transform: none; }
.regle li.fin span { left: auto; right: 0; transform: none; }

/* Les repères d'âge se posent l'un après l'autre au chargement : la règle se
   dessine comme on gradue un instrument. */
.regle li[data-age], .regle li.fin { animation: graduer .5s ease both; }
.regle li[data-age="6"] { animation-delay: .05s; }
.regle li[data-age="7"] { animation-delay: .1s; }
.regle li[data-age="8"] { animation-delay: .15s; }
.regle li[data-age="9"] { animation-delay: .2s; }
.regle li[data-age="10"] { animation-delay: .25s; }
.regle li[data-age="11"] { animation-delay: .3s; }
.regle li[data-age="12"] { animation-delay: .35s; }
.regle li[data-age="13"] { animation-delay: .4s; }
.regle li[data-age="14"] { animation-delay: .45s; }
.regle li[data-age="15"] { animation-delay: .5s; }
.regle li[data-age="16"] { animation-delay: .55s; }
.regle li.fin { animation-delay: .6s; }

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

.regle-legende {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--encre-douce);
  margin: 1.25rem 0 0;
}

/* ── sections ────────────────────────────────────────────────────────── */

main section {
  max-width: var(--colonne);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) var(--marge);
  border-top: 1px solid var(--trait);
}

main section h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.section-conduite { color: var(--encre-douce); max-width: 60ch; margin: 0 0 2.5rem; }

.etiquette {
  display: inline-block;
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ocre);
  border: 1px solid currentColor;
  padding: .1875rem .625rem;
  margin: 0 0 1.25rem;
}

.outil-resume { color: var(--encre-douce); max-width: 62ch; margin: 0 0 3rem; font-size: 1.0625rem; }

.capture { margin: 0 0 3rem; }
.capture img {
  border: 1px solid var(--trait);
  box-shadow: 0 24px 48px -28px rgb(15 29 51 / .45);
}
.capture figcaption {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--encre-douce);
  margin-top: .875rem;
}

.faits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* Quatre faits, deux colonnes : à trois par ligne, le quatrième reste seul. */
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 2.5rem 3rem;
}
.faits h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 .5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--encre);
}
.faits p { margin: 0; color: var(--encre-douce); font-size: .9375rem; }

/* ── téléchargement ──────────────────────────────────────────────────── */

.paquets { list-style: none; margin: 0 0 2rem; padding: 0; }

.paquets li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1.5rem 2rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--trait);
}
.paquets li:last-child { border-bottom: 1px solid var(--trait); }

.paquets h3 {
  font-family: var(--sans);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 .25rem;
}
.paquet-quoi p { margin: 0; color: var(--encre-douce); font-size: .9375rem; }
.paquet-poids { font-family: var(--mono); font-size: .875rem; color: var(--encre-douce); margin: 0; }
.paquets .a-venir h3 { color: var(--encre-douce); }

.note-poids { color: var(--encre-douce); font-size: .9375rem; max-width: 58ch; margin: 0; }

/* ── installation ────────────────────────────────────────────────────── */

.marches { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 2.5rem 3rem; }

.marches h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

.marches ol { margin: 0 0 1.25rem; padding-left: 1.25rem; }
.marches li { margin-bottom: .75rem; color: var(--encre-douce); }
.marches li strong { color: var(--encre); font-weight: 600; }

.recours {
  font-size: .875rem;
  color: var(--encre-douce);
  border-left: 2px solid var(--trait);
  padding-left: 1rem;
  margin: 0;
}
.recours code { display: inline-block; word-break: break-all; }

/* ── normes ──────────────────────────────────────────────────────────── */

.normes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; }
@media (min-width: 56rem) {
  .normes { grid-template-columns: 1fr 1fr; align-items: start; gap: 4rem; }
}

.normes p { color: var(--encre-douce); max-width: 52ch; }
.normes-appel { color: var(--encre); }
.normes-appel a { color: var(--ocre); text-underline-offset: 3px; }
.capture-secondaire { margin: 0; }

/* ── pied ────────────────────────────────────────────────────────────── */

.pied {
  max-width: var(--colonne);
  margin: 0 auto;
  padding: 3rem var(--marge) 4rem;
  border-top: 1px solid var(--trait);
  color: var(--encre-douce);
  font-size: .875rem;
}
.pied p { margin: 0 0 .5rem; max-width: 60ch; }
.pied .marque { color: var(--encre); margin-bottom: 1rem; }
.pied a { color: var(--ocre); }

/* ── petits écrans ───────────────────────────────────────────────────── */

@media (max-width: 40rem) {
  .paquets li { grid-template-columns: 1fr auto; }
  .paquets .bouton { grid-column: 1 / -1; text-align: center; }
  .regle li span { font-size: .625rem; }
  .regle li:not([data-age]):not(.fin) { display: none; }
  .regle li { border-left-color: var(--encre); }
}
