/* Jo. : feuille de styles du site.
   Deux encres (noir et blanc du logo), deux gris pour le texte secondaire.
   Tout est droit, sauf le point. */

/* Polices servies par le site (celles d'Odratta) : aucune requête vers un tiers. */
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/hanken-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/hanken-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/bricolage-grotesque-var.woff2") format("woff2");
}

:root {
  color-scheme: only light;
  --encre: #000;
  --papier: #fff;
  --gris-clair: #a8a8a8; /* texte secondaire sur l'encre */
  --gris-sombre: #595959; /* texte secondaire sur le papier */
  --gris-moyen: #8c8c8c; /* barre de défilement, lisible sur les deux fonds */
  --titres: "Bricolage Grotesque", "Helvetica Neue", Helvetica, sans-serif;
  --textes: "Hanken Grotesk", "Helvetica Neue", Helvetica, sans-serif;
  --gouttiere: clamp(1.25rem, 5vw, 4rem);
  --rangee: 4.5rem;
  --pied: 5.75rem; /* hauteur du pied de page sur une ligne */
  --contour: var(--encre);
  --ecran: 100vh;
  --ecran-grand: 100vh;
}
@supports (height: 100svh) {
  :root {
    --ecran: 100svh;
    --ecran-grand: 100lvh;
  }
}

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

html {
  background: var(--encre);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scrollbar-color: var(--gris-moyen) var(--encre);
}
html.clair {
  background: var(--papier);
  scrollbar-color: var(--gris-moyen) var(--papier);
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--textes);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-synthesis: none;
  font-kerning: normal;
}

h1,
h2,
p {
  margin: 0;
}
h1,
h2 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  touch-action: manipulation;
  scroll-margin: 0.75rem; /* place pour le contour de focus quand Tab amène le lien à l'écran */
}

svg {
  display: block;
}

::selection {
  background: var(--encre);
  color: var(--papier);
}
.sombre ::selection {
  background: var(--papier);
  color: var(--encre);
}

:focus-visible {
  outline: 2px solid var(--contour);
  outline-offset: 4px;
}
[tabindex="-1"]:focus {
  outline: none;
}

.sombre {
  --contour: var(--papier);
  background: var(--encre);
  color: var(--papier);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.lecteur {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.evitement {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10; /* seul élément au-dessus de la scène, visible au focus seulement */
  padding: 0.75rem 1rem;
  background: var(--papier);
  color: var(--encre);
  font-size: 0.9375rem;
  font-weight: 500;
  transform: translateY(-100%);
}
.evitement:focus {
  transform: none;
  outline-offset: -4px;
}
/* Sur les pages claires, le lien d'évitement s'inverse pour rester visible. */
.clair .evitement {
  --contour: var(--papier);
  background: var(--encre);
  color: var(--papier);
}

/* Icônes dessinées : traits droits, sans arrondi. */
.fleche {
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
  transition: transform 160ms ease-out;
}

/* ---------- Premier écran ---------- */

.scene {
  background: var(--encre);
}

.hero {
  display: grid;
  grid-template-rows: 1fr var(--rangee);
  min-height: var(--ecran);
  padding: var(--rangee) max(var(--gouttiere), env(safe-area-inset-right)) 0 max(var(--gouttiere), env(safe-area-inset-left));
}

.hero-centre {
  --fixe: 29.5rem; /* tout ce qui ne suit pas le corps du titre : rangées, phrase (jusqu’à 7 lignes), bouton, marges */
  --corps: clamp(2rem, min(14.5vw, (var(--ecran) - var(--fixe)) / 4.45), 6rem);
  --largeur: calc(var(--corps) * 5.953); /* largeur d'encre de « On m’appelle » en graisse 700 : le logo a la même */
  display: grid;
  align-self: center;
  justify-self: center;
  justify-items: start; /* un seul fer à gauche : celui du J */
  padding-block: 1rem;
}

.titre {
  width: var(--largeur);
  font-family: var(--titres);
  font-size: var(--corps);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.titre-ligne {
  display: block;
  margin-left: -0.05em; /* approche gauche du O : l'encre s'aligne sur le bord du J */
  white-space: nowrap;
}
.titre-logo {
  display: block;
  margin-top: 0.2em;
}
.titre-logo svg {
  width: 100%;
  height: auto;
  fill: currentColor;
}

.accroche {
  /* Sa propre largeur de lecture : liée au titre, elle s’allongerait à mesure que le titre rétrécit. */
  max-width: max(var(--largeur), min(100vw - 2 * var(--gouttiere), 34rem));
  margin-top: 2rem;
  color: var(--gris-clair);
  font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.375rem);
  line-height: 1.45;
  text-wrap: balance;
}

.bouton {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.25rem;
  margin-top: 2rem;
  padding: 0 1.75rem;
  border: 1px solid transparent; /* visible quand le système impose ses couleurs */
  background: var(--papier);
  color: var(--encre);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms ease-out;
}
.bouton:active {
  transform: scale(0.97);
}

.hero-bas {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--gris-clair);
  font-size: 0.875rem;
  line-height: 1.3;
}
.hero-bas > :last-child {
  justify-self: end;
  text-align: right;
}
.decouvrir {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding-inline: 0.75rem;
  color: var(--papier);
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- Approche ---------- */

.approche {
  background: var(--papier);
  color: var(--encre);
}
.approche-cadre {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2vw, 2rem);
  max-width: 96rem;
  margin-inline: auto;
  padding: clamp(5rem, 16vh, 11rem) max(var(--gouttiere), env(safe-area-inset-right)) clamp(5rem, 16vh, 11rem) max(var(--gouttiere), env(safe-area-inset-left));
}
.approche h2 {
  grid-column: 1 / span 10;
  font-family: var(--titres);
  font-size: clamp(1.875rem, 1.1rem + 3.3vw, 3.75rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.approche p {
  grid-column: 7 / -1;
  max-width: 34rem;
  margin-top: clamp(2rem, 5vw, 4.5rem);
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.375rem);
  line-height: 1.55;
  text-wrap: pretty;
}

/* ---------- Contact : le dernier écran, de nouveau dans le noir du logo ---------- */

.contact {
  position: relative;
  z-index: 1; /* passe au-dessus du bas de la page épinglée quand la barre du navigateur se replie */
  display: grid;
  align-content: center;
  min-height: calc(var(--ecran) - var(--pied)); /* avec le pied de page, un écran exactement */
}
.contact-cadre {
  width: 100%;
  max-width: 96rem;
  margin-inline: auto;
  padding: clamp(4rem, 12vh, 8rem) max(var(--gouttiere), env(safe-area-inset-right)) clamp(3rem, 8vh, 5rem) max(var(--gouttiere), env(safe-area-inset-left));
}
.contact h2 {
  font-family: var(--titres);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.contact-texte p {
  margin-top: 0.5rem;
  color: var(--gris-clair);
}
.coordonnees {
  display: grid;
  justify-items: start;
  margin-top: clamp(2rem, 6vh, 4rem);
  font-family: var(--titres);
  font-size: clamp(1.5rem, 8.3vw, 6.5rem);
  font-style: normal;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.coordonnees a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration-line: underline;
  text-decoration-thickness: max(2px, 0.04em);
  text-underline-offset: 0.14em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Pied de page ---------- */

.pied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1.25rem max(var(--gouttiere), env(safe-area-inset-right)) calc(1.25rem + env(safe-area-inset-bottom)) max(var(--gouttiere), env(safe-area-inset-left));
  color: var(--gris-clair);
  font-size: 0.875rem;
}
.pied-logo {
  display: block;
  padding-block: 0.75rem;
  color: var(--papier);
}
.pied-logo svg {
  width: 3.25rem;
  height: auto;
  fill: currentColor;
}
.pied nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
}
.pied nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- Pages de texte (mentions légales, confidentialité) ---------- */

.entete {
  padding: 1.5rem max(var(--gouttiere), env(safe-area-inset-right)) 0 max(var(--gouttiere), env(safe-area-inset-left));
}
.entete a {
  display: inline-block;
  padding-block: 0.75rem;
}
.entete svg {
  width: 4.5rem;
  height: auto;
  fill: currentColor;
}
.texte {
  max-width: calc(37rem + 2 * var(--gouttiere));
  min-height: calc(var(--ecran) - 12rem);
  padding: clamp(2.5rem, 7vw, 5.5rem) max(var(--gouttiere), env(safe-area-inset-right)) clamp(4rem, 10vw, 8rem) max(var(--gouttiere), env(safe-area-inset-left));
}
.texte h1 {
  font-family: var(--titres);
  font-size: clamp(2.125rem, 1.5rem + 3vw, 3.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
}
.texte h2 {
  margin-top: 3rem;
  font-family: var(--titres);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.texte p {
  margin-top: 1rem;
  text-wrap: pretty;
}
.texte h1 + p {
  margin-top: 1.5rem;
  color: var(--gris-sombre);
}
.texte a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

/* ---------- Page introuvable ---------- */

.perdu {
  display: grid;
  align-content: center;
  justify-items: start;
  min-height: calc(var(--ecran) - var(--pied)); /* avec le pied de page, un écran exactement */
  padding: 4rem max(var(--gouttiere), env(safe-area-inset-right)) 6rem max(var(--gouttiere), env(safe-area-inset-left));
}
.perdu h1 {
  font-family: var(--titres);
  font-size: clamp(2.5rem, 1.5rem + 5vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}
.perdu p {
  max-width: 30rem;
  margin-top: 1.25rem;
  color: var(--gris-clair);
}

/* ---------- Appui : réponse immédiate, au doigt comme à la souris ---------- */

.decouvrir:active,
.coordonnees a:active,
.pied a:active,
.entete a:active,
.texte a:active {
  opacity: 0.6;
}

/* ---------- Survols : seulement avec une vraie souris ---------- */

@media (hover: hover) and (pointer: fine) {
  .bouton:hover .fleche {
    transform: translateX(4px);
  }
  .decouvrir:hover .fleche {
    transform: translateY(3px);
  }
  .coordonnees a:hover {
    text-decoration-thickness: max(4px, 0.08em);
  }
  .pied nav a:hover,
  .pied-logo:hover {
    color: var(--papier);
    text-decoration: underline;
    text-underline-offset: 0.3em;
  }
  .texte a:hover {
    text-decoration-thickness: 2px;
  }
}

/* ---------- Écrans larges et écrans étroits ---------- */

@media (min-width: 48rem) {
  .hero-centre {
    --fixe: 26.5rem; /* phrase sur 4 lignes */
  }
}

@media (max-width: 47.99rem) {
  .approche h2,
  .approche p {
    grid-column: 1 / -1;
  }
  .approche p {
    padding-left: 16.666%;
  }
}

/* Écrans étroits : les deux mentions ne tiennent plus de part et d'autre de « Découvrir ».
   Le nom et le lieu se superposent à gauche, le lien passe à droite, dans la même rangée. */
@media (max-width: 35.99rem) {
  .hero-bas {
    grid-template-columns: 1fr auto;
    align-content: center;
  }
  .hero-bas > span {
    white-space: nowrap;
  }
  .hero-bas > :last-child {
    grid-area: 1 / 1;
    align-self: end;
    justify-self: start;
    text-align: left;
  }
  .hero-bas > :first-child {
    grid-area: 2 / 1;
    align-self: start;
  }
  .decouvrir {
    grid-area: 1 / 2 / 3 / 3;
    padding-inline: 0.75rem 0; /* la flèche s'aligne sur la marge de droite */
  }
}

/* Très petits écrans : la rangée du bas garde chaque mention sur une ligne. */
@media (max-width: 22.49rem) {
  .hero-bas {
    font-size: 0.8125rem;
  }
  .decouvrir {
    padding-inline: 0.25rem 0;
  }
}

/* ---------- Le point du logo s'ouvre sur la page ----------
   Classes posées par le script quand le mouvement est permis et que tout tient à l'écran :
   « anime » épingle le premier écran, « chrono » lie l'ouverture au défilement en CSS
   (sans « chrono », le script règle lui-même le rayon). Sans script : sections empilées. */

@media screen and (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .anime .scene {
    height: calc(2 * var(--ecran));
    view-timeline: --scene block;
  }
  .anime .epingle {
    position: sticky;
    top: 0;
    height: var(--ecran);
  }
  .anime .hero {
    height: 100%;
  }
  .anime .approche {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: var(--ecran-grand);
    clip-path: circle(var(--rayon, var(--depart, 0px)) at var(--x, 50%) var(--y, 50%));
    will-change: clip-path;
  }
  .anime .approche-cadre {
    align-content: center;
    height: var(--ecran);
    padding-block: 2rem;
    opacity: var(--voile, 0);
  }
  /* Voie de repli : le script donne --rayon et --voile, puis « ouvert » une fois la page déployée. */
  .anime.ouvert .hero {
    visibility: hidden;
  }

  .chrono .approche {
    animation: ouvrir 1ms cubic-bezier(0.11, 0, 0.5, 0) both;
    animation-timeline: --scene;
    animation-range: contain 0% contain 75%;
  }
  .chrono .approche-cadre {
    animation: paraitre 1ms linear both;
    animation-timeline: --scene;
    animation-range: contain 1% contain 18%;
  }
  .chrono .hero {
    animation: retirer 1ms linear both;
    animation-timeline: --scene;
    animation-range: contain 0% contain 75%;
  }
}

@keyframes ouvrir {
  from {
    clip-path: circle(var(--depart, 0px) at var(--x, 50%) var(--y, 50%));
  }
  to {
    clip-path: circle(var(--arrivee, 150vmax) at var(--x, 50%) var(--y, 50%));
  }
}
@keyframes paraitre {
  to {
    opacity: 1;
  }
}
/* Une fois recouvert, le premier écran sort du parcours clavier (focus jamais masqué). */
@keyframes retirer {
  to {
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fleche,
  .bouton {
    transition: none;
  }
}

/* ---------- Impression ---------- */

@media print {
  html,
  .scene,
  .sombre {
    background: none;
  }
  .sombre {
    color: var(--encre);
  }
  .accroche,
  .hero-bas,
  .contact-texte p,
  .perdu p {
    color: var(--gris-sombre);
  }
  .hero,
  .contact,
  .perdu {
    min-height: 0;
  }
  .hero-bas {
    grid-template-columns: 1fr 1fr;
  }
  .bouton,
  .decouvrir,
  .evitement,
  .pied {
    display: none;
  }
}
