/* ===================================================
   G.D NETTOYAGE - ui.css
   Styles communs des pages refaites (accueil, services,
   zone, avis, contact). À charger après styles.css.
   Motif : la raclette. Une lame fine qui essuie, qui sépare
   l'avant de l'après et qui souligne les titres.
   =================================================== */

.ui {
  --ink: #1e2947;
  --ink-soft: #4d5873;
  --aqua: #63c5c7;
  --aqua-deep: #237f82;
  --mist: #eef4f5;
  --line: #d6e1e4;
  --radius: 20px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-wipe: cubic-bezier(0.65, 0, 0.35, 1);
  font-size: 1.0625rem;
  color: var(--ink);
  background: #fff;
}

/* Lenis gère le défilement doux : on coupe le smooth natif */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ui :focus-visible {
  outline: 2px solid var(--aqua-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===================================================
   EN-TÊTE CLAIR
   =================================================== */
/* logo-header.png : 500x500, dessin de 405x66 px à (47, 217) sur fond transparent.
   On l'agrandit à 51,5 % et on cadre sur le dessin (hauteur 34 px). */
.ui .header .logo {
  display: block;
  width: 209px;
  height: 34px;
  overflow: hidden;
  border-radius: 0;
}
.ui .header .logo img {
  width: 258px;
  max-width: none;
  height: auto;
  margin: -112px 0 0 -24px;
  border-radius: 0;
}

.ui .header .nav-link { color: var(--ink-soft); }
.ui .header .nav-link:hover { color: var(--ink); background: transparent; }
.ui .header .nav-link::after { background: var(--aqua); }
/* Page en cours : texte bleu turquoise foncé + trait turquoise dessous */
.ui .header .nav-link.active { color: var(--aqua-deep); font-weight: 600; background: transparent; }
.ui .burger span { background: var(--ink); }
.ui .burger:hover { background: var(--mist); }
.ui .header.scrolled {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 1px 0 var(--line);
}

.ui .mobile-nav {
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 20px 40px rgba(30, 41, 71, 0.08);
}
.ui .mobile-nav a { color: var(--ink); border-bottom-color: var(--line); }
.ui .mobile-nav a:hover,
.ui .mobile-nav a.active { color: var(--aqua-deep); font-weight: 600; }

/* ===================================================
   STRUCTURE ET TYPOGRAPHIE
   =================================================== */
.h-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.h-section { padding: clamp(72px, 10vw, 128px) 0; }
.h-tint { background: var(--mist); }

.h-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 56px); }
.h-head-row {
  max-width: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.h-title {
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 16px;
  text-wrap: balance;
}

.h-sub {
  color: var(--ink-soft);
  line-height: 1.65;
  max-width: 56ch;
}

.h-link {
  display: inline-block;
  font-weight: 600;
  color: var(--ink);
  padding-bottom: 3px;
  background: linear-gradient(var(--aqua), var(--aqua)) 0 100% / 100% 2px no-repeat;
  transition: background-size 0.45s var(--ease-out), color 0.2s;
}
.h-link:hover { background-size: 35% 2px; color: var(--aqua-deep); }

/* ---------- Boutons ---------- */
.h-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out),
              border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.h-btn:active { transform: scale(0.98); }
.h-btn svg { width: 18px; height: 18px; flex: none; }
.h-btn-solid { background: var(--ink); color: #fff; }
.h-btn-solid:hover { background: #2b3860; }
.h-btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.h-btn-ghost:hover { border-color: var(--ink); }

/* ===================================================
   APPARITION DES TITRES AU CHARGEMENT
   =================================================== */
.h-line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.h-line > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1.1s var(--ease-out);
}
.h-line:nth-child(2) > span { transition-delay: 0.08s; }
.h-line:nth-child(3) > span { transition-delay: 0.16s; }

.h-fade {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s var(--ease-out) 0.35s, transform 0.9s var(--ease-out) 0.35s;
}
.h-fade + .h-fade { transition-delay: 0.45s; }

.is-loaded .h-line > span { transform: none; }
.is-loaded .h-fade { opacity: 1; transform: none; }

/* ===================================================
   EN-TÊTE DES PAGES INTÉRIEURES
   =================================================== */
.p-hero {
  padding: calc(var(--header-h) + clamp(40px, 7vw, 96px)) 0 clamp(48px, 7vw, 88px);
}
.p-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
}
.p-hero-title {
  font-size: clamp(2.5rem, 5.6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.p-hero-lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 44ch;
}

/* Le coup de raclette sous l'en-tête */
.p-hero-blade {
  position: relative;
  height: 1px;
  margin-top: clamp(40px, 6vw, 72px);
  background: var(--line);
}
.p-hero-blade::before,
.p-hero-blade::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.4s var(--ease-wipe) 0.3s;
}
.p-hero-blade::before { top: -2px; height: 4px; background: var(--ink); }
.p-hero-blade::after { top: 2px; height: 2px; background: var(--aqua); transition-delay: 0.36s; }
.is-loaded .p-hero-blade::before,
.is-loaded .p-hero-blade::after { transform: scaleX(1); }

/* ===================================================
   COMPARATEUR AVANT / APRÈS
   =================================================== */
.h-compare {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--mist);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: ew-resize;
  clip-path: inset(5% 5% 5% 5% round var(--radius));
  transition: clip-path 1.3s var(--ease-out);
}
.h-compare.in-view { clip-path: inset(0 0 0 0 round var(--radius)); }
.h-compare.is-portrait { aspect-ratio: 3 / 4; }

.h-compare-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}
.h-compare-before {
  position: absolute; inset: 0;
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
  pointer-events: none;
}

.h-tag {
  position: absolute;
  top: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  pointer-events: none;
  transition: opacity 0.3s;
}
.h-tag-before { left: 16px; }
.h-tag-after { right: 16px; }
.h-compare[data-side="after"] .h-tag-before,
.h-compare[data-side="before"] .h-tag-after { opacity: 0; }

/* La lame */
.h-blade {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6), 0 6px 18px rgba(30, 41, 71, 0.25);
}
.h-blade::after {
  content: '';
  position: absolute;
  background: var(--aqua);
}
.h-blade-y {
  top: 0; bottom: 0;
  left: var(--pos, 50%);
  width: 4px;
  transform: translateX(-50%);
}
.h-blade-y::after { top: 0; bottom: 0; right: -3px; width: 3px; }

.h-grip {
  position: absolute;
  top: 50%; left: 50%;
  width: 48px; height: 48px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 16px rgba(30, 41, 71, 0.28);
  transition: transform 0.3s var(--ease-out);
}
.h-grip::before,
.h-grip::after {
  content: '';
  position: absolute;
  top: 50%;
  border: 6px solid transparent;
  transform: translateY(-50%);
}
.h-grip::before { left: 9px; border-right-color: var(--ink); }
.h-grip::after { right: 9px; border-left-color: var(--ink); }
.h-compare.is-dragging .h-grip { transform: translate(-50%, -50%) scale(1.12); }

/* Le range reste utilisable au clavier, invisible à l'œil */
.h-compare-range {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}
.h-compare:has(.h-compare-range:focus-visible) .h-grip {
  outline: 2px solid var(--aqua-deep);
  outline-offset: 3px;
}

.h-compare-caption {
  margin-top: 14px;
  font-weight: 600;
}
.h-compare-caption span { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.95rem; }

/* ===================================================
   PHOTOS : OUVERTURE AU DÉFILEMENT
   =================================================== */
.h-reveal-img {
  clip-path: inset(100% 0 0 0 round var(--radius));
  transition: clip-path 1.4s var(--ease-wipe);
}
.h-reveal-img.in-view { clip-path: inset(0 0 0 0 round var(--radius)); }

/* ===================================================
   CITATION
   =================================================== */
.h-quote { margin: 0 0 32px; }
.h-quote p {
  font-size: clamp(1.4rem, 2.6vw, 2.05rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 20px;
  text-wrap: pretty;
}
.h-quote footer { color: var(--ink-soft); }

/* ===================================================
   BANDEAU D'APPEL
   =================================================== */
.h-call {
  background: var(--ink);
  color: #fff;
  padding: clamp(80px, 11vw, 144px) 0;
}
.h-call-title {
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 12px;
}
.h-call-number {
  display: inline-block;
  font-size: clamp(2.8rem, 10vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: linear-gradient(var(--aqua), var(--aqua)) 0 100% / 0% 6px no-repeat;
  padding-bottom: 10px;
  transition: background-size 0.7s var(--ease-out);
}
.h-call-number:hover { background-size: 100% 6px; }
.h-call-alt { margin-top: 28px; color: rgba(255, 255, 255, 0.7); }
.h-call-alt a { color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.35); }
.h-call-alt a:hover { border-color: var(--aqua); }
.ui .h-call :focus-visible { outline-color: var(--aqua); }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 968px) {
  .p-hero-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ===================================================
   MOUVEMENT RÉDUIT
   =================================================== */
@media (prefers-reduced-motion: reduce) {
  .h-line > span, .h-fade { transform: none !important; opacity: 1 !important; transition: none !important; }
  .p-hero-blade::before, .p-hero-blade::after { transform: scaleX(1); transition: none; }
  .h-compare, .h-reveal-img { clip-path: none !important; transition: none !important; }
}
