/* Home — calque ondes + quadrillage (viewport), desktop ≥1200px. Chargé uniquement si `$dp_active === 'home'`. */
body.page-home .site-footer {
  position: relative;
  z-index: 2;
}

body.page-home main.page-main {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

body:not(.page-home) .dp-home-wave-fixed,
body:not(.page-home) .dp-home-grid-fixed {
  display: none !important;
}

.dp-home-wave-fixed,
.dp-home-grid-fixed {
  display: none;
}

@media (min-width: 1200px) {
  body.page-home .section:not(.section--hero)::before {
    z-index: 0;
  }

  body.page-home .section:not(.section--hero) > * {
    position: relative;
    z-index: 5;
  }

  /* CTA final : `.final-cta__glow` doit rester `absolute` (halo plein cadre), pas `relative` via la règle ci-dessus. */
  body.page-home .section.section--final-cta > .final-cta__glow {
    position: absolute;
    z-index: 0;
  }

  body.page-home .section.section--final-cta > .container.final-cta__inner {
    position: relative;
    z-index: 5;
  }

  /* Citation fondateur : `.founder-quote-atmosphere` doit rester `absolute` (calque fond plein cadre). */
  body.page-home .section.section--founder-quote > .founder-quote-atmosphere {
    position: absolute;
    z-index: 0;
  }

  body.page-home .section.section--founder-quote > .container {
    position: relative;
    z-index: 5;
  }

  html[data-theme="light"] body.page-home .dp-home-grid-fixed {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    background-image:
      linear-gradient(color-mix(in srgb, var(--accent) 11%, transparent) 1px, transparent 1px),
      linear-gradient(90deg, color-mix(in srgb, var(--accent) 11%, transparent) 1px, transparent 1px);
    background-size: 2.25rem 2.25rem;
    opacity: 0.22;
    clip-path: inset(
      var(--dp-wave-inset-top, 0px) 0 var(--dp-wave-inset-bottom, 0px) 0
    );
    contain: strict;
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  html:not([data-theme="light"]) body.page-home .dp-home-grid-fixed {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    background-image:
      linear-gradient(color-mix(in srgb, var(--accent-2) 10%, transparent) 1px, transparent 1px),
      linear-gradient(90deg, color-mix(in srgb, var(--accent-2) 10%, transparent) 1px, transparent 1px);
    background-size: 2.25rem 2.25rem;
    opacity: 0.085;
    clip-path: inset(
      var(--dp-wave-inset-top, 0px) 0 var(--dp-wave-inset-bottom, 0px) 0
    );
    contain: strict;
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  html[data-dp-wave-disabled="1"] body.page-home .dp-home-wave-fixed {
    display: none !important;
  }

  body.page-home .dp-home-wave-fixed {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 4;
    pointer-events: none;
    background-image: var(--home-wave-bg, none);
    background-repeat: no-repeat;
    background-size: 100vw 100vh;
    background-position: center top;
    opacity: 0.46;
    mix-blend-mode: soft-light;
    transform: translateZ(0);
    backface-visibility: hidden;
    clip-path: inset(
      var(--dp-wave-inset-top, 0px) 0 var(--dp-wave-inset-bottom, 0px) 0
    );
    contain: strict;
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0%,
      rgba(255, 255, 255, 0.34) 12%,
      rgba(255, 255, 255, 0.34) 88%,
      transparent 100%
    );
    mask-image: linear-gradient(
      to right,
      transparent 0%,
      rgba(255, 255, 255, 0.34) 12%,
      rgba(255, 255, 255, 0.34) 88%,
      transparent 100%
    );
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
  }

  html[data-theme="light"] body.page-home .dp-home-wave-fixed {
    opacity: 0.42;
    mix-blend-mode: multiply;
  }

  html:not([data-theme="light"]) body.page-home .dp-home-wave-fixed {
    opacity: 0.6;
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0%,
      rgba(255, 255, 255, 0.5) 10%,
      rgba(255, 255, 255, 0.5) 90%,
      transparent 100%
    );
    mask-image: linear-gradient(
      to right,
      transparent 0%,
      rgba(255, 255, 255, 0.5) 10%,
      rgba(255, 255, 255, 0.5) 90%,
      transparent 100%
    );
  }

  /* Mode config `lightweight_composition` : moins de fusion GPU (normal + pas de masque latéral). */
  html[data-dp-wave-lightweight="1"] body.page-home .dp-home-wave-fixed {
    mix-blend-mode: normal;
    -webkit-mask-image: none;
    mask-image: none;
    opacity: 0.4;
  }

  html[data-theme="light"][data-dp-wave-lightweight="1"] body.page-home .dp-home-wave-fixed {
    opacity: 0.36;
  }

  html:not([data-theme="light"])[data-dp-wave-lightweight="1"] body.page-home .dp-home-wave-fixed {
    opacity: 0.52;
  }

  @keyframes dp-home-wave-glide {
    0% {
      transform: translate3d(var(--dpw-tx0, 0px), var(--dpw-ty0, 0px), 0);
    }

    100% {
      transform: translate3d(var(--dpw-tx1, 0px), var(--dpw-ty1, 0px), 0);
    }
  }

  body.page-home .dp-home-wave-fixed.dp-home-wave-fixed--dom-svg {
    background-image: none !important;
  }

  body.page-home .dp-home-wave-fixed.dp-home-wave-fixed--dom-svg .dp-home-wave-svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
    pointer-events: none;
  }

  body.page-home .dp-home-wave-fixed.dp-home-wave-fixed--dom-svg .dp-home-wave-line {
    transform-origin: 50% 50%;
    transform-box: fill-box;
    animation-name: dp-home-wave-glide;
    animation-duration: var(--dpw-dur, 16s);
    animation-delay: var(--dpw-delay, 0s);
    animation-timing-function: ease-in-out;
    animation-direction: alternate;
    animation-iteration-count: infinite;
    backface-visibility: hidden;
  }

  html[data-dp-wave-paused="1"] body.page-home .dp-home-wave-fixed.dp-home-wave-fixed--dom-svg .dp-home-wave-line {
    animation-play-state: paused;
  }

  body.page-home .site-footer {
    position: relative;
    z-index: 5;
  }
}

@media (prefers-reduced-motion: reduce) {
  @media (min-width: 1200px) {
    body.page-home .dp-home-wave-fixed {
      opacity: 0.2;
    }

    html[data-theme="light"] body.page-home .dp-home-wave-fixed {
      opacity: 0.18;
    }

    html:not([data-theme="light"]) body.page-home .dp-home-wave-fixed {
      opacity: 0.3;
    }

    body.page-home .dp-home-wave-fixed.dp-home-wave-fixed--dom-svg .dp-home-wave-line {
      animation: none !important;
      transform: none !important;
    }
  }
}
