/* =========================================================
   PUR — Laveur de vitres éco-responsable
   ========================================================= */

:root {
  --accent: #5B6A22;
  --accent-dark: #2F3A10;
  --link: #4E5C1C;

  --bg: #F3F5EF;
  --bg-alt: #E6EBDD;
  --surface: #FFFFFF;
  --field: #F7F8F4;

  --ink: #1E2618;
  --ink-2: #2E3826;
  --ink-3: #3B4630;
  --muted: #4A5442;

  --line: #D5DBCB;
  --line-strong: #C9D0BD;

  --quote-leaf: #A9B86A;
  --quote-em: #C3D08A;

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-card: 22px;
  --container: 1200px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

h1, h2, h3, p { margin: 0; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.muted { color: var(--muted); }

.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon--accent { stroke: var(--accent); stroke-width: 1.6; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font: 600 17px var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }
.btn--ghost { background: rgba(255,255,255,.8); color: var(--ink); }
.btn--ghost:hover { background: #fff; color: var(--ink); }
.btn--outline { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.btn--outline:hover { background: var(--accent); color: #fff; }
.btn--sm { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn--block { width: 100%; min-height: 56px; }

/* ---------- Header ---------- */
.site-header {
  padding-block: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand__logo { fill: var(--accent); }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--accent);
}
.brand__tag {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
}
.nav > a:not(.btn) {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
}
.nav > a:not(.btn):hover { color: var(--accent); }

/* ---------- Hero : la vraie photo, embuée, qu'on essuie ---------- */
.hero-wrap { padding: 0 16px; }

.hero {
  position: relative;
  max-width: 1408px;
  height: 720px;
  margin: 0 auto;
  border-radius: 28px;
  overflow: hidden;
  border: 14px solid #fff;
  box-shadow: 0 30px 60px -30px rgba(30,38,24,.35);
  isolation: isolate;
  background: var(--bg-alt);
}
/* Calques, du fond vers l'avant :
   photo nette → buée (canvas) → gouttes → voile de lisibilité → texte → raclette → astuce */
.hero__photo,
.hero__fog,
.hero__drops {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero__photo {
  object-fit: cover;
  object-position: 60% 50%;   /* gardé en phase avec la buée dans js/main.js */
  z-index: 0;
}
.hero__fog { z-index: 1; touch-action: pan-y; cursor: grab; }
.hero.is-wiping .hero__fog { cursor: none; }
.hero__drops { z-index: 2; pointer-events: none; }

/* Voile clair côté texte pour la lisibilité */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(243,245,239,.9) 0%,
    rgba(243,245,239,.72) 34%,
    rgba(243,245,239,.15) 58%,
    rgba(243,245,239,0) 70%);
}

.hero__content {
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: clamp(28px, 6vw, 80px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  pointer-events: none;        /* la vitre reste « essuyable » sous le texte */
}
.eyebrow {
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.hero__title {
  max-width: 620px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(46px, 7vw, 92px);
  line-height: .98;
  letter-spacing: -.01em;
}
.hero__lead { max-width: 500px; font-size: 18px; color: var(--ink-2); }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; pointer-events: auto; }

.hero__hint {
  position: absolute;
  right: 28px;
  bottom: 28px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(30,38,24,.82);
  color: var(--bg);
  font-size: 14px;
  pointer-events: none;
  transition: opacity .5s, transform .5s;
}
.hero__hint.is-hidden { opacity: 0; transform: translateY(8px); }

/* La raclette */
.squeegee {
  position: absolute;
  top: 0; left: 0;
  width: 190px;
  height: 230px;
  margin: -24px 0 0 -95px;      /* le centre de la lame = le pointeur */
  transform-origin: 95px 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
  will-change: transform;
  z-index: 5;
  filter: drop-shadow(0 10px 14px rgba(30,38,24,.25));
}
.hero.is-wiping .squeegee { opacity: 1; }

@media (max-width: 760px) {
  .hero { height: 720px; border-width: 10px; border-radius: 22px; }
  .hero__photo { object-position: 55% 50%; }
  .hero::after {
    background: linear-gradient(180deg,
      rgba(243,245,239,.92) 0%,
      rgba(243,245,239,.8) 52%,
      rgba(243,245,239,.15) 78%,
      rgba(243,245,239,0) 100%);
  }
  .hero__hint { left: 16px; right: 16px; bottom: 16px; justify-content: center; }
}

/* ---------- Galerie : un coup de raclette à l'apparition ---------- */
.section.galerie { padding-top: 20px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: clamp(300px, 34vw, 440px);
  gap: 20px;
}
.shot {
  position: relative;
  margin: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-alt);
  border: 8px solid #fff;
  box-shadow: 0 20px 40px -28px rgba(30,38,24,.45);
}
.shot--wide { grid-column: span 2; }
/* Photo vedette (avant / après) : toute la largeur, en 16:9 */
.gallery { grid-template-rows: auto; }
.shot--feature { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shot figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(30,38,24,.78);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  z-index: 3;
}

/* Buée + raclette : créées par le JS (rien sans JS ni avec « réduire les animations ») */
:root { --sweep: .9s cubic-bezier(.6, 0, .3, 1); }

/* La buée = une copie floutée de la photo, posée par-dessus la photo nette.
   Elle est vue à travers une « fenêtre » (.shot__fog) qui glisse avec la raclette,
   pendant que son contenu (.shot__fog-inner) glisse en sens inverse pour rester immobile.
   Résultat : la photo devient nette exactement derrière la lame. */
.shot__fog {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.shot__fog-inner {
  position: absolute;
  inset: 0;
  background: var(--bg-alt);
}
.shot__fog-inner img {
  filter: blur(14px) saturate(.6);
  transform: scale(1.1);            /* masque les bords transparents du flou */
}
.shot__fog-inner::after {           /* voile blanc de la buée */
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(236,241,236,.45);
}
/* La piste traverse toute la photo ; la raclette est posée dessus */
.shot__track {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}
.shot__squeegee {
  position: absolute;
  top: -4%;
  bottom: -4%;
  left: 0;
  width: 16px;
  margin-left: -8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #D9DDD6, #9AA197 45%, #B9C0B6 55%, #F4F6F3);
  border: 1px solid #7D857A;
  box-shadow: 0 0 0 1px rgba(255,255,255,.4), 0 8px 18px rgba(30,38,24,.3);
}
.shot__squeegee::before {          /* lame caoutchouc, côté avant */
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  right: -6px;
  width: 5px;
  border-radius: 3px;
  background: #1A1D18;
}
.shot__squeegee::after {           /* manche, qui traîne derrière */
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  width: 110px;
  height: 18px;
  margin-top: -9px;
  border-radius: 9px;
  background: linear-gradient(180deg, #3F4A17, #6E7F2B 40%, #3F4A17);
  box-shadow: 0 6px 12px rgba(30,38,24,.3);
}
.shot--rtl .shot__squeegee { left: 100%; }
.shot--rtl .shot__squeegee::before { right: auto; left: -6px; }
.shot--rtl .shot__squeegee::after { right: auto; left: 100%; }

/* Étiquettes « Avant / Après » posées sur la photo (position en % dans le HTML) */
.compare-tag {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  box-shadow: 0 8px 20px -8px rgba(30,38,24,.45);
  pointer-events: none;
}
.compare-tag::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.compare-tag--after::before  { background: var(--accent); box-shadow: 0 0 0 3px rgba(91,106,34,.2); }
.compare-tag--before::before { background: #9C8462; box-shadow: 0 0 0 3px rgba(156,132,98,.22); }
/* Avec l'animation : elles apparaissent juste après le passage de la raclette */
.shot:has(.shot__fog) .compare-tag { opacity: 0; }
.shot.is-clean .compare-tag { animation: tag-in .45s ease-out .8s both; }
.shot.is-clean .compare-tag--before { animation-delay: .95s; }
@keyframes tag-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Le passage : une seule fois, quand la photo arrive à l'écran */
/* (mêmes durée et courbe partout → la buée et la lame restent parfaitement alignées) */
.shot.is-clean .shot__fog       { animation: slide-right var(--sweep) both; }
.shot.is-clean .shot__fog-inner { animation: slide-left var(--sweep) both; }
.shot.is-clean .shot__track     { animation: sweep-ltr var(--sweep) both; }
.shot--rtl.is-clean .shot__fog       { animation-name: slide-left; }
.shot--rtl.is-clean .shot__fog-inner { animation-name: slide-right; }
.shot--rtl.is-clean .shot__track     { animation-name: sweep-rtl; }

@keyframes slide-right { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes slide-left  { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes sweep-ltr {
  0%   { transform: translateX(0);    opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}
@keyframes sweep-rtl {
  0%   { transform: translateX(0);     opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateX(-100%); opacity: 0; }
}

@media (max-width: 760px) {
  .gallery { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 16px; }
  .shot--wide, .shot--feature { grid-column: auto; aspect-ratio: 4 / 3; }
  .compare-tag { font-size: 13px; padding: 4px 11px 4px 9px; gap: 6px; }
  .compare-tag::before { width: 7px; height: 7px; }
  .shot--tall { aspect-ratio: 4 / 5; }
  .shot { border-width: 6px; }
  .shot__squeegee::after { width: 70px; }
}

/* ---------- Sections ---------- */
.section { padding-block: 110px; }
#methode { padding-block: 120px 100px; }

.h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.02;
}
.section__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 56px;
}
.section__head .h2 { max-width: 560px; }
.section__head p { max-width: 420px; }
.section__title { margin-bottom: 48px; }

.grid { display: grid; gap: 24px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card__num {
  font-family: var(--serif);
  font-size: 64px;
  line-height: 1;
  color: var(--accent);
}
.card h3 { font-size: 21px; font-weight: 600; }

.service {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.service h3 { font-size: 20px; font-weight: 600; }
.service p { font-size: 16px; }
.service__price { margin-top: auto; font-size: 14px; font-weight: 600; color: var(--accent); }

/* Citation */
.quote { background: var(--ink); color: var(--bg); padding: 110px 0; }
.quote__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; }
.quote__logo { fill: var(--quote-leaf); flex: none; }
.quote__text {
  flex: 1 1 520px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 5.2vw, 68px);
  line-height: 1.05;
}
.quote__text em { color: var(--quote-em); }

/* ---------- Devis ---------- */
.devis { background: var(--bg-alt); padding: 110px 0; }
.devis__inner { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; }
.devis__intro { flex: 1 1 340px; display: flex; flex-direction: column; gap: 22px; }

.contact { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.contact li, .contact a { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.contact a { color: var(--ink); text-decoration: none; }
.contact a:hover { color: var(--accent); }

.devis__card {
  flex: 1 1 520px;
  min-width: 0;
  background: var(--surface);
  border-radius: 26px;
  padding: clamp(24px, 4vw, 44px);
  box-shadow: 0 24px 50px -30px rgba(30,38,24,.4);
}

.form { display: flex; flex-direction: column; gap: 26px; }
.form__row { display: flex; flex-wrap: wrap; gap: 26px 16px; }

.field { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.field legend, .field__label { padding: 0; margin-bottom: 12px; font-weight: 600; font-size: 15px; }
.field__label { margin-bottom: 0; }
.field--counter { flex: 1 1 200px; }
.field--freq { flex: 1 1 240px; }
.field--input { flex: 1 1 220px; gap: 8px; font-weight: 600; font-size: 15px; }
.field__hint { font-weight: 400; color: var(--muted); font-size: 14px; }

.field input, .field textarea {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line-strong);
  background: var(--field);
  font: 400 16px var(--sans);
  color: var(--ink);
  width: 100%;
}
.field textarea { padding: 14px 16px; line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
.field input[aria-invalid="true"] { border-color: #A23B2A; }

.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 500 15px var(--sans);
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.pill:hover { border-color: var(--accent); }
.pill[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }

.counter { display: flex; align-items: center; gap: 14px; }
.counter__btn {
  width: 48px; height: 48px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-size: 22px;
  color: var(--ink);
  cursor: pointer;
}
.counter__btn:hover { border-color: var(--accent); }
.counter__value {
  min-width: 56px;
  text-align: center;
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1;
  font-weight: 600;
}

.form__error { color: #A23B2A; font-weight: 500; font-size: 15px; }

.sent { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: 24px 0; }
.sent[hidden], .form[hidden] { display: none; }
.sent__logo { fill: var(--accent); }
.sent__title { font-family: var(--serif); font-size: 44px; line-height: 1.05; font-weight: 600; }
.sent__title:focus { outline: none; }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 48px 56px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
}
.site-footer__brand { font-family: var(--serif); font-size: 22px; color: var(--accent); letter-spacing: .04em; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Page simple (mentions légales) ---------- */
.page { padding-block: 60px 100px; max-width: 760px; }
.page h1 { font-family: var(--serif); font-size: clamp(40px, 6vw, 64px); line-height: 1; margin-bottom: 40px; }
.page h2 { font-size: 20px; margin: 36px 0 10px; }
.page p { color: var(--muted); }
