/* psytanger.ma — El Mehdi Khalid, psychologue clinicien
   Un seul fil rouge traverse la page. Tout le reste reste calme. */

:root {
  --chaux: #EFF1EE;      /* fond : blanc de chaux, légèrement froid */
  --encre: #1C2127;      /* texte : graphite */
  --gris: #59606A;       /* texte secondaire (5,7:1 sur --chaux) */
  --trame: #C3C9CC;      /* fils gris, filets */
  --fil: #B8141E;        /* le fil rouge, rouge de fil à broder */
  --fil-fonce: #930F18;
  --nuit: #0F141B;       /* le trou noir */
  --nuit-texte: #E7EAE8;
  --nuit-gris: #A3ACB4;

  --pad: clamp(20px, 5vw, 64px);
  --max: 1160px;
  --entete: 72px;

  --t-petit: 0.9375rem;
  --t-corps: 1.125rem;
  --t-lead: 1.3125rem;
  --t-h3: 1.375rem;
  --t-h2: clamp(2.125rem, 1.45rem + 2.7vw, 3.5rem);
  --t-h1: clamp(2.875rem, 1.55rem + 5.4vw, 6.25rem);
  --t-q: clamp(2.25rem, 1.3rem + 4.2vw, 5rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--entete);
}

body {
  margin: 0;
  background: var(--chaux);
  color: var(--encre);
  font-family: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--t-corps);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }

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

.saut {
  position: absolute;
  left: var(--pad);
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--encre);
  color: var(--chaux);
  text-decoration: none;
}
.saut:focus { top: 12px; }

/* ---------- Typographie ---------- */

.titre {
  font-weight: 520;
  font-stretch: 82%;
  letter-spacing: -0.015em;
  line-height: 1.05;
  text-wrap: balance;
}
.h2 { font-size: var(--t-h2); }
.intro { margin-top: 24px; max-width: 30rem; color: var(--gris); }
.lead { font-size: var(--t-lead); line-height: 1.5; }
.texte { max-width: 34rem; }

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--fil);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease;
}
.btn:hover { background: var(--fil-fonce); }
.btn svg { flex: none; }
.btn--petit { min-height: 44px; padding: 0 20px; font-size: var(--t-petit); }
.btn--grand { min-height: 68px; padding: 0 34px; font-size: 1.125rem; }
.insecable { white-space: nowrap; }

/* ---------- En-tête ---------- */

.entete {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--entete);
  display: flex;
  align-items: center;
  gap: 36px;
  padding-inline: var(--pad);
  background: color-mix(in srgb, var(--chaux) 86%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background-color .4s ease, color .4s ease;
}
.entete.is-sombre {
  background: color-mix(in srgb, var(--nuit) 70%, transparent);
  color: var(--nuit-texte);
}
.entete.is-sombre :focus-visible { outline-color: var(--nuit-texte); }
.entete__nom {
  display: flex;
  flex-direction: column;
  margin-right: auto;
  line-height: 1.25;
  text-decoration: none;
}
.entete__nom-1 { font-size: 1.0625rem; font-weight: 600; }
.entete__nom-2 { font-size: var(--t-petit); color: var(--gris); transition: color .4s ease; }
.entete.is-sombre .entete__nom-2 { color: var(--nuit-gris); }
.entete__nav { display: flex; gap: 28px; font-size: var(--t-petit); }
.entete__nav a { padding-block: 10px; text-decoration: none; }
.entete__nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--fil);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ---------- Sections et fil ---------- */

.bloc {
  position: relative;
  padding-block: clamp(64px, 5vw, 80px);
}
.bloc__in {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.fil-svg {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.fil-svg--devant { z-index: 2; }
.fil-path {
  fill: none;
  stroke: var(--fil);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fil-tete { fill: var(--fil); opacity: 0; }
.fil-tete.is-on { opacity: 1; }

/* petits nœuds (motifs, questions fréquentes) */
.noeud { flex: none; width: 44px; height: 26px; overflow: visible; }
.noeud path {
  fill: none;
  stroke: var(--fil);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* symboles des motifs : une image fixe par difficulté */
.symbole { flex: none; width: 56px; height: 28px; overflow: visible; }
.symbole path {
  fill: none;
  stroke: var(--fil);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.symbole .vif { stroke-width: 1.5; stroke-linejoin: miter; stroke-miterlimit: 12; }
.symbole .fin { stroke-width: 1.2; }
.symbole .fibre { stroke-width: .85; }
.symbole .brin { stroke-width: .6; }
.symbole .autre { stroke: var(--encre); stroke-width: 1.5; }
.symbole .halo { stroke: var(--chaux); stroke-width: 5; }

/* ---------- 1. Le nœud ---------- */

.hero {
  display: flex;
  padding-top: calc(var(--entete) + clamp(16px, 4vh, 48px));
  padding-bottom: clamp(56px, 9vh, 104px);
}
.hero .bloc__in {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 48px;
  align-items: center;
}
.hero__titre {
  font-size: var(--t-h1);
  font-stretch: 76%;
  line-height: .98;
}
.hero__sous { margin-top: 34px; max-width: 28rem; font-size: var(--t-lead); line-height: 1.5; }
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 26px 24px;
  margin-top: 36px;
}
.hero__noeud {
  align-self: center;
  justify-self: center;
  width: min(100%, 500px);
  aspect-ratio: 1;
}
.hero__trame {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, .4) 0, #000 50%);
  mask-image: linear-gradient(to right, rgba(0, 0, 0, .4) 0, #000 50%);
}
.hero__trame path { fill: none; stroke: var(--trame); stroke-width: 1; }

/* ---------- 2. Le trou noir ---------- */

.trou {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--nuit);
  color: var(--nuit-texte);
  touch-action: pan-y;
}
.trou canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.trou .bloc__in {
  width: 100%;
  padding-top: calc(var(--entete) + 24px);
  padding-bottom: clamp(56px, 10vh, 112px);
  pointer-events: none;
}
.trou__texte { max-width: 30rem; }
.trou__texte p { color: var(--nuit-gris); }
.trou__indice {
  position: absolute;
  top: calc(var(--entete) + 24px);
  right: var(--pad);
  z-index: 1;
  font-size: var(--t-petit);
  color: var(--nuit-gris);
  pointer-events: none;
}
.indice-tactile { display: none; }
@media (hover: none) {
  .indice-souris { display: none; }
  .indice-tactile { display: inline; }
}

/* ---------- 3. Ce qui peut vous amener ---------- */

.motifs { padding-bottom: clamp(32px, 3vw, 48px); }
.motifs__liste {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  max-width: 52rem;
  margin-top: 56px;
  border-bottom: 1px solid var(--trame);
}
.motifs__liste li {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-block: 20px;
  border-top: 1px solid var(--trame);
  font-size: 1.3125rem;
  font-stretch: 90%;
  line-height: 1.3;
}

/* ---------- 4. Les bonnes questions ---------- */

.questions { position: relative; height: 320vh; }
.questions__collant {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  align-items: flex-start;
  padding-top: calc(var(--entete) + clamp(24px, 5vh, 64px));
  overflow: hidden;
}
.questions__collant .bloc__in {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr);
  gap: 48px;
  align-items: center;
}
.questions__intro {
  max-width: 28rem;
  font-size: var(--t-lead);
  font-weight: 400;
  line-height: 1.5;
  color: var(--gris);
}
.questions__pile {
  position: relative;
  min-height: calc(var(--t-q) * 3.3);
  margin-top: 32px;
}
.question {
  position: absolute;
  left: 0;
  top: 0;
  font-size: var(--t-q);
  font-weight: 500;
  font-stretch: 80%;
  line-height: 1.02;
  letter-spacing: -.02em;
  text-wrap: balance;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .7s ease;
}
.question.is-active { opacity: 1; transform: none; }
.questions__progres { display: flex; gap: 8px; margin-top: 28px; }
.questions__progres span {
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--trame);
  transition: background-color .4s ease;
}
.questions__progres span.is-on { background: var(--fil); }
.questions__suite { margin-top: 24px; color: var(--gris); }
.questions__marque { justify-self: center; width: min(100%, 300px); aspect-ratio: 3 / 4; }
.questions__point { fill: var(--fil); opacity: 0; transition: opacity .4s ease; }
.questions__point.is-on { opacity: 1; }

/* ---------- 5. Faire des liens ---------- */

/* remonte par-dessus le bas vide du panneau des questions (marge négative posée en JS) */
.approche { z-index: 1; }
.approche .bloc__in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}
.approche__lead { margin-top: 28px; margin-bottom: 20px; }
.principes { display: grid; gap: 22px; margin-top: 44px; }
.principes dt { font-weight: 600; }
.principes dd { margin-top: 4px; color: var(--gris); }
.liens { position: relative; min-height: 540px; margin-top: 24px; }
.lien {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.3125rem;
  font-weight: 600;
  font-stretch: 90%;
  color: var(--gris);
  transition: color .5s ease;
}
.lien:nth-child(1) { left: 6%;  top: 6%; }
.lien:nth-child(2) { left: 50%; top: 30%; }
.lien:nth-child(3) { left: 12%; top: 58%; }
.lien:nth-child(4) { left: 56%; top: 84%; }
.lien__point {
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--fil);
  border-radius: 50%;
  background: var(--chaux);
  transition: background-color .5s ease;
}
.lien.is-on { color: var(--encre); }
.lien.is-on .lien__point { background: var(--fil); }

/* ---------- 6. Comment ça se passe ---------- */

.etapes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px;
  margin-top: 80px;
}
.etape { position: relative; padding-top: 44px; }
.etape__perle {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  border: 2px solid var(--fil);
  border-radius: 50%;
  background: var(--chaux);
  transition: background-color .5s ease;
}
.etape.is-on .etape__perle { background: var(--fil); }
.etape__num { font-size: var(--t-petit); color: var(--gris); }
.etape h3 { margin-top: 4px; font-size: var(--t-h3); font-weight: 600; font-stretch: 90%; line-height: 1.25; }
.etape p { margin-top: 10px; max-width: 22rem; color: var(--gris); }

/* ---------- 7. À propos ---------- */

.apropos .bloc__in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
  gap: 72px;
  align-items: center;
}
.apropos__role { margin-top: 8px; font-size: var(--t-lead); color: var(--gris); }
.apropos__corps { margin-top: 32px; }
.formation {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--trame);
  color: var(--gris);
}
.apropos__photo { position: relative; justify-self: end; width: min(100%, 440px); }
.apropos__photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 4px;
}

/* ---------- 8. Infos pratiques ---------- */

.infos .bloc__in {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 72px;
  align-items: start;
}
.pratique { margin-top: 40px; border-bottom: 1px solid var(--trame); }
.pratique div {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 16px;
  padding-block: 18px;
  border-top: 1px solid var(--trame);
}
.pratique dt { padding-top: 2px; font-size: var(--t-petit); color: var(--gris); }
.pratique dd { font-size: 1.1875rem; }
.faq__titre { font-size: var(--t-h3); font-weight: 600; font-stretch: 90%; margin-bottom: 20px; }
.faq details { border-top: 1px solid var(--trame); }
.faq details:last-of-type { border-bottom: 1px solid var(--trame); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-block: 20px;
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--fil-fonce); }
.faq details p { max-width: 34rem; padding-bottom: 22px; color: var(--gris); }

/* ---------- 9. Le premier pas ---------- */

.rdv { padding-bottom: clamp(64px, 5vw, 80px); }
.rdv__titre { max-width: 12ch; font-size: var(--t-h1); font-stretch: 76%; line-height: .98; }
.rdv__texte { max-width: 32rem; margin-top: 28px; font-size: var(--t-lead); line-height: 1.5; }
.rdv__action { margin-top: 44px; }
.contact { display: grid; gap: 10px; margin-top: 56px; }
.contact a { text-decoration-color: var(--trame); text-underline-offset: 5px; }
.contact a:hover { text-decoration-color: var(--fil); }
.urgence { max-width: 32rem; margin-top: 40px; font-size: var(--t-petit); color: var(--gris); }

/* ---------- Pied de page, barre mobile ---------- */

.pied {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding: 32px var(--pad);
  border-top: 1px solid var(--trame);
  font-size: var(--t-petit);
  color: var(--gris);
}

.barre-rdv {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: none;
  padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--trame);
  background: color-mix(in srgb, var(--chaux) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transform: translateY(110%);
  transition: transform .35s ease;
}
.barre-rdv .btn { width: 100%; }
.barre-rdv.is-visible { transform: none; }

/* ---------- Mobile ---------- */

@media (max-width: 859px) {
  .entete__nav, .entete .btn { display: none; }

  .hero .bloc__in { grid-template-columns: 1fr; gap: 0; align-content: start; }
  .hero__noeud { order: -1; width: min(72vw, 360px); }
  .hero__trame { -webkit-mask-image: none; mask-image: none; opacity: .55; }

  .motifs__liste { grid-template-columns: 1fr; }
  .motifs__liste li { font-size: 1.1875rem; }

  .questions__collant .bloc__in { grid-template-columns: 1fr; gap: 8px; }
  .questions__marque { order: -1; justify-self: end; width: 32vw; max-width: 150px; }

  .approche .bloc__in { grid-template-columns: 1fr; gap: 24px; }
  .liens { min-height: 380px; }
  .lien { font-size: 1.1875rem; }

  .etapes { grid-template-columns: 1fr; gap: 40px; margin-top: 56px; }
  .etape { padding-top: 0; padding-left: 44px; }
  .etape__perle { top: 4px; }

  .apropos .bloc__in { grid-template-columns: 1fr; gap: 48px; }
  .apropos__photo { justify-self: start; width: min(100%, 420px); }

  .infos .bloc__in { grid-template-columns: 1fr; gap: 64px; }
  .pratique div { grid-template-columns: 6.5rem minmax(0, 1fr); }

  .btn--grand { width: 100%; padding-inline: 18px; font-size: 1rem; white-space: normal; text-align: center; text-wrap: balance; }

  .barre-rdv { display: block; }
  .pied { padding-bottom: calc(32px + 76px + env(safe-area-inset-bottom)); }
}

/* ---------- Mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fil-path--intro, .question, .barre-rdv, .lien, .lien__point, .etape__perle { transition: none; }
  .questions { height: auto; }
  .questions__collant { position: relative; height: auto; padding-block: clamp(64px, 5vw, 80px); }
  .questions__pile { display: grid; gap: 24px; min-height: 0; }
  .question { position: static; opacity: 1; transform: none; }
  .questions__progres { display: none; }
}
