/* Cycle de l'eau : landing temporaire
   Composition : bandes pleine largeur, vert dominant, une idée par écran,
   textes décalés sur la grille, beaucoup de vide. */

:root {
  /* Charte : quatre couleurs, aucune autre */
  --vert: #21350F;
  --bleu: #BDD5EF;
  --beige: #FFEAD3;
  --orange: #FF5C26;

  /* Typographie : une seule famille */
  --font: "Google Sans Flex", "Google Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --t-h2: clamp(2.25rem, 6.4vw, 4.5rem);
  --t-chapo: clamp(1.25rem, 2.4vw, 1.625rem);
  --t-corps: 1.0625rem;
  --t-label: 0.8125rem;

  --s-8: 0.5rem;
  --s-16: 1rem;
  --s-24: 1.5rem;
  --s-32: 2rem;
  --s-48: 3rem;
  --s-64: 4rem;
  --s-96: 6rem;
  --s-128: 8rem;
  --s-200: 12.5rem;

  --gutter: var(--s-24);
  --section-y: var(--s-96);
  --page-max: 80rem;
  --radius-champ: 0.875rem;
  --radius-pill: 999px;

  color-scheme: light;
}

@media (min-width: 48rem) {
  :root { --gutter: var(--s-64); --section-y: var(--s-128); }
}
@media (min-width: 75rem) {
  :root { --gutter: var(--s-128); --section-y: var(--s-200); }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* Avec ScrollSmoother, le lissage est assuré par GSAP */
html.smooth { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--vert);
  color: var(--bleu);
  font-family: var(--font);
  font-size: var(--t-corps);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p { margin: 0; }
h1, h2 { font-weight: 700; letter-spacing: -0.035em; line-height: 0.98; text-wrap: balance; }

a { color: inherit; }

.skip {
  position: absolute; left: var(--s-16); top: -10rem;
  background: var(--bleu); color: var(--vert);
  padding: var(--s-8) var(--s-16); border-radius: var(--radius-pill);
  font-weight: 700; text-decoration: none; z-index: 20;
}
.skip:focus { top: var(--s-16); }

/* Focus : anneau plein, couleur du texte de la bande */
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }

/* Bandes */
.band { padding-block: var(--section-y); }
.band--vert { background: var(--vert); color: var(--bleu); }
.band--beige { background: var(--beige); color: var(--vert); }

.wrap {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.label {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* En-tête */
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-24);
  padding-block: var(--s-24);
}
.logo { display: inline-block; }
.logo img { width: 7.5rem; }
@media (min-width: 48rem) { .logo img { width: 9rem; } }

.lien {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition: text-decoration-color 160ms ease-out;
}
.lien:hover { text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
.site-header .lien { font-weight: 500; padding-block: var(--s-8); }

/* Hero : animation du logo en plein écran, puis le message en texte */
.hero__anim { position: relative; height: 100vh; height: 100svh; min-height: 22rem; overflow: hidden; }
.hero #cde-reveal { aspect-ratio: auto; height: 100%; max-width: 100%; }
/* Écran en hauteur : on agrandit le logo, sinon il ne fait qu'un tiers de la largeur */
@media (max-aspect-ratio: 1/1) {
  .hero #cde-reveal svg { width: 160%; left: -30%; }
}
/* Vagues d'angle : entrent en diagonale depuis l'extérieur de l'écran et s'ancrent dans les coins
   haut gauche et bas droit, au moment où l'écran passe au vert */
.hero__vague {
  position: absolute; z-index: 1; pointer-events: none;
  width: clamp(84px, 15.4vw, 252px); height: auto;
  transition: transform 1200ms cubic-bezier(.22, 1, .36, 1) 250ms;
}
.hero__vague--haut { top: 0; left: 0; }
.hero__vague--bas { right: 0; bottom: 0; transform: rotate(180deg); transition-delay: 400ms; }
.hero--intro .hero__vague--haut { transform: translate(-105%, -105%); transition: none; }
.hero--intro .hero__vague--bas { transform: rotate(180deg) translate(-105%, -105%); transition: none; }
@media (max-width: 40rem) { .hero__vague { width: 26.6vw; } }
@media (prefers-reduced-motion: reduce) { .hero__vague { transition: none; } }

/* Lien de contact et flèche posés sur l'animation, en bleu clair : masqués pendant la phase blanche */
.hero__contact {
  position: absolute; z-index: 2;
  top: calc(var(--s-24) + env(safe-area-inset-top, 0px));
  right: max(var(--gutter), env(safe-area-inset-right, 0px));
  font-weight: 500; padding-block: var(--s-8);
}
.hero__suite {
  position: absolute; z-index: 2; left: 50%;
  bottom: calc(var(--s-32) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: grid; place-items: center;
  width: 3rem; height: 4rem; color: var(--bleu);
  border-radius: var(--radius-pill);
}
.hero__suite svg { transition: transform 200ms ease-out; }
.hero__suite:hover svg { transform: translateY(4px); }
.hero__suite:hover { color: var(--orange); }
.hero__contact, .hero__suite { transition: opacity 500ms ease-out; }
.hero--intro .hero__contact, .hero--intro .hero__suite { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .hero__suite svg { animation: descente 2.4s ease-in-out 1s infinite; }
  .hero__suite:hover svg { animation: none; }
}
@keyframes descente { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(6px); } }

.hero__fixe { position: absolute; inset: 0; margin: auto; width: min(60%, 22rem); }

.hero__texte { display: grid; gap: var(--s-32); justify-items: center; text-align: center; padding-block: var(--s-96) var(--s-128); }
@media (min-width: 75rem) { .hero__texte { padding-block: var(--s-128) var(--s-200); } }
.hero h1 { font-size: clamp(2rem, 4.6vw, 4.25rem); line-height: 1.05; letter-spacing: -0.04em; }
.hero__sous { font-size: clamp(1.25rem, 2.2vw, 1.75rem); font-weight: 500; letter-spacing: -0.015em; line-height: 1.35; max-width: 26em; text-wrap: balance; }
@media (min-width: 60rem) {
  .hero h1 { white-space: nowrap; }
}

/* Défilement du hero (avec JS) : la scène reste à l'écran le temps d'un écran de défilement.
   Le logo s'efface, puis le titre apparaît au centre ; ensuite la page reprend vers les piliers. */
.js .hero { height: 220vh; height: 220svh; }
.js .hero__scene { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.js .hero #cde-reveal { opacity: var(--logo, 1); }
.js .hero__texte {
  position: absolute; inset: 0; z-index: 1;
  align-content: center; padding-block: var(--s-96);
  opacity: var(--texte, 0);
  transform: translateY(calc((1 - var(--texte, 0)) * 32px));
  pointer-events: none;
}
.js .hero__suite { opacity: var(--fleche, 1); }
/* Pendant la phase blanche de l'animation, la flèche reste cachée */
.js .hero--intro .hero__suite { opacity: 0; }

/* En-tête de section */
.entete { display: grid; gap: var(--s-24); max-width: 52rem; margin-bottom: var(--s-64); }
@media (min-width: 48rem) { .entete { margin-bottom: var(--s-96); } }
.entete h2 { font-size: var(--t-h2); }

/* Piliers */
/* Piliers */
.piliers { border-top: 1px solid var(--bleu); }
.piliers .entete { margin-inline: auto; justify-items: center; text-align: center; }
.piliers .entete h2 { text-wrap: balance; }

/* Piliers, variante A : le paquet qui s'étale.
   État de repos (sans JS) : cartes alignées. Le JS pose d'abord le paquet, puis l'étale à l'écran. */
.piliers__grille {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center;
}
.pilier {
  --x: 0%; --y: 0%; --r: 0deg; --s: 1;
  position: relative; width: 70%; max-width: 24rem; min-width: 0;
  transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(var(--s));
  transition: transform 900ms cubic-bezier(.34, 1.45, .64, 1);
}
.pilier + .pilier { margin-top: 3.5%; }
.pilier:nth-child(1) { z-index: 1; }
.pilier:nth-child(2) { z-index: 2; }
.pilier:nth-child(3) { z-index: 3; }

.pilier img {
  width: 100%; max-width: 100%; aspect-ratio: 569 / 798;
  /* Contour fin calé sur le rayon du SVG (30 / 569 x 798) */
  border-radius: 5.27% / 3.76%;
  box-shadow: 0 0 0 1.5px var(--vert);
}
/* Chauffage : pas de contour, son fond est un vert plus clair que la section (dans le SVG) */
.pilier:nth-child(2) img { box-shadow: none; }

/* Paquet, mobile : les cartes se resserrent sur celle du milieu */
.piliers__grille.en-paquet .pilier:nth-child(1) { --y: 103.6%; --r: -5deg; --x: -2%; }
.piliers__grille.en-paquet .pilier:nth-child(2) { --r: 3deg; --x: 2%; }
.piliers__grille.en-paquet .pilier:nth-child(3) { --y: -103.6%; --r: -1deg; }

@media (min-width: 48rem) {
  .piliers__grille { flex-direction: row; justify-content: center; align-items: flex-start; }
  .pilier { width: 30%; max-width: none; }
  .pilier + .pilier { margin-top: 0; margin-left: 5%; }
  .piliers__grille.en-paquet .pilier:nth-child(1) { --x: 116.67%; --y: 0%; --r: -5deg; }
  .piliers__grille.en-paquet .pilier:nth-child(2) { --x: 2%; --r: 3deg; }
  .piliers__grille.en-paquet .pilier:nth-child(3) { --x: -116.67%; --y: -1%; --r: -1deg; }
}

/* Une carte reste invisible tant que son SVG n'est pas chargé : sinon on aperçoit son contour seul */
.js .pilier img { opacity: 0; transition: opacity 250ms ease-out; }
.js .pilier img.charge { opacity: 1; }
/* Pose du paquet au chargement sans animation */
.piliers__grille.sans-transition .pilier { transition: none !important; }

/* Pendant l'étalement, les cartes partent l'une après l'autre */
.piliers__grille.etalement .pilier:nth-child(2) { transition-delay: 120ms; }
.piliers__grille.etalement .pilier:nth-child(3) { transition-delay: 240ms; }

@media (hover: hover) {
  .piliers__grille:not(.en-paquet) .pilier:hover { --y: -20px; --s: 1.04; z-index: 5; transition-duration: 450ms; }
}
@media (prefers-reduced-motion: reduce) { .pilier { transition: none; } }

.piliers .entete + .piliers__grille { margin-top: var(--s-32); }
.piliers__phrase { display: grid; gap: var(--s-16); justify-items: center; text-align: center; margin-top: var(--s-96); margin-inline: auto; max-width: 44rem; }
.piliers__phrase h2, .piliers__phrase h3 { text-wrap: balance; }
.piliers__phrase h2 { font-size: clamp(2rem, 4.4vw, 3.5rem); }
.piliers__phrase h3 { margin: 0; font-size: var(--t-chapo); font-weight: 500; letter-spacing: -0.01em; line-height: 1.4; }
@media (min-width: 60rem) { .piliers__phrase { margin-top: var(--s-128); } }

/* Réouverture */
.retour h2 { font-size: var(--t-h2); max-width: 14em; }
.retour__corps { display: grid; gap: var(--s-48); margin-top: var(--s-64); }
.retour__corps p { font-size: var(--t-chapo); line-height: 1.45; max-width: 30em; }
.retour__corps .lien { font-weight: 700; justify-self: start; padding-block: var(--s-8); }
.retour__corps .lien:hover { text-decoration-color: currentColor; text-decoration-thickness: 3px; }
@media (min-width: 60rem) { .retour__corps { margin-top: var(--s-96); } }

/* Formulaire */
.contact__grille { display: grid; gap: var(--s-64); }
@media (min-width: 60rem) {
  .contact__grille { grid-template-columns: repeat(12, 1fr); }
  .contact__grille .entete { grid-column: 1 / span 5; margin-bottom: 0; align-self: start; }
  .contact__zone { grid-column: 7 / span 6; }
}
.contact__zone { min-width: 0; }
/* Titre du formulaire : deux lignes au plus */
.contact .entete h2 { font-size: clamp(2.25rem, 4.4vw, 3.75rem); text-wrap: balance; }

.form { display: grid; gap: var(--s-32); }
.form__duo { display: grid; gap: var(--s-32); }
@media (min-width: 40rem) { .form__duo { grid-template-columns: 1fr 1fr; align-items: start; } }

.champ { display: grid; gap: var(--s-8); min-width: 0; align-content: start; }
.champ label, .champ legend { font-weight: 500; }
.champ .facultatif { font-weight: 400; }

.champ input, .champ textarea {
  width: 100%;
  font: inherit;
  color: var(--bleu);
  background: transparent;
  border: 1.5px solid var(--bleu);
  border-radius: var(--radius-champ);
  padding: 0.875rem 1rem;
  min-height: 3.25rem;
  appearance: none;
}
.champ input[type="date"] { color-scheme: dark; }
.champ input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; }
@media (min-width: 40rem) { .champ--demi input { max-width: calc(50% - var(--s-16)); } }
.suggest { position: relative; }
.suggest__liste { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--bleu); color: var(--vert); border-radius: var(--radius-champ); }
.suggest__liste li { padding: 0.75rem 0.875rem; border-radius: calc(var(--radius-champ) - 2px); cursor: pointer; }
.suggest__liste li:hover, .suggest__liste li[aria-selected="true"] { background: var(--vert); color: var(--bleu); }
.aide { font-size: 0.9375rem; }
.champ textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
.champ input:focus-visible, .champ textarea:focus-visible { outline: 2px solid var(--bleu); outline-offset: 3px; border-radius: var(--radius-champ); }
.champ input:-webkit-autofill { -webkit-text-fill-color: var(--bleu); -webkit-box-shadow: 0 0 0 100px var(--vert) inset; }

.champ[aria-invalid="true"] input,
.champ[aria-invalid="true"] textarea { border-width: 3px; }
.erreur { font-size: 0.9375rem; font-weight: 500; }
.erreur:empty { display: none; }

fieldset.champ { border: 0; margin: 0; padding: 0; }
fieldset.champ legend { padding: 0; margin-bottom: var(--s-8); }
.choix { display: flex; flex-wrap: wrap; gap: var(--s-8); }
.choix input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choix label {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  padding: 0.5rem 1.125rem;
  border: 1.5px solid var(--bleu);
  border-radius: var(--radius-pill);
  font-weight: 500; cursor: pointer;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}
.choix input:checked + label { background: var(--bleu); color: var(--vert); }
.choix input:focus-visible + label { outline: 2px solid var(--bleu); outline-offset: 3px; }

.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__envoi { display: grid; gap: var(--s-16); justify-items: start; margin-top: var(--s-16); }
.bouton {
  font: inherit;
  font-size: 1.1875rem; /* 19 px en 700 : grand texte au sens WCAG, utile au survol orange */
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--vert);
  background: var(--bleu);
  border: 0;
  border-radius: var(--radius-pill);
  min-height: 3.5rem;
  padding: 0.875rem 2rem;
  cursor: pointer;
  transition: background-color 160ms ease-out;
}
.bouton:hover:not([disabled]) { background: var(--orange); }
.bouton:focus-visible { outline: 2px solid var(--bleu); outline-offset: 3px; border-radius: var(--radius-pill); }
.bouton[disabled] { cursor: progress; }
.form__mention { font-size: 0.9375rem; }

.statut { font-weight: 500; }
.statut:empty { display: none; }

.merci { display: grid; gap: var(--s-24); }
.merci h3 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.merci p { font-size: var(--t-chapo); line-height: 1.45; max-width: 26em; }
.merci:focus { outline: none; }

/* Pied de page */
.site-footer { border-top: 1px solid var(--bleu); padding-block: var(--s-96) var(--s-64); }
.footer__grille { display: grid; gap: var(--s-48); }
.footer__grille img { width: 9rem; }
.footer__infos { display: grid; gap: var(--s-16); font-style: normal; }
.footer__bas { margin-top: var(--s-96); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-16); font-size: 0.9375rem; }
@media (min-width: 60rem) {
  .footer__grille { grid-template-columns: repeat(12, 1fr); align-items: start; }
  .footer__grille .logo { grid-column: 1 / span 4; }
  .footer__infos { grid-column: 6 / span 7; }
}

/* Mentions légales */
.legal h1 { font-size: var(--t-h2); margin-bottom: var(--s-64); }
.legal__liste { display: grid; gap: var(--s-48); max-width: 44rem; }
.legal__bloc { display: grid; gap: var(--s-8); }
.legal__bloc h2 { font-size: 1.375rem; letter-spacing: -0.02em; line-height: 1.2; }
.legal__bloc p { max-width: 40em; }
.a-completer { font-weight: 700; }
.hero--intro .hero__contact:focus-visible, .hero--intro .hero__suite:focus-visible { opacity: 1; }

/* Apparition des textes : fondu et légère remontée quand ils arrivent à l'écran (classes posées par le JS) */
.apparait {
  opacity: 0; transform: translateY(18px);
  transition: opacity 700ms ease-out, transform 700ms cubic-bezier(.22, 1, .36, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.apparait.vu { opacity: 1; transform: none; }

/* Page 404 */
.introuvable .wrap { display: grid; gap: var(--s-32); justify-items: start; }
.introuvable h1 { font-size: var(--t-h2); max-width: 14em; }
.introuvable__texte { font-size: var(--t-chapo); line-height: 1.45; max-width: 30em; }
.introuvable .lien { font-weight: 700; padding-block: var(--s-8); }

/* Métier sous le logo de fin d'animation : un filet court puis « plombier chauffagiste », centrés.
   --u vaut 1 % de la largeur du logo (posé par le JS), tout est proportionnel au logo. */
.hero__metier {
  position: absolute; z-index: 2; left: 0; top: 0; pointer-events: none;
  width: calc(var(--u, 4px) * 100);
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--u, 4px) * 6);
  opacity: var(--logo, 1);
}
.hero__metier-filet {
  display: block; width: calc(var(--u, 4px) * 13); height: max(1.5px, calc(var(--u, 4px) * .3));
  background: var(--bleu);
  transform: scaleX(0); transition: transform 800ms cubic-bezier(.22, 1, .36, 1);
}
.hero__metier-texte {
  margin: 0; white-space: nowrap; color: var(--bleu);
  font-size: max(14px, calc(var(--u, 4px) * 3.7)); font-weight: 500; letter-spacing: 0.04em; line-height: 1;
  opacity: 0; transform: translateY(8px);
  transition: opacity 700ms ease-out 150ms, transform 700ms cubic-bezier(.22, 1, .36, 1) 150ms;
}
.hero__metier.visible .hero__metier-filet { transform: none; }
.hero__metier.visible .hero__metier-texte { opacity: 1; transform: none; }
.hero__metier:not(.place) { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .hero__metier-filet, .hero__metier-texte { transition: none; } }

/* Réouverture : vagues vertes dans les angles, même taille et même entrée en diagonale que le hero */
.retour { position: relative; overflow: hidden; }
.retour .wrap { position: relative; z-index: 1; }
.retour__vague {
  position: absolute; pointer-events: none;
  width: clamp(84px, 15.4vw, 252px); height: auto;
  transition: transform 1200ms cubic-bezier(.22, 1, .36, 1) 150ms;
}
.retour__vague--haut { top: 0; left: 0; }
.retour__vague--bas { right: 0; bottom: 0; transform: rotate(180deg); transition-delay: 300ms; }
@media (max-width: 40rem) { .retour__vague { width: 26.6vw; } }
.js .retour:not(.vagues-in) .retour__vague--haut { transform: translate(-105%, -105%); }
.js .retour:not(.vagues-in) .retour__vague--bas { transform: rotate(180deg) translate(-105%, -105%); }
@media (prefers-reduced-motion: reduce) { .retour__vague { transition: none; } }
