/* ==========================================================================
   Salva Terra Service — pages chantiers
   Vidéo pilotée par le défilement, fiche chantier, avant / après,
   récit avant / pendant / après, galerie, chantier suivant.
   ========================================================================== */

/* ---------- Éléments communs de l'ouverture ---------- */
.case-top { display: flex; align-items: center; gap: 16px; margin-bottom: 30px; }
.case-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 16px 0 12px;
  border: 1px solid rgb(var(--text-rgb) / 0.22);
  border-radius: var(--radius-pill);
  background: rgb(var(--bg-rgb) / 0.3);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.3s, background-color 0.3s, color 0.3s;
}
.case-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s var(--ease-out); }
.case-back:hover { border-color: var(--text); background: var(--text); color: var(--bg); }
.case-back:hover svg { transform: translateX(-4px); }
.case-index { color: rgb(255 255 255 / 0.88); font-size: 13px; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; text-shadow: 0 1px 10px rgb(0 0 0 / 0.55); }

.case-title {
  margin: 0 0 20px;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 320;
  font-size: clamp(2.6rem, 1.3rem + 4.2vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.024em;
  text-wrap: balance;
}
.case-sub { max-width: 46ch; margin-bottom: 22px; color: var(--text); font-size: clamp(1rem, 0.94rem + 0.3vw, 1.16rem); line-height: 1.5; }
.case-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; }
.case-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  background: rgb(var(--text-rgb) / 0.1);
  color: var(--text);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}
.case-chip svg { width: 11px; height: 11px; fill: var(--highlight); }

.case-cue { display: inline-flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 13px; }
.case-cue__line { position: relative; width: 44px; height: 1px; overflow: hidden; background: rgb(var(--text-rgb) / 0.25); }
.case-cue__line::after { content: ''; position: absolute; inset: 0; background: var(--highlight); animation: cue-x 2.2s var(--ease-in-out) infinite; }
@keyframes cue-x { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- Ouverture : vidéo pilotée par le défilement ---------- */
.case-video { position: relative; height: var(--h, 500vh); background: var(--bg); }
.case-video__stage {
  position: sticky;
  top: 0;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 110px);
  height: 100vh;
  height: 100svh;
  padding: 104px max(var(--gutter), calc((100% - var(--max)) / 2)) 36px;
  overflow: hidden;
}
/* Reflet flou de la vidéo, en fond */
.case-video__bg { position: absolute; inset: -6%; z-index: -2; width: 112%; height: 112%; opacity: 0.6; }
.case-video__stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgb(var(--bg-rgb) / 0.94) 0%, rgb(var(--bg-rgb) / 0.78) 42%, rgb(var(--bg-rgb) / 0.45) 100%),
    linear-gradient(180deg, rgb(var(--bg-rgb) / 0.4) 0%, transparent 30%, transparent 70%, rgb(var(--bg-rgb) / 0.8) 100%);
}
.case-video__text { position: relative; max-width: 580px; }

/* Étapes : le texte de l'étape en cours se déplie, un filet suit sa progression */
.case-steps { display: grid; margin: 0 0 30px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.case-step {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  transition: color 0.5s;
}
.case-step::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--highlight);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
}
.case-step__n { padding-top: 5px; font-size: 13px; font-variant-numeric: tabular-nums; }
.case-step__title {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.45rem);
  line-height: 1.25;
  transition: margin 0.6s var(--ease-out);
}
.case-step__text { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.6s var(--ease-out); }
.case-step__text > span { overflow: hidden; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.case-step.is-active { color: var(--text); }
.case-step.is-active .case-step__title { margin-bottom: 6px; }
.case-step.is-active .case-step__text { grid-template-rows: 1fr; }

/* Cadre de la vidéo (format portrait 9:16) */
.case-video__frame {
  position: relative;
  height: min(calc(100svh - 150px), 820px);
  aspect-ratio: 9 / 16;
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 50px 90px -40px rgb(0 0 0 / 0.75), 0 0 0 1px rgb(var(--text-rgb) / 0.1);
}
.case-video__poster, .case-video__canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.case-video__canvas { opacity: 0; transition: opacity 0.5s; }
.case-video.is-ready .case-video__canvas { opacity: 1; }
.case-video__bar { position: absolute; left: 18px; right: 18px; bottom: 16px; height: 2px; overflow: hidden; border-radius: 2px; background: rgb(255 255 255 / 0.28); }
.case-video__bar span { display: block; height: 100%; background: var(--white); transform: scaleX(0); transform-origin: left; }

/* ---------- Ouverture : grande photo (chantiers sans vidéo) ---------- */
.case-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding: 140px 0 clamp(56px, 9vh, 104px);
  overflow: hidden;
  background: var(--bg);
}
.case-hero__media { position: absolute; inset: 0; z-index: -2; }
.case-hero__media img { position: absolute; inset: -8% 0; width: 100%; height: 116%; max-width: none; object-fit: cover; }
.case-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgb(var(--shade-rgb) / 0.6) 0%, rgb(var(--shade-rgb) / 0.08) 28%, rgb(var(--shade-rgb) / 0.3) 58%, rgb(var(--shade-rgb) / 0.9) 100%);
}
/* Triptyque : trois photos en hauteur côte à côte, qui se dévoilent l'une après l'autre */
.case-hero__media--trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; background: var(--bg); }
.case-hero__cell { position: relative; overflow: hidden; }
.case-hero__cell img { position: absolute; inset: -8% 0; width: 100%; height: 116%; max-width: none; object-fit: cover; }
.js .case-hero--trio .case-hero__cell { animation: trio-in 1.6s var(--ease-out) both; }
.js .case-hero--trio .case-hero__cell:nth-child(2) { animation-delay: 0.12s; }
.js .case-hero--trio .case-hero__cell:nth-child(3) { animation-delay: 0.24s; }
@keyframes trio-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
.case-hero__content { position: relative; }
.case-hero__content > * { max-width: 820px; }
.case-hero .case-chips { margin-bottom: 0; }
.case-cue--hero { position: absolute; right: var(--gutter); bottom: clamp(56px, 9vh, 104px); }

/* ---------- Le projet ---------- */
.case-intro__grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.case-intro__text .h2 { max-width: 15ch; margin-bottom: 34px; }
.case-intro__text p { max-width: 58ch; color: var(--text-2); font-size: 17px; line-height: 1.65; }
.case-intro__text p + p { margin-top: 18px; }
.case-intro__text .case-lead { color: var(--text); font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.45rem); line-height: 1.5; }

.case-facts {
  position: sticky;
  top: 110px;
  padding: clamp(24px, 3vw, 38px);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.case-facts__title { margin-bottom: 16px; color: var(--text-3); font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }
.case-facts__list { margin: 0 0 30px; }
.case-fact {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.case-fact::before {
  content: '';
  position: absolute;
  top: -1px; left: 0;
  width: 100%; height: 1px;
  background: var(--highlight);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s var(--ease-out);
}
.case-fact:hover::before { transform: none; }
.case-fact dt { color: var(--text-3); font-size: 14px; transition: color 0.4s; }
.case-fact dd { margin: 0; font-size: 15.5px; line-height: 1.45; transition: transform 0.6s var(--ease-out); }
.case-fact:hover dt { color: var(--highlight); }
.case-fact:hover dd { transform: translateX(4px); }
/* Écrans peu hauts : la fiche défile avec le texte plutôt que d'être coupée */
@media (max-height: 760px) { .case-facts { position: static; } }

/* ---------- En trois temps : le point de départ, le défi, la fierté ---------- */
.case-brief { margin-top: clamp(72px, 10vw, 140px); }
.case-brief__title {
  max-width: 22ch;
  margin: 0 0 clamp(28px, 4vw, 48px);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(1.8rem, 1.2rem + 1.9vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.016em;
  text-wrap: balance;
}
.case-brief__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.case-brief__item { display: flex; }
.brief {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: clamp(300px, 27vw, 380px);
  padding: clamp(24px, 2.6vw, 38px);
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  transition: transform 0.8s var(--ease-out), box-shadow 0.8s var(--ease-out);
}
/* Halo qui suit la souris */
.brief::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(380px circle at var(--mx) var(--my), rgb(var(--text-rgb) / 0.09), transparent 55%);
  opacity: 0;
  transition: opacity 0.5s;
}
/* Filet orange qui se trace au survol */
.brief::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--highlight);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.9s var(--ease-out);
}
.brief:hover { transform: translateY(-8px); box-shadow: 0 34px 60px -38px rgb(var(--shade-rgb) / 0.5); }
.brief:hover::before { opacity: 1; }
.brief:hover::after { transform: none; }
.brief__n {
  margin-bottom: auto;
  padding-bottom: 44px;
  color: transparent;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3.4rem, 2.3rem + 3.2vw, 5.6rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 1px rgb(var(--text-rgb) / 0.34);
  transition: color 0.6s, -webkit-text-stroke-color 0.6s, transform 0.9s var(--ease-out);
}
.brief:hover .brief__n { color: var(--highlight); -webkit-text-stroke-color: transparent; transform: translateX(8px); }
.brief__k { margin: 0 0 12px; color: var(--highlight); font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }
.brief__v {
  max-width: 28ch;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(1.2rem, 1.04rem + 0.5vw, 1.5rem);
  line-height: 1.32;
  text-wrap: pretty;
}
/* La dernière carte, aux couleurs du logo, avec l'emblème en filigrane */
.brief--pride {
  --surface: #9e4a15;
  --text: #fff4e8;              --text-rgb: 255 244 232;
  --highlight: var(--brand-cream);
}
.brief__mark {
  position: absolute;
  right: -22px;
  bottom: -30px;
  z-index: -1;
  width: auto;
  height: 82%;
  opacity: 0.13;
  transform: rotate(-10deg);
  transition: transform 1.4s var(--ease-out), opacity 0.6s;
  pointer-events: none;
}
.brief--pride:hover .brief__mark { opacity: 0.22; transform: rotate(0deg) scale(1.06); }

/* ---------- L'avis Google du client, sous les trois cartes ---------- */
.case-review {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px clamp(20px, 3vw, 44px);
  margin-top: clamp(56px, 8vw, 110px);
  margin-bottom: 0;
}
.case-review__mark {
  grid-row: 1 / span 3;
  color: var(--highlight);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(5rem, 3.6rem + 5vw, 9rem);
  line-height: 0.8;
}
.case-review__k { margin: 0; color: var(--highlight); font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }
.case-review__quote {
  max-width: 36em;
  margin: 6px 0 10px;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-style: italic;
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.85rem);
  line-height: 1.38;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.case-review__quote p + p { margin-top: 0.5em; }
.case-review__by { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--text-2); font-size: 15px; }
.case-review__by b { color: var(--text); font-weight: 600; }
.case-review__stars { display: inline-flex; gap: 3px; }
.case-review__stars svg { width: 15px; height: 15px; fill: var(--highlight); }
@media (max-width: 560px) {
  .case-review { grid-template-columns: 1fr; }
  .case-review__mark { grid-row: auto; font-size: 4.5rem; line-height: 0.6; }
}

/* Pastilles neutres (date, durée) : sans couleur d'accent */
.case-chip--plain { background: transparent; box-shadow: inset 0 0 0 1px rgb(var(--text-rgb) / 0.24); }

/* ---------- Mise en avant : deux photos commentées (nettoyage, dégrisant) ---------- */
.case-duo { background: var(--bg); }
.case-duo__head { text-align: center; }
.case-duo__head .h2, .case-duo__head .lead { margin-inline: auto; }
.duo-list { display: grid; gap: clamp(56px, 8vw, 120px); margin-top: clamp(16px, 3vw, 40px); }
.duo { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: clamp(28px, 4.5vw, 72px); align-items: center; }
.duo:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); }
.duo:nth-child(even) .duo__media { order: 2; }
.duo__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 40px 80px -50px rgb(var(--shade-rgb) / 0.8);
}
.duo__media img { width: 100%; height: 100%; object-fit: cover; transition: scale 1.4s var(--ease-out); }
.duo__media:hover img, .duo__media:focus-visible img { scale: 1.035; }
.duo__tag {
  position: absolute;
  bottom: clamp(12px, 1.6vw, 20px);
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: rgb(var(--shade-rgb) / 0.62);
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.duo__tag--l { left: clamp(12px, 1.6vw, 20px); }
.duo__tag--r { right: clamp(12px, 1.6vw, 20px); background: var(--accent); }
.duo__n {
  display: block;
  margin-bottom: 18px;
  color: transparent;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3.4rem, 2.4rem + 3vw, 5.4rem);
  line-height: 0.9;
  -webkit-text-stroke: 1px rgb(var(--text-rgb) / 0.4);
}
.duo__title { margin: 0 0 14px; font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.5rem); line-height: 1.1; letter-spacing: -0.014em; }
.duo__body { color: var(--text-2); font-size: 17px; line-height: 1.6; }
.duo__note { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 14px; }

/* ---------- Idée reçue : la phrase barrée, puis la réponse ---------- */
.case-myth {
  --text: #fff4e8;              --text-rgb: 255 244 232;
  --text-2: rgb(255 244 232 / 0.86);
  --highlight: var(--brand-cream);
  position: relative;
  overflow: hidden;
  padding: var(--section-y) 0;
  background: #9e4a15;
  color: var(--text);
}
.case-myth::after {
  content: '';
  position: absolute;
  right: -4%;
  bottom: -18%;
  width: min(42vw, 420px);
  aspect-ratio: 171 / 240;
  background: url('../img/embleme.png') center / contain no-repeat;
  opacity: 0.1;
  transform: rotate(-10deg);
  pointer-events: none;
}
.case-myth__inner { position: relative; z-index: 1; max-width: 980px; text-align: center; }
.case-myth__eyebrow { justify-content: center; }
.case-myth__claim {
  margin: 22px 0 6px;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(2rem, 1.1rem + 3.6vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.case-myth__claim s { text-decoration-thickness: 0.07em; text-decoration-color: rgb(var(--shade-rgb) / 0.55); }
.case-myth__verdict { margin: 0 0 28px; font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: clamp(2.6rem, 1.6rem + 4vw, 5.4rem); line-height: 1; color: var(--highlight); }
.case-myth__text { max-width: 62ch; margin: 0 auto; font-size: clamp(17px, 1rem + 0.25vw, 19px); line-height: 1.6; }
.case-myth__text p + p { margin-top: 1em; }

/* ---------- Plusieurs chantiers sur une page : un bloc par chantier ---------- */
.tgroup { --g: clamp(14px, 2vw, 24px); margin-top: clamp(40px, 5vw, 72px); padding-top: clamp(40px, 5vw, 72px); border-top: 1px solid var(--line); }
.tgroup__head { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.1fr); gap: 10px clamp(20px, 3vw, 44px); align-items: end; margin-bottom: clamp(28px, 3.5vw, 48px); }
.tgroup__n { color: transparent; font-family: var(--font-display); font-weight: 300; font-size: clamp(3rem, 2.2rem + 2.6vw, 4.8rem); line-height: 0.85; -webkit-text-stroke: 1px rgb(var(--text-rgb) / 0.34); }
.tgroup__title { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.4rem); line-height: 1.1; letter-spacing: -0.014em; }
.tgroup__place { display: block; margin-top: 8px; color: var(--highlight); font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }
.tgroup__text { max-width: 48ch; color: var(--text-2); }
.tgroup__more { display: flex; width: fit-content; align-items: center; gap: 8px; margin-top: 12px; color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.tgroup__more svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s var(--ease-out); }
.tgroup__more:hover svg { transform: translateX(6px); }
.tgroup__photos { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--g); margin-top: clamp(28px, 3.5vw, 48px); }
.tgroup__photos .shot { margin: 0; }
.tgroup__photos .shot--port { width: min(calc((100% - 2 * var(--g)) / 3), calc(66svh * 9 / 16)); }
.tgroup__photos .shot--land { width: calc((100% - var(--g)) / 2); }
.trelated {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  margin-top: clamp(56px, 7vw, 100px);
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  transition: box-shadow 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.trelated:hover { transform: translateY(-6px); box-shadow: 0 34px 60px -38px rgb(var(--shade-rgb) / 0.5); }
.trelated__media { min-height: 260px; overflow: hidden; }
.trelated__media img { width: 100%; height: 100%; object-fit: cover; transition: scale 1.4s var(--ease-out); }
.trelated:hover .trelated__media img { scale: 1.05; }
.trelated__body { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: clamp(28px, 4vw, 56px); }
.trelated__k { color: var(--highlight); font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }
.trelated__title { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(1.6rem, 1.2rem + 1.3vw, 2.5rem); line-height: 1.1; letter-spacing: -0.014em; }
.trelated__text { max-width: 46ch; color: var(--text-2); }
.trelated__go { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 500; }
.trelated__go .btn__icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s var(--ease-out); }
.trelated:hover .trelated__go .btn__icon { transform: translateX(6px); }

/* ---------- Avant / après ---------- */
.case-compare { background: var(--bg); }
.case-compare__head { text-align: center; }
.case-compare__head .h2, .case-compare__head .lead { margin-inline: auto; }
.compare-grid { display: grid; gap: clamp(20px, 3vw, 40px); }
.compare-grid--2, .compare-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compare-grid--4 .compare__frame { width: min(100%, calc(70svh * 9 / 16)); }
/* trois comparateurs par ligne (page entretien : plusieurs terrasses) */
.compare-grid--3, .compare-grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compare-grid--3 .compare__frame, .compare-grid--6 .compare__frame { width: min(100%, calc(66svh * 9 / 16)); }
.compare-grid--wide { max-width: 1100px; margin-inline: auto; }
.compare-grid .compare__frame--wide { width: 100%; aspect-ratio: 16 / 9; }
.compare { margin: 0; }
.compare__frame {
  --xv: 50;
  position: relative;
  width: min(100%, calc(82svh * 9 / 16));
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.compare__frame img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; pointer-events: none; }
.compare__before { clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.compare__line {
  position: absolute;
  top: 0; bottom: 0; left: var(--x);
  width: 2px;
  margin-left: -1px;
  background: var(--white);
  box-shadow: 0 0 14px rgb(0 0 0 / 0.35);
  pointer-events: none;
}
.compare__knob {
  position: absolute;
  top: 50%; left: 50%;
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: var(--white);
  color: #1a1613;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.35);
  transition: transform 0.5s var(--ease-out), background-color 0.35s, color 0.35s;
}
.compare__knob svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.compare__frame:hover .compare__knob { transform: scale(1.14); background: var(--accent); color: var(--white); }
.compare__frame.is-dragging .compare__knob { transform: scale(0.92); }
.compare__frame:has(.compare__range:focus-visible) .compare__knob { outline: 2px solid var(--white); outline-offset: 4px; }
.compare__tag {
  position: absolute;
  top: 16px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: rgb(var(--shade-rgb) / 0.6);
  color: var(--white);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  pointer-events: none;
}
.compare__tag--before { left: 16px; opacity: clamp(0, calc((var(--xv) - 16) / 10), 1); }
.compare__tag--after { right: 16px; opacity: clamp(0, calc((84 - var(--xv)) / 10), 1); }
.compare__range {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y;
  -webkit-appearance: none;
  appearance: none;
}
.has-cursor .compare__range { cursor: none; }
.compare__cap { margin-top: 16px; color: var(--text-2); font-size: 14px; text-align: center; }

/* ---------- Récit avant / pendant / après (section épinglée) ---------- */
.case-story { position: relative; height: var(--h, 400vh); background: var(--bg); }
.case-story__stage { position: sticky; top: 0; isolation: isolate; height: 100vh; height: 100svh; overflow: hidden; }
.case-story__layer {
  position: absolute;
  inset: 0;
  background-position: 50% 50%;
  background-size: cover;
  opacity: 0;
  transform: scale(1.08);
}
.case-story__layer:first-child { opacity: 1; transform: none; }
.case-story__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(var(--shade-rgb) / 0.66) 0%, rgb(var(--shade-rgb) / 0) 32%, rgb(var(--shade-rgb) / 0) 52%, rgb(var(--shade-rgb) / 0.82) 100%);
}
.case-story__ui { position: relative; display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding-top: 112px; padding-bottom: clamp(28px, 6vh, 56px); }
.case-story__head .h2 { margin-bottom: 0; color: var(--white); }
.case-story__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.case-story__caps { display: grid; flex: 0 1 520px; }
.case-story__cap {
  grid-area: 1 / 1;
  padding: 22px 26px;
  border-radius: var(--radius-card);
  background: rgb(var(--bg-rgb) / 0.78);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out);
}
.case-story__cap.is-active { opacity: 1; transform: none; }
.case-story__cap b {
  display: block;
  margin-bottom: 6px;
  color: var(--highlight);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--display-weight);
  font-size: 1.55rem;
  line-height: 1.2;
}
.case-story__cap span { color: var(--text); line-height: 1.5; }
.case-story__nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.case-story__dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: var(--radius-pill);
  background: rgb(var(--shade-rgb) / 0.4);
  color: rgb(255 255 255 / 0.75);
  font-size: 13px;
  transition: background-color 0.4s, border-color 0.4s, color 0.4s;
}
.case-story__dot b { font-weight: 400; opacity: 0.6; font-variant-numeric: tabular-nums; }
.case-story__dot.is-active { border-color: var(--white); background: var(--white); color: #1a1613; }

/* Récit en photos portrait : sur ordinateur, un cadre 9:16 à droite et les légendes à gauche */
@media (min-width: 900px) {
  .case-story--portrait .case-story__stage { background: radial-gradient(70% 90% at 75% 50%, rgb(var(--text-rgb) / 0.06), transparent 70%), var(--bg); }
  .case-story--portrait .case-story__layer {
    inset: auto;
    top: calc((100svh - min(calc(100svh - 150px), 820px)) / 2 + 28px);
    right: max(var(--gutter), calc((100% - var(--max)) / 2));
    width: auto;
    height: min(calc(100svh - 150px), 820px);
    aspect-ratio: 9 / 16;
    border-radius: 20px;
    box-shadow: 0 50px 90px -40px rgb(0 0 0 / 0.75), 0 0 0 1px rgb(var(--text-rgb) / 0.1);
  }
  .case-story--portrait .case-story__shade { display: none; }
  .case-story--portrait .case-story__foot { flex-direction: column-reverse; align-items: flex-start; gap: 18px; max-width: 520px; }
  .case-story--portrait .case-story__nav { justify-content: flex-start; }
  .case-story--portrait .case-story__caps { flex: none; width: 100%; }
  .case-story--portrait .case-story__cap { background: var(--surface); }
}

/* ---------- Galerie du chantier ---------- */
.gallery__grid--case { columns: 3 260px; }

/* ---------- Chantier suivant : la photo s'ouvre au survol ---------- */
.case-next { padding: clamp(24px, 4vw, 48px) var(--gutter) clamp(40px, 6vw, 72px); background: var(--bg); text-align: center; }
.case-next__link {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(80px, 13vw, 180px) 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
}
.case-next__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: inset(50% 50% 50% 50% round 24px);
  transition: clip-path 1.1s var(--ease-in-out);
}
.case-next__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.3); transition: transform 1.6s var(--ease-out); }
.case-next__media::after { content: ''; position: absolute; inset: 0; background: rgb(var(--shade-rgb) / 0.5); }
.case-next__link:hover .case-next__media, .case-next__link:focus-visible .case-next__media { clip-path: inset(0% 0% 0% 0% round 24px); }
.case-next__link:hover .case-next__media img, .case-next__link:focus-visible .case-next__media img { transform: scale(1); }
.case-next__label { color: var(--text-2); font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; transition: color 0.4s; }
.case-next__title {
  font-family: var(--font-display);
  font-weight: 320;
  font-size: clamp(2.6rem, 1.1rem + 5.6vw, 7.2rem);
  line-height: 1;
  letter-spacing: -0.026em;
  text-wrap: balance;
  transition: transform 0.9s var(--ease-out), color 0.4s;
}
.case-next__meta { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 15px; transition: color 0.4s; }
.case-next__meta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s var(--ease-out); }
.case-next__link:hover .case-next__title { transform: scale(1.03); color: var(--white); }
.case-next__link:hover .case-next__label, .case-next__link:hover .case-next__meta { color: var(--white); }
.case-next__link:hover .case-next__meta svg { transform: translateX(6px); }
.case-next__all { display: inline-block; margin-top: 26px; color: var(--text-2); font-size: 15px; transition: color 0.3s; }
.case-next__all:hover { color: var(--text); }

/* ---------- Appel à l'action, aux couleurs du logo ---------- */
.case-cta {
  --bg: #9e4a15;              --bg-rgb: 158 74 21;
  --text: #fff4e8;            --text-rgb: 255 244 232;
  --text-2: #fff4e8;
  --highlight: var(--brand-cream);
  --line: rgb(var(--text-rgb) / 0.3);
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}
.case-cta__inner { display: flex; flex-direction: column; align-items: center; }
.case-cta__emblem { width: auto; height: clamp(80px, 9vw, 110px); margin-bottom: 30px; }
.case-cta .h2 { max-width: 16ch; margin-inline: auto; }
.case-cta .lead { margin-inline: auto; }
.case-cta__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }

/* ---------- Écrans d'ordinateur peu hauts : ouverture plus compacte ---------- */
@media (min-width: 900px) and (max-height: 820px) {
  .case-video .case-top { margin-bottom: 18px; }
  .case-video .case-eyebrow { margin-bottom: 16px; }
  .case-video .case-title { margin-bottom: 14px; font-size: clamp(2.4rem, 1.2rem + 3vw, 3.7rem); }
  .case-video .case-sub { margin-bottom: 16px; }
  .case-video .case-chips { display: none; }
  .case-video .case-steps { margin-bottom: 18px; }
  .case-step { padding: 11px 0; }
}
@media (min-width: 900px) and (max-height: 700px) {
  .case-video .case-cue { display: none; }
  .case-video .case-title { font-size: clamp(2.2rem, 1.1rem + 2.6vw, 3.2rem); }
}

/* ---------- Mobile et tablette ---------- */
@media (max-width: 899px) {
  /* La vidéo occupe tout l'écran, les textes passent par-dessus */
  .case-video__stage { display: block; padding: 0; }
  .case-video__bg { display: none; }
  .case-video__stage::before {
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgb(var(--shade-rgb) / 0.7) 0%, rgb(var(--shade-rgb) / 0) 24%, rgb(var(--shade-rgb) / 0) 42%, rgb(var(--shade-rgb) / 0.88) 100%);
  }
  .case-video__frame { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  .case-video__bar { top: 0; left: 0; right: 0; bottom: auto; border-radius: 0; }
  .case-video__text {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: none;
    height: 100%;
    padding: 92px var(--gutter) 26px;
  }
  .case-top { margin-bottom: auto; }
  .case-title { font-size: clamp(2.3rem, 1.4rem + 4.6vw, 3.4rem); margin-bottom: 14px; }
  .case-sub { font-size: 15px; margin-bottom: 16px; }
  .case-chips { margin-bottom: 18px; }

  /* Dès que la vidéo avance, l'accroche s'efface au profit de l'étape en cours */
  .case-video .case-sub, .case-video .case-chips, .case-video .case-cue { transition: opacity 0.4s var(--ease-out), visibility 0s; }
  .case-video.is-playing .case-sub, .case-video.is-playing .case-chips, .case-video.is-playing .case-cue { opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease-out), visibility 0s 0.4s; }
  .case-video .case-steps {
    position: absolute;
    left: var(--gutter); right: var(--gutter); bottom: 26px;
    margin: 0;
    border: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out), visibility 0s 0.5s;
  }
  .case-video.is-playing .case-steps { opacity: 1; visibility: visible; transform: none; transition: opacity 0.5s var(--ease-out) 0.15s, transform 0.7s var(--ease-out) 0.15s, visibility 0s; }

  /* Une seule étape visible à la fois, dans un cartouche */
  .case-video .case-step {
    grid-area: 1 / 1;
    padding: 14px 16px 16px;
    border: 0;
    border-radius: var(--radius-card);
    background: rgb(var(--bg-rgb) / 0.78);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out);
  }
  .case-video .case-step::after { left: 16px; right: 16px; bottom: 0; }
  .case-video .case-step.is-active { opacity: 1; transform: none; }
  .case-video .case-step__text > span { font-size: 14px; }

  .case-intro__grid { grid-template-columns: minmax(0, 1fr); }
  .case-facts { position: static; }
  .case-brief__grid { grid-template-columns: 1fr; }
  .brief { min-height: 0; }
  .brief__n { padding-bottom: 30px; font-size: 3.2rem; }
  .brief__mark { height: 120%; }
  .compare-grid--2, .compare-grid--4 { grid-template-columns: 1fr; }
  .compare-grid--3, .compare-grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
  .duo, .duo:nth-child(even) { grid-template-columns: 1fr; }
  .duo:nth-child(even) .duo__media { order: 0; }
  .tgroup__head { grid-template-columns: auto minmax(0, 1fr); }
  .tgroup__text { grid-column: 1 / -1; }
  .trelated { grid-template-columns: 1fr; }
  .trelated__media { min-height: 0; aspect-ratio: 16 / 10; }
  .case-story__layer { background-position: var(--pm, 50%) 50%; }
  .case-story__foot { flex-direction: column-reverse; align-items: stretch; gap: 14px; }
  .case-story__nav { justify-content: flex-start; }
  .case-story__caps { flex: none; }
  .case-cue--hero { display: none; }
  /* triptyque : une seule photo, en plein écran */
  .case-hero__media--trio { grid-template-columns: 1fr; }
  .case-hero__cell:not(:first-child) { display: none; }
}

@media (max-width: 560px) {
  .case-fact { grid-template-columns: 1fr; gap: 4px; }
  .compare-grid--3, .compare-grid--6 { grid-template-columns: 1fr; gap: clamp(20px, 3vw, 40px); }
  .tgroup__photos .shot--port { width: calc((100% - var(--g)) / 2); }
  .tgroup__photos .shot--land { width: 100%; }
  .case-story__dot { height: 32px; padding: 0 11px; font-size: 12px; }
  .case-story__cap { padding: 18px 20px; }
  .case-story__cap b { font-size: 1.3rem; }
  .case-cta__row { flex-direction: column; align-items: stretch; width: 100%; }
}

/* Écrans tactiles : la photo du chantier suivant est visible d'emblée */
@media (hover: none) {
  .case-next__media { clip-path: inset(0% 0% 0% 0% round 24px); }
  .case-next__media img { transform: none; }
  .case-next__title, .case-next__label, .case-next__meta { color: var(--white); }
}

/* ==========================================================================
   Pages légales (mentions, confidentialité, CGU) et page 404
   ========================================================================== */
.legal-hero { position: relative; padding: clamp(150px, 18vw, 210px) 0 clamp(56px, 7vw, 88px); background: var(--bg); }
.legal-hero__inner { max-width: 980px; }
.legal-hero .case-title { font-size: clamp(2.6rem, 1.6rem + 4.4vw, 5.2rem); }
.legal-hero .case-sub { max-width: 52ch; }
.legal-hero__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.legal-hero__link { padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); color: var(--text-2); font-size: 14px; transition: border-color 0.3s, color 0.3s, background-color 0.3s; }
.legal-hero__link:hover { border-color: var(--text); color: var(--text); }
.legal-hero__link[aria-current="page"] { border-color: var(--text); background: var(--text); color: var(--bg); }

.legal__grid { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.legal__toc { position: sticky; top: 110px; font-size: 14px; }
.legal__toc-title { margin-bottom: 12px; color: var(--text-3); font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }
.legal__toc ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.legal__toc li { counter-increment: toc; }
.legal__toc a { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--text-2); transition: color 0.3s; }
.legal__toc a::before { content: counter(toc, decimal-leading-zero); color: var(--text-3); font-variant-numeric: tabular-nums; }
.legal__toc a:hover { color: var(--text); }

.legal__body { max-width: 72ch; color: var(--text-2); font-size: 17px; line-height: 1.7; }
.legal__body section { scroll-margin-top: 110px; }
.legal__body section + section { margin-top: clamp(40px, 5vw, 64px); padding-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--line); }
.legal__body h2 { margin: 0 0 18px; color: var(--text); font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); line-height: 1.15; letter-spacing: -0.012em; }
.legal__body p + p, .legal__body ul + p, .legal__body p + ul, .legal__body dl + p { margin-top: 1em; }
.legal__body ul { display: grid; gap: 8px; margin: 0; padding-left: 1.2em; }
.legal__body li::marker { color: var(--highlight); }
.legal__body strong { color: var(--text); font-weight: 600; }
.legal__body a { color: var(--text); text-decoration: underline; text-decoration-color: var(--highlight); text-underline-offset: 3px; }
.legal__body a:hover { color: var(--highlight); }
.legal__body .btn { text-decoration: none; }
.legal__facts { display: grid; gap: 0; margin: 0; }
.legal__facts > div { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 6px 24px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.legal__facts dt { color: var(--text-3); font-size: 14px; line-height: 1.6; }
.legal__facts dd { margin: 0; color: var(--text); }
/* information encore inconnue : bien visible tant qu'elle n'est pas remplie */
mark.todo { padding: 1px 6px; border-radius: 4px; background: #ffe58a; color: #3a2a00; font-size: 0.92em; }

.legal-hero--404 { min-height: 100svh; display: flex; align-items: center; padding-bottom: clamp(56px, 8vw, 110px); }
.lost { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 640px; margin: 32px 0 28px; padding: 0; list-style: none; }
.lost__link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border: 1px solid var(--line-strong); border-radius: var(--radius-card); color: var(--text); transition: border-color 0.3s, background-color 0.3s; }
.lost__link:hover { border-color: var(--highlight); background: rgb(var(--text-rgb) / 0.04); }
.lost__link .btn__icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 899px) {
  .legal__grid { grid-template-columns: 1fr; }
  .legal__toc { position: static; }
  .legal__facts > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 560px) {
  .lost { grid-template-columns: 1fr; }
  .legal__body { font-size: 16px; }
}
/* appel secondaire sous le bouton de devis : un simple lien, pour garder un seul bouton d'action */
@media (min-width: 561px) { .case-cta__row { flex-direction: column; align-items: center; } }
.case-cta__alt { color: var(--text-2); font-size: 15px; }
.case-cta__alt a { color: var(--text); text-decoration: underline; text-decoration-color: var(--highlight); text-underline-offset: 3px; white-space: nowrap; }