/* ==========================================================================
   M Rénova 95 — Layout
   Chargement · transitions de page · en-tête · menu mobile · pied de page
   ========================================================================== */

/* ---------- Écran de chargement ---------- */
.loader { display: none; }

.js .loader {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  background: var(--c-ivory);
  color: var(--c-ink);
  transition: transform 0.9s var(--ease-in-out);
}
.js .loader.is-leaving { transform: translateY(-100%); }
.js .loader.is-done { display: none; }

.loader__inner { display: grid; justify-items: center; gap: 22px; text-align: center; --logo-accent: #a8884f; --logo-muted: #625d57; }

/* Logo : le M monte, puis la jambe en laiton, puis RENOVA 95 et le slogan */
.loader__mark { display: block; width: 88px; height: auto; overflow: hidden; }
.loader__m, .loader__leg {
  transform-box: fill-box;
  transform: translateY(105%);
  animation: rise 0.85s var(--ease-out) forwards;
}
.loader__leg { fill: var(--logo-accent); animation-delay: 0.22s; }

.loader__word, .loader__tag { overflow: hidden; line-height: 0; }
.loader__word > span, .loader__tag > span { display: inline-block; transform: translateY(110%); animation: rise 0.8s var(--ease-out) 0.5s forwards; }
.loader__tag > span { animation-delay: 0.7s; }
.loader__word svg { display: block; width: clamp(190px, 46vw, 260px); height: auto; }
.loader__tag svg { display: block; width: clamp(140px, 34vw, 190px); height: auto; }

.loader__bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--c-ink);
  transform: scaleX(0);
  transform-origin: left;
  animation: grow 1.3s var(--ease-in-out) forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { to { transform: translateY(0); } }
@keyframes grow { to { transform: scaleX(1); } }

/* ---------- Transition entre pages ---------- */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: var(--c-ink);
  transform: translateY(100%);
  pointer-events: none;
}
.page-transition.is-active { transform: translateY(0); transition: transform 0.55s var(--ease-in-out); }
.page-transition.is-leaving { transform: translateY(-100%); transition: transform 0.7s var(--ease-in-out); }

/* ---------- Logo ----------
   Dessins dans le sprite SVG de chaque page : #logo-mark (M), #logo-word (RENOVA 95),
   #logo-tag (slogan), #logo-h (logo complet horizontal). Fichiers séparés : assets/img/logo/.
   Le M et le texte suivent la couleur du texte (currentColor) ; la jambe du M, les filets
   et le slogan suivent --logo-accent et --logo-muted (plus clairs sur fond sombre). */
.logo {
  --logo-h: 42px;
  --logo-accent: #a8884f;
  --logo-muted: #625d57;
  display: inline-flex;
  align-items: center;
  gap: calc(var(--logo-h) * 0.363);
  color: inherit;
  line-height: 1;
}
.logo svg { display: block; flex: none; }
.logo__mark { width: calc(var(--logo-h) * 1.2406); height: var(--logo-h); transition: transform 0.6s var(--ease-out); }
.logo:hover .logo__mark { transform: translateY(-2px); }
.logo__word { width: calc(var(--logo-h) * 0.741 * 3.812); height: calc(var(--logo-h) * 0.741); }
.logo__full { width: clamp(280px, 24vw, 340px); height: auto; aspect-ratio: 891 / 214; }

/* Sur fond sombre (en-tête au-dessus des photos, menu ouvert, pied de page) */
.header .logo, .logo--light { --logo-accent: #c6a878; --logo-muted: var(--c-on-dark-muted); }
.header.is-scrolled .logo, .header.header--solid .logo { --logo-accent: #a8884f; }
.is-menu-open .header .logo { --logo-accent: #c6a878; }

/* ---------- En-tête ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 500;
  color: var(--c-on-dark);
  transition: color 0.5s var(--ease-out), transform 0.6s var(--ease-out);
}
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Barre translucide (17/10/2026) : le contenu reste deviné en dessous en défilant */
  background: rgba(245, 242, 236, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(20, 21, 23, 0.07);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}
.header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  transition: height 0.5s var(--ease-out);
}

.header.is-scrolled,
.header.header--solid,
.is-menu-open .header { color: var(--c-ink); }
.header.is-scrolled::before,
.header.header--solid::before { opacity: 1; }
.header.is-scrolled .header__inner { height: calc(var(--header-h) - 16px); }
.is-menu-open .header::before { opacity: 0; }
.is-menu-open .header { color: var(--c-on-dark); }
/* Préférences d’accessibilité : barre opaque si le visiteur réduit la transparence ou augmente le contraste */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .header::before { background: var(--c-ivory); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Intro du header au chargement */
.js .header { transform: translateY(-100%); }
.js .is-ready .header, .js.is-ready .header { transform: none; }

.header__progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  pointer-events: none;
}
.header__progress span {
  display: block;
  height: 100%;
  background: var(--c-accent);
  transform-origin: left;
  transform: scaleX(var(--scroll, 0));
  opacity: 0;
  transition: opacity 0.4s;
}
.header.is-scrolled .header__progress span { opacity: 1; }
.is-menu-open .header__progress span { opacity: 0; }

/* Navigation desktop */
.nav__list { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 40px); }
.nav__link {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  padding-block: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0.86;
  transition: opacity var(--t-fast);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.55s var(--ease-out);
}
.nav__link:hover, .nav__link.is-active { opacity: 1; }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); transform-origin: left; }

.header__actions { display: flex; align-items: center; gap: 18px; }
.header__phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
  transition: opacity var(--t-fast);
}
.header__phone:hover { opacity: 1; }
.header__phone .icon { width: 17px; height: 17px; }

/* CTA du header : clair sur le hero, sombre une fois défilé */
.header:not(.is-scrolled):not(.header--solid) .header__cta { --btn-bg: var(--c-ivory); --btn-fg: var(--c-ink); --btn-fill: #fff; --btn-fg-hover: var(--c-ink); }
.is-menu-open .header__cta { opacity: 0; pointer-events: none; }

/* Burger */
.burger {
  display: none;
  position: relative;
  width: 48px; height: 48px;
  margin-right: -10px;
  border-radius: 50%;
}
.burger__line {
  position: absolute;
  left: 13px; right: 13px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.55s var(--ease-out), top 0.55s var(--ease-out);
}
.burger__line:nth-child(1) { top: 19px; }
.burger__line:nth-child(2) { top: 28px; }
.burger[aria-expanded="true"] .burger__line:nth-child(1) { top: 23.5px; transform: rotate(45deg); }
.burger[aria-expanded="true"] .burger__line:nth-child(2) { top: 23.5px; transform: rotate(-45deg); }

@media (max-width: 1359px) {
  .header__phone span { display: none; }
  .header__phone { width: 44px; height: 44px; justify-content: center; border-radius: 50%; border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 30%, transparent); }
}
@media (max-width: 1099px) {
  .nav, .header__phone { display: none; }
  .burger { display: block; }
  .header__actions { gap: 10px; }
  .logo { --logo-h: 36px; }
}
@media (max-width: 479px) {
  .header__cta { display: none; }
}

/* ---------- Menu mobile ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: flex;
  background: var(--c-ink);
  color: var(--c-on-dark);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.8s var(--ease-in-out), visibility 0s linear 0.8s;
}
.menu.is-open {
  clip-path: inset(0 0 0 0);
  visibility: visible;
  transition: clip-path 0.8s var(--ease-in-out), visibility 0s;
}
.menu__inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding-top: calc(var(--header-h) + 24px);
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
.menu__list { display: grid; gap: 4px; }
.menu__link {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding-block: 6px;
  font-family: var(--f-display);
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  line-height: 1.1;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out), color var(--t-fast);
}
.menu__num {
  font-family: var(--f-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #c6a878;
}
.menu__link:hover { color: #fff; }
.menu.is-open .menu__link { opacity: 1; transform: none; }
.menu.is-open li:nth-child(1) .menu__link { transition-delay: 0.25s; }
.menu.is-open li:nth-child(2) .menu__link { transition-delay: 0.3s; }
.menu.is-open li:nth-child(3) .menu__link { transition-delay: 0.35s; }
.menu.is-open li:nth-child(4) .menu__link { transition-delay: 0.4s; }
.menu.is-open li:nth-child(5) .menu__link { transition-delay: 0.45s; }
.menu.is-open li:nth-child(6) .menu__link { transition-delay: 0.5s; }

.menu__footer {
  display: grid;
  gap: 22px;
  padding-top: 28px;
  border-top: 1px solid var(--c-on-dark-line);
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
}
.menu.is-open .menu__footer { opacity: 1; transition-delay: 0.55s; }
.menu__contact { display: grid; gap: 12px; }
.menu__contact a { display: inline-flex; align-items: center; gap: 12px; font-weight: 500; }
.menu__contact .icon { width: 18px; height: 18px; color: #c6a878; }
.menu__zone { font-size: 0.8125rem; color: var(--c-on-dark-muted); letter-spacing: 0.04em; }

@media (min-width: 1100px) { .menu { display: none; } }

/* ---------- Pied de page ---------- */
.footer {
  position: relative;
  overflow: hidden;
  background: var(--c-ink);
  color: var(--c-on-dark);
  padding-top: clamp(80px, 9vw, 128px);
}
.footer__top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.2fr;
  gap: clamp(40px, 5vw, 80px);
  padding-bottom: clamp(56px, 6vw, 88px);
}
.footer__desc {
  margin-top: 26px;
  max-width: 38ch;
  color: var(--c-on-dark-muted);
  font-size: 0.9375rem;
}
.footer__social { display: flex; gap: 10px; margin-top: 30px; }
.footer__social a {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--c-on-dark-line);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.footer__social a:hover { background: var(--c-on-dark); color: var(--c-ink); border-color: var(--c-on-dark); }
.footer__social .icon { width: 18px; height: 18px; }

.footer__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #c6a878;
  margin-bottom: 22px;
}
.footer__col ul { display: grid; gap: 12px; }
.footer__col a, .footer__link {
  font-size: 0.9375rem;
  color: var(--c-on-dark-muted);
  text-align: left;
  background: linear-gradient(currentColor, currentColor) no-repeat left bottom / 0% 1px;
  transition: color var(--t-fast), background-size 0.5s var(--ease-out);
}
.footer__col a:hover, .footer__link:hover { color: var(--c-on-dark); background-size: 100% 1px; }
.footer__contact li { font-size: 0.9375rem; color: var(--c-on-dark-muted); }
.footer__cta { margin-top: 28px; }
.footer__col .footer__cta { color: var(--btn-fg); background: var(--btn-bg); }

.footer__bottom {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 28px;
  border-top: 1px solid var(--c-on-dark-line);
  font-size: 0.8125rem;
  color: var(--c-on-dark-muted);
}
.footer__legal { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer__legal a:hover, .footer__top-link:hover { color: var(--c-on-dark); }
.footer__top-link { display: inline-flex; align-items: center; gap: 8px; transition: color var(--t-fast); }
.footer__top-link .icon { width: 16px; height: 16px; }

.footer__giant {
  font-family: var(--f-display);
  font-size: clamp(3rem, 11vw, 11rem);
  line-height: 0.8;
  letter-spacing: -0.03em;
  white-space: nowrap;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 238, 231, 0.14);
  margin-bottom: -0.12em;
  user-select: none;
  pointer-events: none;
}
.footer__giant em { -webkit-text-stroke-color: rgba(198, 168, 120, 0.35); }

@media (max-width: 1023px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 599px) {
  .footer__top { grid-template-columns: 1fr; gap: 40px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
  .footer { padding-bottom: 76px; }
}

/* ---------- Barre d’action mobile ---------- */
.mobile-cta { display: none; }

@media (max-width: 767px) {
  .mobile-cta {
    position: fixed;
    left: 12px; right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 400;
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 8px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(20, 21, 23, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.45);
    transform: translateY(calc(100% + 24px));
    transition: transform 0.6s var(--ease-out);
  }
  .mobile-cta.is-visible { transform: none; }
  .mobile-cta a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 20px;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 600;
  }
  .mobile-cta .icon { width: 18px; height: 18px; }
  .mobile-cta a { transition: scale 0.1s ease-out; -webkit-tap-highlight-color: transparent; }
  .mobile-cta a:active { scale: 0.96; }
  .mobile-cta__call { color: var(--c-on-dark); }
  .mobile-cta__quote { background: var(--c-ivory); color: var(--c-ink); }
  /* WhatsApp (17/10/2026) : pastille verte, icône seule */
  .mobile-cta .mobile-cta__wa { width: 50px; padding: 0; background: #0e7a6e; color: #fff; }
  .mobile-cta__wa .icon { width: 24px; height: 24px; }
}
@media (max-width: 399px) {
  /* Petits écrans : « Appeler » devient une icône pour laisser la place au devis */
  .mobile-cta .mobile-cta__call { width: 50px; padding: 0; }
  .mobile-cta__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Bouton WhatsApp flottant (ordinateur et tablette) ---------- */
.wa-float { display: none; }
@media (min-width: 768px) {
  .wa-float {
    position: fixed;
    right: clamp(16px, 2vw, 28px);
    bottom: clamp(16px, 2vw, 28px);
    z-index: 400;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 0 20px 0 16px;
    border-radius: 999px;
    background: #0e7a6e;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.45);
    transition: background 0.3s, transform 0.4s var(--ease-out);
  }
  /* Avec JavaScript : visible seulement après le hero (voir main.js), hors formulaire, contact et pied de page */
  .js .wa-float { opacity: 0; visibility: hidden; transform: translateY(16px); transition: opacity 0.4s, visibility 0.4s, transform 0.5s var(--ease-out), background 0.3s, scale 0.1s ease-out; }
  .wa-float:active { scale: 0.97; }
  .js .wa-float.is-visible { opacity: 1; visibility: visible; transform: none; }
  .wa-float:hover { background: #0b655b; }
  .wa-float:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
  .wa-float .icon { width: 24px; height: 24px; }
}
