/* ================================================================
   RAYFLECTIONS V2 — INNOVATIONS CSS
   Glass avancé · Dynamic move · Composants premium · Vidéos · Carrousels
   ================================================================ */

/* ====================================================================
   1. GLASS LAYERED — depth + sheen
   ==================================================================== */

/* Surface glass premium réutilisable */
.glass-layered {
  position: relative;
  background:
    linear-gradient(165deg, rgba(15, 26, 46, 0.78), rgba(7, 16, 31, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-2xl);
  backdrop-filter: blur(22px) saturate(1.4) brightness(1.05);
  -webkit-backdrop-filter: blur(22px) saturate(1.4) brightness(1.05);
  box-shadow:
    0 22px 60px rgba(4, 8, 16, 0.55),
    0 8px 24px rgba(4, 8, 16, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4);
  overflow: hidden;
  isolation: isolate;
}

/* Sheen lumineux en haut (reflet verre) */
.glass-layered::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 50%;
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.06) 0%,
      rgba(255, 255, 255, 0.02) 40%,
      transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* Glow conic au coin pour profondeur */
.glass-layered::after {
  content: "";
  position: absolute;
  inset: -1px;
  background: conic-gradient(
    from 200deg at 90% 0%,
    transparent 0%,
    var(--gold-glow) 25%,
    transparent 50%
  );
  opacity: 0.4;
  filter: blur(18px);
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
}

/* Variante : nav glass premium */
.glass-nav {
  background:
    linear-gradient(180deg, rgba(7, 16, 31, 0.65), rgba(7, 16, 31, 0.85));
  backdrop-filter: blur(28px) saturate(1.6) brightness(1.08);
  -webkit-backdrop-filter: blur(28px) saturate(1.6) brightness(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 40px rgba(0, 0, 0, 0.35);
}

/* Glass overlay pour photos — assombri élégant */
.photo-overlay {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.photo-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg,
      transparent 0%,
      rgba(7, 16, 31, 0.10) 50%,
      rgba(7, 16, 31, 0.92) 100%);
  pointer-events: none;
}

/* ====================================================================
   2. DYNAMIC MOVE — magnetic, tilt, parallax, particles
   ==================================================================== */

/* === Magnetic CTA === */
/* Hint visuel : le bouton change subtilement au pointer enter */
.magnetic {
  --mag-x: 0px;
  --mag-y: 0px;
  transform: translate3d(var(--mag-x), var(--mag-y), 0);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow var(--t-base) var(--ease);
  will-change: transform;
}
.magnetic:hover {
  box-shadow:
    0 18px 40px rgba(216, 178, 122, 0.35),
    0 6px 12px rgba(216, 178, 122, 0.18);
}
.magnetic::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%,
    rgba(216, 178, 122, 0.28) 0%,
    transparent 50%);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
  pointer-events: none;
  z-index: -1;
}
.magnetic:hover::after { opacity: 1; }

/* === 3D Tilt cards === */
.tilt {
  perspective: 1200px;
  transform-style: preserve-3d;
}
.tilt__inner {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.tilt__shine {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.10),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
  border-radius: inherit;
  mix-blend-mode: overlay;
}
.tilt:hover .tilt__shine { opacity: 1; }

/* Désactiver tilt si motion reduced */
@media (prefers-reduced-motion: reduce) {
  .tilt__inner { transform: none !important; transition: none; }
  .magnetic { transform: none !important; }
}

/* === Parallax image background === */
.parallax {
  --parallax-y: 0px;
  transform: translate3d(0, var(--parallax-y), 0);
  will-change: transform;
}

/* === Particle field (hero) === */
.particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
  opacity: 0;
  animation: particle-drift linear infinite;
}
@keyframes particle-drift {
  0% {
    transform: translate3d(0, 100vh, 0) scale(0);
    opacity: 0;
  }
  10% { opacity: 0.5; transform: translate3d(0, 90vh, 0) scale(1); }
  90% { opacity: 0.5; }
  100% {
    transform: translate3d(60px, -10vh, 0) scale(0.3);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .particle { animation: none; opacity: 0.2; }
}

/* === Mouse-follow gradient (hero) === */
.mouse-glow {
  position: relative;
  overflow: hidden;
}
.mouse-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 50%),
    rgba(216, 178, 122, 0.10),
    transparent 60%
  );
  pointer-events: none;
  transition: background 0.2s ease-out;
}

/* ====================================================================
   3. STAGGERED REVEALS — orchestrés
   ==================================================================== */

/* Wrapper qui reveal ses enfants en cascade */
.stagger {
  --stagger-delay: 100ms;
}
.stagger > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.stagger.is-visible > *:nth-child(2) { transition-delay: 100ms; }
.stagger.is-visible > *:nth-child(3) { transition-delay: 200ms; }
.stagger.is-visible > *:nth-child(4) { transition-delay: 300ms; }
.stagger.is-visible > *:nth-child(5) { transition-delay: 400ms; }
.stagger.is-visible > *:nth-child(6) { transition-delay: 500ms; }
.stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .stagger > * { opacity: 1; transform: none; transition: none; }
}

/* ====================================================================
   4. VIDEO CARD PREMIUM
   ==================================================================== */

.video-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-2xl);
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  border: 1px solid var(--gold-faint);
  box-shadow: var(--shadow-lift);
  transition: transform 0.4s var(--ease);
}
.video-card:hover { transform: scale(1.005); }

.video-card__poster {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--video-poster, #0B1320) center/cover no-repeat;
  filter: saturate(0.85) contrast(1.05);
}
.video-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at center, transparent 30%, rgba(7, 16, 31, 0.6) 80%),
    linear-gradient(180deg, transparent 50%, rgba(7, 16, 31, 0.85) 100%);
}

.video-card__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 92px; height: 92px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 8px rgba(216, 178, 122, 0.18),
    0 0 0 16px rgba(216, 178, 122, 0.06),
    0 14px 40px rgba(0, 0, 0, 0.55);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.video-card:hover .video-card__play {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow:
    0 0 0 10px rgba(216, 178, 122, 0.24),
    0 0 0 22px rgba(216, 178, 122, 0.10),
    0 18px 50px rgba(0, 0, 0, 0.6);
}
.video-card__play::after {
  content: "";
  width: 0; height: 0;
  margin-left: 8px;
  border-left: 22px solid var(--ink-deep);
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
}

/* Pulse subtle on the play button */
.video-card__play::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  animation: video-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes video-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.18); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .video-card__play::before { animation: none; }
}

.video-card__caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: var(--s-6) var(--s-8);
  background: linear-gradient(0deg, rgba(7, 16, 31, 0.92), transparent);
  color: var(--paper);
}
.video-card__title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  margin: 0;
  line-height: 1.2;
}
.video-card__sub {
  font-size: 0.88rem;
  color: var(--paper-mute);
  margin-top: 4px;
  display: flex;
  gap: 12px;
}
.video-card__sub strong {
  color: var(--gold);
  font-weight: 400;
}
.video-card__duration {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(7, 16, 31, 0.85);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Modal vidéo */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483300;
  background: rgba(7, 16, 31, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  opacity: 0;
  overflow: auto;
  overscroll-behavior: contain;
  transition: opacity 0.3s var(--ease);
}
.video-modal.is-active {
  display: flex;
  opacity: 1;
}
.video-modal__inner {
  width: min(100%, 1100px);
  max-height: calc(100dvh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.75rem;
  overflow: visible;
  position: relative;
}
.video-modal__controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  min-height: 44px;
  position: relative;
  z-index: 3;
}
.video-modal__close,
.video-modal__fullscreen {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(7, 16, 31, 0.85);
  border: 1px solid var(--gold-line);
  color: var(--paper);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base), transform var(--t-base);
}
.video-modal__fullscreen svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.video-modal__fullscreen[hidden] {
  display: none !important;
}
.video-modal__close:hover,
.video-modal__fullscreen:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-deep);
  transform: translateY(-1px);
}
.video-modal__frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 128px);
  background: var(--ink-deep);
  border-radius: var(--r-2xl);
  border: 1px solid var(--gold-faint);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  position: relative;
}

.video-modal__player {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.video-modal__player[hidden] {
  display: none !important;
}

.video-modal__player--native {
  object-fit: contain;
  background: #07101f;
}

@supports not (height: 100dvh) {
  .video-modal__inner {
    max-height: calc(100vh - 32px);
  }

  .video-modal__frame {
    max-height: calc(100vh - 128px);
  }
}

@media (max-width: 760px) {
  .video-modal {
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .video-modal__inner {
    width: min(100%, 680px);
    gap: 0.55rem;
  }

  .video-modal__controls {
    min-height: 40px;
  }

  .video-modal__close,
  .video-modal__fullscreen {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  .video-modal__frame {
    max-height: calc(100dvh - 104px);
    border-radius: 18px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .video-modal {
    align-items: center;
    padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .video-modal__inner {
    width: min(66vw, 600px);
    display: block;
    gap: 8px;
  }

  .video-modal__controls {
    position: absolute;
    top: 10px;
    right: 10px;
    min-height: 36px;
  }

  .video-modal__close,
  .video-modal__fullscreen {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
  }

  .video-modal__fullscreen svg {
    width: 18px;
    height: 18px;
  }

  .video-modal__frame {
    max-height: calc(100dvh - 32px);
    border-radius: 14px;
  }
}

/* ====================================================================
   5. CARROUSEL — drag + auto + dots
   ==================================================================== */

.carousel {
  position: relative;
  overflow: hidden;
}
.carousel__track {
  display: flex;
  gap: var(--s-5);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  cursor: grab;
}
.carousel__track:active { cursor: grabbing; }
.carousel__slide {
  flex: 0 0 calc(50% - var(--s-3));
  min-width: 0;
}
@media (max-width: 760px) { .carousel__slide { flex: 0 0 calc(100% - 0px); } }

.carousel__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--s-6);
  flex-wrap: wrap;
  gap: var(--s-3);
}

.carousel__dots {
  display: flex;
  gap: 8px;
}
.carousel__dot {
  width: 32px; height: 4px;
  border-radius: 999px;
  background: rgba(245, 242, 235, 0.15);
  cursor: pointer;
  transition: background var(--t-base);
  border: none;
  padding: 0;
}
.carousel__dot.is-active { background: var(--gold); }

.carousel__arrows {
  display: flex;
  gap: 8px;
}
.carousel__arrow {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(15, 26, 46, 0.7);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background var(--t-base), transform var(--t-base);
}
.carousel__arrow:hover {
  background: var(--gold);
  color: var(--ink-deep);
  transform: scale(1.05);
}
.carousel__arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.carousel__progress {
  flex: 1;
  min-width: 100px;
  height: 2px;
  background: rgba(245, 242, 235, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.carousel__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: inherit;
  transition: width 5s linear;
  width: 0%;
}

/* ====================================================================
   6. CTA STICKY MOBILE
   ==================================================================== */

.cta-sticky {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 50;
  display: none;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink-deep);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 14px 40px rgba(216, 178, 122, 0.35), 0 4px 8px rgba(0,0,0,0.3);
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.3s var(--ease);
}
.cta-sticky:hover { transform: translateY(-2px); }
.cta-sticky::after { content: "→"; }
@media (max-width: 760px) {
  .cta-sticky.is-visible { display: flex; }
}

/* ====================================================================
   7. MOBILE DRAWER NAV
   ==================================================================== */

.nav__burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.10);
  border: 1px solid rgba(191, 155, 82, 0.28);
  color: var(--gold);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.nav__burger span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--gold);
  border-radius: 1px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
body.drawer-open .nav__burger span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
body.drawer-open .nav__burger span:nth-child(2) { opacity: 0; }
body.drawer-open .nav__burger span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.nav__drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(86vw, 380px);
  background:
    radial-gradient(ellipse 100% 60% at 0% 0%, rgba(216, 178, 122, 0.08), transparent 70%),
    linear-gradient(180deg, var(--ink-deep), var(--ink-night));
  border-left: 1px solid var(--gold-faint);
  z-index: 51;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease);
  display: flex;
  flex-direction: column;
  padding: 100px var(--s-8) var(--s-8);
  overflow-y: auto;
  pointer-events: none;
}
body.drawer-open .nav__drawer {
  transform: translateX(0);
  pointer-events: auto;
}
.nav__drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 16, 31, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
body.drawer-open .nav__drawer-overlay {
  opacity: 1;
  pointer-events: auto;
}

.nav__drawer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav__drawer-item a {
  display: block;
  padding: var(--s-4) 0;
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--paper);
  border-bottom: 1px solid var(--ink-line);
  transition: color var(--t-fast), padding-left var(--t-base);
}
.nav__drawer-item a:hover {
  color: var(--gold);
  padding-left: 8px;
}
.nav__drawer-item a.is-primary {
  color: var(--gold);
  font-style: italic;
}
.nav__drawer-cta {
  margin-top: var(--s-6);
  padding-top: var(--s-6);
  border-top: 1px solid var(--gold-faint);
}

@media (max-width: 920px) {
  .nav__burger { display: flex; }
  .nav__cta .btn { display: none; }
  .nav__inner { grid-template-columns: auto 1fr auto; }
}
@media (min-width: 921px) {
  .nav__drawer, .nav__drawer-overlay { display: none; }
}

/* ====================================================================
   8. UTILITAIRES IMAGE — lazy + aspect ratio + object-position
   ==================================================================== */

.img-lazy {
  background: linear-gradient(135deg, #0B1320, #0F1A2E);
  position: relative;
  overflow: hidden;
}
.img-lazy::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(216, 178, 122, 0.06) 50%,
    transparent 70%
  );
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.img-lazy.is-loaded::before { display: none; }

img.lazy-img {
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
img.lazy-img.is-loaded { opacity: 1; }

/* ====================================================================
   9. A11Y — focus ring premium
   ==================================================================== */

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
  box-shadow: 0 0 0 6px rgba(216, 178, 122, 0.18);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: 12px 22px;
  background: var(--gold);
  color: var(--ink-deep);
  font-weight: 600;
  border-radius: 0 0 var(--r-md) 0;
  z-index: 200;
  transition: top 0.3s var(--ease);
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}
