/* RIMINOVATION — Overdrive « Matière cinématique » : voile doré, parallaxe,
   révélations au scroll, comparateur Brut/Fini, marquee métiers.
   Amélioration progressive : sans JS / sans scroll-timeline, le contenu reste intact. */

@property --veil { syntax: "<number>"; inherits: true; initial-value: 0; }

:root {
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gold-soft: #e8cf95;
  --ring: rgba(207, 179, 118, .22);
}

/* ---------- surfaces navigateur : la marque jusque dans les détails ---------- */
::selection { background: var(--gold); color: var(--bg); }
html { scrollbar-color: var(--gold) var(--bg); }
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #4a4234; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }
input, select, textarea { caret-color: var(--gold); }
a { text-underline-offset: 3px; }
.phone-link, .telephone, a[href^="tel:"] { font-variant-numeric: tabular-nums; }

/* ---------- transitions entre pages (Chrome/Edge/Safari ; ignoré ailleurs) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .45s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .55s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- barre de progression lecture ---------- */
#progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3000;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transform: scaleX(0); transform-origin: 0 50%;
}

/* ---------- révélations au scroll : un seul geste, blur + montée ---------- */
.rv {
  opacity: 0; transform: translateY(28px); filter: blur(8px);
  transition: opacity .9s var(--ease), transform 1s var(--ease), filter .9s var(--ease);
  transition-delay: var(--d, 0s);
}
.rv.in { opacity: 1; transform: none; filter: none; }

/* ---------- hero : titre masqué ligne à ligne + photo parallaxe + voile ---------- */
.hero-photo img { transform: translateY(var(--py, 0px)) scale(1.08); will-change: transform; }
.hero-photo .photo-label {
  position: absolute; left: 18px; bottom: 16px; z-index: 2;
  background: rgba(12, 11, 13, .82); color: var(--text);
  font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase; white-space: nowrap;
  padding: 9px 14px; border: 1px solid var(--line); max-width: calc(100% - 36px);
  overflow: hidden; text-overflow: ellipsis;
}
.hero-photo::before {
  content: ""; position: absolute; inset: -40%; z-index: 1; pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(207, 179, 118, .17) 50%, transparent 58%);
  animation: sheen 9s ease-in-out infinite alternate;
}
@keyframes sheen { from { transform: translateX(-11%); } to { transform: translateX(11%); } }
.hero h1 .ln-in { display: block; transform: translateY(112%); transition: transform 1.15s var(--ease); }
.hero.in h1 .ln-in { transform: translateY(0); }
html.js .hero:not(.in) .hero-actions { opacity: 0; transform: translateY(14px); }
.hero .hero-actions { transition: opacity .8s var(--ease) .55s, transform .8s var(--ease) .55s; }

/* ---------- bandeau métiers : défilement matière ---------- */
.mat { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 17px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.mat-track { display: flex; align-items: center; width: max-content; animation: mat 32s linear infinite; }
.mat-track > * { margin-right: 46px; }
.mat .m { font: 600 12px Manrope, sans-serif; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.mat .dia { width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); flex-shrink: 0; }
@keyframes mat { to { transform: translateX(-50%); } }
.mat:hover .mat-track { animation-play-state: paused; }

/* ---------- comparateur Brut / Fini : ressort physique ---------- */
.ba-sec { padding: 40px 0 100px; }
.ba-head { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: end; margin-bottom: 34px; }
.ba-head h2 { font-size: clamp(32px, 3.6vw, 54px); line-height: 1.1; letter-spacing: -1.5px; }
.ba-head p { color: var(--muted); font-size: 14px; max-width: 38ch; }
.ba {
  position: relative; overflow: hidden; --x: 50%;
  border: 1px solid var(--line); background: #201c17;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.ba img { display: block; width: 100%; height: clamp(320px, 52vw, 560px); object-fit: cover; pointer-events: none; }
.ba-after { filter: saturate(1.08) contrast(1.03) sepia(.08); }
.ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.ba-before img { filter: grayscale(.85) brightness(.68) contrast(.95); }
.ba-before::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(12, 11, 13, .4), transparent 60%); }
.ba-seam { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; background: var(--gold); transform: translateX(-50%); box-shadow: 0 0 24px rgba(207, 179, 118, .55); }
.ba-knob {
  position: absolute; top: 50%; left: var(--x); transform: translate(-50%, -50%);
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--gold); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .55);
}
.ba-knob svg { width: 24px; height: 24px; }
.ba-tag {
  position: absolute; top: 16px; padding: 7px 13px; z-index: 2;
  background: rgba(12, 11, 13, .82); font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase;
}
.ba-tag.left { left: 16px; color: var(--muted); }
.ba-tag.right { right: 16px; color: var(--gold); border: 1px solid var(--gold); }
.ba input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: ew-resize; }
.ba input[type="range"]:focus-visible { opacity: 1; outline: 2px solid var(--gold); outline-offset: -2px; }
.ba-caption { margin-top: 14px; font-size: 11px; color: var(--muted); }

/* ---------- survol métiers : aperçu matière qui suit le curseur ---------- */
.svc-prev {
  position: fixed; z-index: 1400; width: 230px; height: 290px; object-fit: cover;
  pointer-events: none; opacity: 0; transform: scale(.92) rotate(-2deg);
  transition: opacity .35s var(--ease), transform .5s var(--ease);
  border: 1px solid var(--gold); box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
.svc-prev.show { opacity: 1; transform: scale(1) rotate(0deg); }

/* ---------- tilt chantier : les photos respirent ---------- */
.project-image img, .photo img { will-change: transform; }

/* ---------- boutons magnétiques ---------- */
.button { transition: transform .35s var(--ease), background .3s, color .3s; will-change: transform; }

/* ---------- barre d'appel mobile ---------- */
.sticky-call { display: none; }
@media (max-width: 700px) {
  .hero-photo::after { background: linear-gradient(180deg, rgba(12, 11, 13, .86) 0%, rgba(12, 11, 13, .5) 46%, rgba(12, 11, 13, .28) 100%), linear-gradient(90deg, rgba(12, 11, 13, .55), transparent) !important; }
  .hero .hero-content { text-shadow: 0 2px 26px rgba(0, 0, 0, .65); }
  .hero-photo .photo-label {
    position: absolute; left: 12px; bottom: 12px; z-index: 2;
    background: rgba(12, 11, 13, .85); color: var(--text);
    font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase;
    padding: 8px 12px; border: 1px solid var(--line); max-width: calc(100% - 24px);
  }
  .sticky-call {
    display: flex; gap: 10px; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1500;
    padding: 10px; background: rgba(12, 11, 13, .92); border: 1px solid var(--gold);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transform: translateY(140%); transition: transform .5s var(--ease);
  }
  .sticky-call.show { transform: none; }
  .sticky-call a { flex: 1; text-align: center; padding: 13px 8px; font-size: 13px; font-weight: 600; }
  .sticky-call .sc-tel { border: 1px solid var(--line); color: var(--text); }
  .sticky-call .sc-cta { background: var(--gold); color: #17140f; }
  body:has(.sticky-call.show) { padding-bottom: 86px; }
}
.field input.ok, .field select.ok, .field textarea.ok { border-color: var(--gold); box-shadow: 0 0 0 3px var(--ring); }
.field input.ko, .field textarea.ko { border-color: #c96a5a; box-shadow: 0 0 0 3px rgba(201, 106, 90, .16); }
.count { font-size: 11px; color: var(--muted); text-align: right; margin-top: 6px; font-variant-numeric: tabular-nums; }

@media (max-width: 700px) {
  .ba-head { grid-template-columns: 1fr; gap: 14px; }
  .ba img { height: 340px; }
}

@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; filter: none; transition: none; }
  .hero h1 .ln-in { transform: none; transition: none; }
  .hero .hero-actions { opacity: 1; transform: none; transition: none; }
  .hero-photo::before, .mat-track { animation: none; }
  .sticky-call { display: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
