/* HBH — feuille de style unique du site hbhgroup.fr */

@font-face {
  font-family: "Libre Caslon Display";
  src: url("../fonts/libre-caslon-display-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("../fonts/libre-franklin-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --marine: #14223D;      /* couleur du logo */
  --marine-nuit: #0E1830; /* pied de page */
  --creme: #F5F4F0;       /* trait du logo */
  --creme-doux: rgba(245, 244, 240, .74);
  --papier: #FFFFFF;
  --encre: #1E2635;
  --pierre: #5E6676;
  --filet: #DADDE3;

  --serif: "Libre Caslon Display", "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;

  --page: 1160px;
  --gouttiere: clamp(20px, 5vw, 48px);
  --respiration: clamp(80px, 11vw, 144px);
  --sol: 64px; /* hauteur entre la ligne d'horizon et le bas de l'ouverture */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
p { margin: 0 0 1.1em; }
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.005em;
  margin: 0;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.lien-evitement {
  position: absolute; left: var(--gouttiere); top: -100px; z-index: 10;
  background: var(--creme); color: var(--marine); padding: 10px 14px;
}
.lien-evitement:focus { top: 12px; }

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

/* ---------- En-tête ---------- */
.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-block: 28px;
}
.marque { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.marque svg { width: 30px; height: 30px; }
.marque span { font-family: var(--serif); font-size: 1.5rem; letter-spacing: .1em; line-height: 1; }
.entete nav a { font-size: .9375rem; text-decoration: none; padding-block: 6px; border-bottom: 1px solid transparent; }
.entete nav a:hover { border-bottom-color: currentColor; }

/* ---------- Ouverture ---------- */
.ouverture {
  position: relative; overflow: hidden;
  background: var(--marine); color: var(--creme);
  min-height: min(92vh, 900px);
  display: flex; flex-direction: column;
}
.ouverture > .page { flex: 1; display: flex; flex-direction: column; }

/* texte à gauche, moaï à droite posé sur l'horizon : la grille empêche tout chevauchement */
.scene {
  flex: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end;
  column-gap: clamp(32px, 5vw, 80px);
  padding-bottom: var(--sol);
}
.accroche { align-self: center; padding-block: 32px 72px; max-width: 44rem; }
.accroche h1 {
  font-size: clamp(2.375rem, 1.25rem + 3.6vw, 4.125rem);
  line-height: 1.07;
  max-width: 13.5em;
  margin-bottom: .55em;
  text-wrap: balance;
}
.accroche p { font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); color: var(--creme-doux); max-width: 31em; margin-bottom: 2.2em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.bouton {
  display: inline-block; text-decoration: none;
  background: var(--creme); color: var(--marine);
  font-weight: 500; font-size: .9875rem; letter-spacing: .01em;
  padding: 15px 26px; border: 1px solid var(--creme);
  transition: background-color .2s ease, color .2s ease;
}
.bouton:hover { background: transparent; color: var(--creme); }
.lien-discret { font-size: .9875rem; color: rgba(245, 244, 240, .8); }

.horizon {
  position: absolute; left: 0; right: 0; bottom: var(--sol); height: 1px;
  background: rgba(245, 244, 240, .22);
  transform-origin: left center;
  animation: horizon 1100ms cubic-bezier(.6, 0, .2, 1) both;
}
/* le moaï reprend le dessin du logo (bandeau et bouche pleins), avec un trait plus léger qu'en petit */
.moai {
  height: min(64vh, 560px); width: auto; aspect-ratio: 64 / 104.1;
  overflow: visible;
}
.moai path { fill: none; stroke: var(--creme); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.moai .trait {
  stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0;
  animation: trace 1700ms cubic-bezier(.55, 0, .25, 1) forwards;
}
.moai .plein { fill: var(--creme); stroke: none; opacity: 0; animation: apparait 700ms ease-out forwards; }
.moai .bouche { stroke: var(--creme); stroke-width: 1.4; }
.moai .t1 { animation-delay: 600ms; }
.moai .t3 { animation-delay: 1300ms; animation-duration: 1000ms; }
.moai .t2 { animation-delay: 1900ms; }
.moai .t4 { animation-delay: 2150ms; }
.lieu { position: absolute; left: max(var(--gouttiere), calc((100% - var(--page)) / 2 + var(--gouttiere))); bottom: 22px; font-size: .8125rem; color: rgba(245, 244, 240, .55); margin: 0; }

@keyframes horizon { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes trace { from { opacity: 1; stroke-dashoffset: 1; } to { opacity: 1; stroke-dashoffset: 0; } }
@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Sections ---------- */
.section { padding-block: var(--respiration); }
.grille { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 32px); }
.section h2 { font-size: clamp(2rem, 1.4rem + 2vw, 2.875rem); line-height: 1.12; color: var(--marine); text-wrap: balance; }

.cabinet .cote { grid-column: 1 / span 5; }

/* Fil démêlé : du complexe au simple, puis les trois temps de la méthode */
.demele { margin: clamp(40px, 5vw, 64px) 0 0; max-width: 420px; }
.demele svg { width: 100%; height: auto; overflow: visible; }
.demele .fil { fill: none; stroke: var(--marine); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.demele .etape circle { fill: var(--papier); stroke: var(--marine); stroke-width: 2.6; }
.demele .fin { fill: var(--marine); stroke: none; }
.demele text { font-family: var(--sans); font-size: 15px; font-weight: 500; fill: var(--pierre); text-anchor: middle; }
.demele.prepare .fil { stroke-dasharray: 1; stroke-dashoffset: 1; }
.demele.prepare.vu .fil { animation: trace 1300ms cubic-bezier(.55, 0, .25, 1) forwards; }
.demele.prepare .etape { opacity: 0; transform: translateY(6px); transform-box: fill-box; transition: opacity .5s ease, transform .5s ease; }
.demele.prepare.droit .etape { opacity: 1; transform: none; transition-delay: calc(1.1s + var(--i) * .3s); }
.cabinet .texte { grid-column: 7 / span 6; font-size: 1.125rem; }
.cabinet .texte p:last-child { margin-bottom: 0; }
.groupe { margin-top: 2em; padding-top: 1.6em; border-top: 1px solid var(--filet); color: var(--pierre); }

/* Domaines : trois dessins posés sur une même ligne, tracés à l'arrivée dans l'écran */
.domaines { background: var(--marine); color: var(--creme); }
.domaines h2 { color: var(--creme); }
.domaines .intro { color: var(--creme-doux); font-size: 1.125rem; max-width: 34em; margin: 18px 0 0; }
.parcours { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(56px, 7vw, 96px); }
.domaine { position: relative; padding-right: clamp(20px, 3vw, 48px); }
.domaine .icone { height: clamp(88px, 7vw, 112px); width: auto; aspect-ratio: 64 / 61.4; color: var(--creme); overflow: visible; }
.icone path { fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.icone .moyeu { fill: currentColor; stroke: none; }
.domaine .sol { height: 1px; background: rgba(245, 244, 240, .38); transform-origin: left center; }
.domaine h3 { font-size: clamp(1.875rem, 1.4rem + 1.3vw, 2.375rem); line-height: 1.1; margin: 28px 0 12px; }
.domaine p { color: var(--creme-doux); margin: 0 0 18px; max-width: 22em; }
.domaine .sujets { font-size: .9375rem; color: var(--creme); margin: 0; max-width: 22em; }

/* état initial, seulement si le script est là pour déclencher l'animation */
.js .domaine .sol { transform: scaleX(0); }
.js .domaine .icone .d { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.js .domaine .icone .aiguille, .js .domaine .icone .moyeu, .js .domaine .icone .faisceau { opacity: 0; }
.icone .aiguille { transform-box: view-box; transform-origin: 32px 58px; }

.domaine.vu .sol { animation: horizon 650ms linear forwards; }
.domaine.vu .icone .d { animation: trace 900ms cubic-bezier(.55, 0, .25, 1) 250ms forwards; }
.domaine.vu .icone .moyeu { animation: apparait 300ms ease-out 900ms forwards; }
.domaine.vu .icone .aiguille { animation: aiguille 1100ms cubic-bezier(.3, 1.4, .5, 1) 900ms forwards; }
.domaine.vu .icone .faisceau { animation: faisceau 1600ms ease-in-out 1050ms forwards; }
.domaine.vu .icone .fleche { animation-delay: 1000ms; animation-duration: 500ms; }
/* sur grand écran, les trois arrivent ensemble : la ligne court de l'un à l'autre */
@media (min-width: 861px) {
  .domaine.vu:nth-child(2) .sol { animation-delay: 650ms; }
  .domaine.vu:nth-child(3) .sol { animation-delay: 1300ms; }
  .domaine.vu:nth-child(2) .icone .d { animation-delay: 900ms; }
  .domaine.vu:nth-child(2) .icone .faisceau { animation-delay: 1700ms; }
  .domaine.vu:nth-child(3) .icone .d { animation-delay: 1550ms; }
  .domaine.vu:nth-child(3) .icone .fleche { animation-delay: 2300ms; }
}

@keyframes aiguille { from { opacity: 1; transform: rotate(-120deg); } to { opacity: 1; transform: rotate(0deg); } }
@keyframes faisceau { 0% { opacity: 0; } 40% { opacity: 1; } 65% { opacity: .35; } 100% { opacity: 1; } }

.contact h2 { grid-column: 1 / span 6; }
.contact .texte { grid-column: 7 / span 6; }
.contact .texte p { color: var(--encre); font-size: 1.125rem; max-width: 30em; }
.courriel { display: inline-block; margin-top: .6em; font-family: var(--serif); font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem); color: var(--marine); }

/* ---------- Pied de page ---------- */
.pied { background: var(--marine-nuit); color: rgba(245, 244, 240, .62); font-size: .875rem; }
.pied .page { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding-block: 32px; }
.pied p { margin: 0; }
.pied a { color: rgba(245, 244, 240, .85); }
.pied .identite p + p { margin-top: 6px; }
.pied .adresse { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.pied .adresse:hover { text-decoration: underline; }
.pied .adresse svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pied .droits span { margin-left: 20px; }

/* ---------- Mentions légales ---------- */
.ouverture.compacte { min-height: 0; }
.ouverture.compacte .accroche { padding-block: 32px 72px; }
.ouverture.compacte h1 { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.25rem); margin-bottom: 0; }
.legal .page > * { max-width: 44rem; }
.legal h2 { font-size: 1.625rem; color: var(--marine); margin: 2.2em 0 .6em; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal ul { color: var(--encre); }
.legal ul { padding-left: 1.2em; margin: 0 0 1.1em; }
.legal .note { color: var(--pierre); font-size: .9375rem; }

/* ---------- Tablette et mobile : le moaï passe sous le texte, centré ---------- */
@media (max-width: 1100px) {
  .scene { grid-template-columns: minmax(0, 1fr); }
  .accroche { padding-bottom: 48px; }
  .moai { justify-self: center; height: clamp(220px, 34vh, 340px); }
}
@media (max-width: 860px) {
  .cabinet .cote, .cabinet .texte, .contact h2, .contact .texte { grid-column: 1 / -1; }
  .contact h2 { margin-bottom: 28px; }
  .demele { margin: 32px 0 44px; }
  .parcours { grid-template-columns: minmax(0, 1fr); row-gap: 56px; }
  .domaine { padding-right: 0; }
}
@media (max-width: 480px) {
  .entete nav a { font-size: .875rem; }
  .moai { height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  .horizon, .domaine.vu .sol { animation: none; transform: none; }
  .moai .trait, .moai .plein { animation: none; opacity: 1; stroke-dashoffset: 0; }
  .js .domaine .sol { transform: none; }
  .js .domaine .icone .d { opacity: 1; stroke-dashoffset: 0; animation: none; }
  .js .domaine .icone .aiguille, .js .domaine .icone .moyeu, .js .domaine .icone .faisceau { opacity: 1; transform: none; animation: none; }
  .bouton { transition: none; }
}
