/* ==========================================================================
   hiboot — base : reset, typographie, en-tête, composants partagés
   Grammaire : filet 1 px, rayon 3 px, aucune ombre, actions en pilule.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--fb);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

h1, h2, h3 {
  font-family: var(--fh);
  font-weight: 400;
  letter-spacing: var(--ls-titre);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: 1.05; }
h2 { font-size: var(--fs-h2); line-height: 1.15; }
h3 { font-size: var(--fs-h3); line-height: 1.25; }
p { text-wrap: pretty; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 300ms ease;
}
a:hover { color: var(--accent); }

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius);
}

::selection { background: color-mix(in oklab, var(--accent) 35%, transparent); color: var(--ink); }

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

[hidden] { display: none !important; }

.visually-hidden {
  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 {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--pill);
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform 300ms var(--ease);
}
.skip:focus-visible { transform: none; color: var(--on-accent); }

.meta {
  font-size: var(--fs-meta);
  font-weight: 300;
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  line-height: 1.6;
}
.kicker {
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--accent);
}
.num {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}
.dot-accent { color: var(--accent); }
.lead { font-size: var(--fs-lead); line-height: 1.75; color: var(--muted); max-width: 34rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- actions ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 28px;
  border: 1px solid var(--accent);
  border-radius: var(--pill);
  color: var(--accent);
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease;
}
.pill:hover { background: color-mix(in oklab, var(--accent) 10%, transparent); color: var(--accent); }
.pill--plein { background: var(--accent); color: var(--on-accent); }
.pill--plein:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent); }
.pill--discret { border-color: var(--line-strong); color: var(--muted); }
.pill--discret:hover { border-color: var(--accent); }

.rond {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  transition: border-color 300ms ease, background-color 300ms ease;
}
.rond:hover { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 10%, transparent); }
.rond svg { width: 18px; height: 18px; }

.arrow { display: inline-block; transition: transform 400ms var(--ease); }
a:hover .arrow { transform: translateX(4px); }

/* ---------- logo ---------- */

.owl { fill: currentColor; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
}
.brand svg {
  width: auto;
  height: 38px;
  aspect-ratio: 1024 / 1536;
  fill: currentColor;
  view-transition-name: hibou;
}
.brand__name {
  font-family: var(--fh);
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1;
}

/* Bascule jour / nuit : on montre l’icône du mode vers lequel on bascule. */
.mode-toggle .ico-soleil { display: none; }
:root:not([data-mode="jour"]) .mode-toggle .ico-soleil { display: block; }
:root:not([data-mode="jour"]) .mode-toggle .ico-lune { display: none; }

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

.chrome {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--chrome-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.chrome > * { pointer-events: auto; }
.chrome__centre { color: var(--faint); text-align: center; }
.chrome__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

/* ---------- repères (rail du bas, savoir-faire de l’en-tête) ---------- */

.reperes { display: flex; gap: clamp(16px, 2.6vw, 40px); }
.reperes a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  line-height: 1.45; /* mêmes proportions dans l’en-tête et dans le rail du bas */
  color: var(--faint);
}
.reperes a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 500ms var(--ease);
}
.reperes a:hover { color: var(--ink); }
.reperes a:is([aria-current="true"], [aria-current="page"]) { color: var(--accent); }
.reperes a:is([aria-current="true"], [aria-current="page"])::after { transform: scaleX(1); }

/* Savoir-faire dans l’en-tête : toujours en toutes lettres, sur deux lignes si la place manque. */
.chrome:has(.chrome__nav) { grid-template-columns: auto minmax(0, 1fr) auto; }
.chrome__nav .reperes {
  justify-content: center;
  align-items: center;
  gap: clamp(14px, 2.2vw, 40px);
}
.chrome__nav li { min-width: 0; }
.chrome__nav .reperes a { text-align: left; }
.chrome__nav .reperes a > span:not(.num) { text-wrap: balance; }

/* ---------- plumes au clic (site.js) ---------- */

.plumes {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.plume {
  position: absolute;
  left: 0;
  top: 0;
  aspect-ratio: 20 / 44;
  color: var(--accent);
  will-change: transform, opacity;
}
.plume svg { width: 100%; height: 100%; overflow: visible; }
.plume__vane { fill: currentColor; fill-opacity: 0.85; }
.plume__barbes { fill: none; stroke: var(--paper); stroke-opacity: 0.45; stroke-width: 0.8; stroke-linecap: round; }
.plume__tige { fill: none; stroke: currentColor; stroke-width: 0.8; stroke-linecap: round; }

/* ---------- apparition ---------- */

@keyframes hb-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes hb-fade { from { opacity: 0; } to { opacity: 1; } }

.rise { animation: hb-rise 1000ms var(--ease) both; animation-delay: var(--d, 0ms); }

/* ---------- transitions entre pages (amélioration progressive) ---------- */

@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: 420ms; animation-timing-function: var(--ease); }
::view-transition-group(hibou) { animation-duration: 700ms; animation-timing-function: var(--ease); }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  :root { --chrome-h: 64px; }
  .chrome { grid-template-columns: auto 1fr; }
  .chrome__centre,
  .chrome > span:empty { display: none; }
  .chrome .pill { padding: 11px 18px; }
  .brand__name { display: none; }
}

/* Écran moyen : numéro au-dessus du nom, espacement resserré. */
@media (max-width: 1240px) {
  .chrome__nav .reperes a { display: grid; gap: 0; letter-spacing: 0.12em; }
  .chrome:has(.chrome__nav) .brand__name { display: none; }
}

/* Écran étroit : les savoir-faire passent sur une seconde rangée de l’en-tête. */
@media (max-width: 960px) {
  body:has(.chrome__nav) { --chrome-h: 140px; }
  .chrome:has(.chrome__nav) {
    grid-template-columns: auto 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    background: var(--paper);
    border-bottom: var(--rule);
    pointer-events: auto;
  }
  .chrome:has(.chrome__nav) .chrome__nav { display: block; grid-column: 1 / -1; grid-row: 2; }
  .chrome__nav .reperes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .chrome__nav .reperes a {
    padding: 4px 0 10px;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: none;
    line-height: 1.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  @view-transition { navigation: none; }
}
