/* ---------- Showcase vidéo (hero) ---------- */
.showcase-wrap {
  position: relative;
  margin-top: 64px;
  scroll-margin-top: 88px;
}

.showcase-stage {
  --showcase-p: 1;
  position: relative;
  max-width: 1040px;
  margin-inline: auto;
  perspective: 1600px;
}

.showcase-halo {
  position: absolute;
  inset: 8% 2% -6%;
  z-index: 0;
  border-radius: 50%;
  background:
    radial-gradient(50% 55% at 50% 55%, rgba(249, 115, 22, 0.26) 0%, rgba(249, 115, 22, 0) 100%),
    radial-gradient(70% 60% at 50% 35%, rgba(251, 146, 60, 0.16) 0%, rgba(251, 146, 60, 0) 100%);
  filter: blur(48px);
  opacity: calc(0.55 + var(--showcase-p) * 0.45);
  pointer-events: none;
}

.showcase-frame {
  --showcase-bezel: 12px;
  --showcase-r: 26px;
  position: relative;
  z-index: 1;
  padding: var(--showcase-bezel);
  border: 1px solid var(--border-strong);
  border-radius: var(--showcase-r);
  background: linear-gradient(180deg, var(--bg) 0%, var(--gray-100) 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    0 1px 2px rgba(24, 24, 27, 0.04),
    0 12px 32px rgba(24, 24, 27, 0.08),
    0 40px 80px -32px rgba(249, 115, 22, 0.28);
  transform-origin: 50% 50%;
}

.showcase-frame::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, rgba(249, 115, 22, 0), rgba(249, 115, 22, 0.55), rgba(249, 115, 22, 0));
  pointer-events: none;
}

.showcase-frame::after {
  content: "";
  position: absolute;
  top: calc(var(--showcase-bezel) / 2 - 2px);
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--gray-300);
  pointer-events: none;
}

.showcase-has-tilt .showcase-frame {
  transform: rotateX(calc((1 - var(--showcase-p)) * 12deg)) scale(calc(0.95 + var(--showcase-p) * 0.05));
  will-change: transform;
}

.showcase-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  isolation: isolate;
  border-radius: calc(var(--showcase-r) - var(--showcase-bezel) - 1px);
  background: var(--gray-100);
  /* Safari ne rogne pas toujours une vidéo transformée sans masque */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.showcase-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(24, 24, 27, 0.08);
  pointer-events: none;
}

/* Au-dessus du placeholder : transparente avant la 1re image, même sans JS */
.showcase-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
  cursor: pointer;
}
.showcase-js .showcase-video {
  opacity: 0;
  transition: opacity 600ms ease;
}
.showcase-js.showcase-is-loaded .showcase-video { opacity: 1; }
.showcase-is-error .showcase-video { visibility: hidden; }

/* ---------- Placeholder ---------- */
.showcase-placeholder {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--orange-50) 0%, rgba(255, 247, 237, 0) 60%),
    linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

.showcase-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.75) 50%, rgba(255, 255, 255, 0) 70%);
  transform: translateX(-100%);
  animation: showcase-shimmer 1.8s ease-in-out infinite;
}

@keyframes showcase-shimmer {
  to { transform: translateX(100%); }
}

.showcase-is-loaded .showcase-placeholder {
  visibility: hidden;
  transition: visibility 0s linear 600ms;
}

.showcase-is-error .showcase-placeholder::before {
  animation: none;
  opacity: 0;
}

.showcase-fallback {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 0 #fff, var(--shadow-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}
.showcase-fallback[hidden] { display: none; }
.showcase-fallback svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--accent);
}

/* ---------- Contrôles ---------- */
.showcase-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
}
.showcase-controls[hidden] { display: none; }

.showcase-ctrl {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  margin: 0;
  padding: 7px 13px 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(24, 24, 27, 0.08),
    0 6px 18px rgba(24, 24, 27, 0.12);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  color: var(--gray-800);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, box-shadow 200ms ease, transform 150ms ease;
}
/* Zone de clic élargie sans changer le visuel */
.showcase-ctrl::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
}
.showcase-ctrl:hover { background: rgba(255, 255, 255, 0.92); color: var(--gray-900); }
.showcase-ctrl:active { transform: translateY(1px); }
.showcase-ctrl:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.showcase-ctrl[hidden] { display: none; }
.showcase-ctrl svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.showcase-ctrl--icon {
  width: 34px;
  padding: 0;
}

/* Son coupé : bouton orange pour inviter à l'activer ; son actif : bouton gris neutre */
.showcase-sound[aria-pressed="false"] {
  background: var(--accent);
  border-color: var(--accent-hover);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 18px -6px rgba(249, 115, 22, 0.6);
}
.showcase-sound[aria-pressed="false"]:hover { background: var(--accent-hover); color: #fff; }

/* Surbrillance légère pour attirer l'œil : halo qui pulse et reflet qui traverse */
.showcase-sound[aria-pressed="false"] {
  overflow: hidden;
  isolation: isolate;
  animation: showcase-sound-pulse 2.4s ease-out infinite;
}
.showcase-sound[aria-pressed="false"]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: showcase-sound-shine 2.4s ease-in-out infinite;
  pointer-events: none;
}
.showcase-sound[aria-pressed="false"]:hover,
.showcase-sound[aria-pressed="false"]:hover::after { animation-play-state: paused; }

@keyframes showcase-sound-pulse {
  0% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 0 0 0 rgba(249, 115, 22, 0.55); }
  70%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 0 0 9px rgba(249, 115, 22, 0); }
}
@keyframes showcase-sound-shine {
  0%, 45% { transform: translateX(-120%); }
  75%, 100% { transform: translateX(120%); }
}
.showcase-sound[aria-pressed="false"] .showcase-icon-muted,
.showcase-sound[aria-pressed="true"] .showcase-icon-sound { display: none; }

/* Volume : icône seule, la réglette se déplie au survol (ou au clavier) */
.showcase-volume {
  gap: 0;
  min-width: 34px;
  padding: 7px 9px;
  cursor: pointer;
}
/* La zone de clic élargie des pastilles ne doit pas recouvrir la réglette */
.showcase-volume::before { pointer-events: none; }
.showcase-volume-range {
  --showcase-volume: 100%;
  position: relative;
  z-index: 1;
  width: 0;
  height: 18px;
  margin: 0;
  background: transparent;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  /* Repli : on attend un instant avant de refermer, pour ne pas clignoter si la souris ressort brièvement */
  transition:
    width 450ms cubic-bezier(0.22, 1, 0.36, 1) 150ms,
    margin 450ms cubic-bezier(0.22, 1, 0.36, 1) 150ms,
    opacity 200ms ease 150ms;
}
.showcase-volume:hover .showcase-volume-range,
.showcase-volume:focus-within .showcase-volume-range {
  width: 76px;
  margin-left: 9px;
  opacity: 1;
  transition:
    width 450ms cubic-bezier(0.22, 1, 0.36, 1),
    margin 450ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 300ms ease 100ms;
}
.showcase-volume-range:focus-visible { outline: none; }
.showcase-volume:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.showcase-volume-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--showcase-volume), rgba(24, 24, 27, 0.14) var(--showcase-volume));
}
.showcase-volume-range::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.14);
}
.showcase-volume-range::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}
.showcase-volume-range::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(24, 24, 27, 0.25);
  -webkit-appearance: none;
  appearance: none;
}
.showcase-volume-range::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(24, 24, 27, 0.25);
}
/* Sur téléphone, le volume se règle avec les boutons de l'appareil (iOS ignore ce réglage) */
@media (hover: none) {
  .showcase-volume { display: none; }
}

.showcase-toggle .showcase-icon-play,
.showcase-is-paused .showcase-toggle .showcase-icon-pause { display: none; }
.showcase-is-paused .showcase-toggle .showcase-icon-play { display: block; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .showcase-ctrl { background: rgba(255, 255, 255, 0.94); }
}

/* ---------- Barre de lecture ---------- */
.showcase-timeline {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 14px 4px 4px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 18px rgba(24, 24, 27, 0.12);
  transition: opacity 400ms ease, transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}
.showcase-timeline[hidden] { display: none; }

/* Interface masquée : souris sortie du cadre, ou 3 s sans toucher l'écran sur mobile.
   Elle reste accessible au clavier : un élément focalisé au clavier la fait réapparaître. */
.showcase-controls {
  transition: opacity 400ms ease, transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}
.showcase-ui-idle .showcase-controls,
.showcase-ui-idle .showcase-timeline {
  opacity: 0;
  pointer-events: none;
  transition-duration: 600ms;
}
.showcase-ui-idle .showcase-controls { transform: translateY(-8px); }
/* Safari garde visible un élément animé même quand son parent passe en transparence :
   la surbrillance d'« Activer le son » s'arrête donc pendant que l'interface est cachée */
.showcase-ui-idle .showcase-sound[aria-pressed="false"],
.showcase-ui-idle .showcase-sound[aria-pressed="false"]::after { animation: none; }
.showcase-ui-idle .showcase-timeline { transform: translateY(8px); }
.showcase-ui-idle .showcase-controls:has(:focus-visible),
.showcase-ui-idle .showcase-timeline:has(:focus-visible) {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.showcase-rewind {
  flex: 0 0 auto;
  width: 30px;
  min-height: 30px;
  padding: 0;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.9);
}
.showcase-rewind svg { width: 14px; height: 14px; }
.showcase-seek {
  --showcase-seek: 0%;
  flex: 1;
  min-width: 0;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.showcase-seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--showcase-seek), rgba(24, 24, 27, 0.14) var(--showcase-seek));
}
.showcase-seek::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.14);
}
.showcase-seek::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}
.showcase-seek::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(24, 24, 27, 0.25);
  -webkit-appearance: none;
  appearance: none;
}
.showcase-seek::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(24, 24, 27, 0.25);
}
.showcase-seek:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 999px; }
.showcase-time {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--gray-700);
}

/* Bouton lecture central (vidéo en pause) */
.showcase-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  padding: 0;
  border: 1px solid var(--accent-hover);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 0 8px rgba(249, 115, 22, 0.16),
    0 14px 34px -8px rgba(249, 115, 22, 0.6);
  cursor: pointer;
  transition: background-color 200ms ease, box-shadow 200ms ease, transform 150ms ease;
}
.showcase-play:hover {
  background: var(--accent-hover);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 0 10px rgba(249, 115, 22, 0.18),
    0 16px 38px -8px rgba(249, 115, 22, 0.7);
}
.showcase-play:active { transform: scale(0.97); }
.showcase-play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 12px;
}
.showcase-play[hidden] { display: none; }
.showcase-play svg {
  width: 28px;
  height: 28px;
  margin-left: 3px;
}

/* Fin de la vidéo : le vrai bouton « Commencer dès maintenant » se pose
   sur le bouton dessiné dans la dernière image ; un halo qui pulse montre qu'il est cliquable */
.showcase-replay-icon,
.showcase-replay-label { display: none; }
.showcase-cta {
  position: absolute;
  z-index: 6;
  display: flex;
  transform-origin: 50% 50%;
}
.showcase-cta::before {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px solid var(--accent);
  border-radius: 13px;
  opacity: 0;
  pointer-events: none;
}
.showcase-cta[hidden] { display: none; }
.showcase-cta.is-pulsing::before { animation: showcase-cta-ring 1.8s ease-out infinite; }
@keyframes showcase-cta-ring {
  0% { opacity: 0.75; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.12, 1.6); }
}

/* Mode focus après « Activer le son » (ordinateur) : le reste du site est légèrement flouté */
.video-focus-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(24, 24, 27, 0.08);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 450ms ease, visibility 0s 450ms;
}
.is-video-focus .video-focus-backdrop {
  opacity: 1;
  visibility: visible;
  transition: opacity 450ms ease;
}
.is-video-focus .showcase-wrap { z-index: 80; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .showcase-wrap { margin-top: 48px; }
  .showcase-stage { perspective: 1100px; }
  .showcase-frame {
    --showcase-bezel: 8px;
    --showcase-r: 20px;
  }
  .showcase-frame::after { display: none; }
  .showcase-halo { filter: blur(36px); }
  .showcase-controls { top: 10px; right: 10px; gap: 6px; }
}

@media (max-width: 480px) {
  .showcase-wrap { margin-top: 40px; }
  .showcase-frame {
    --showcase-bezel: 6px;
    --showcase-r: 16px;
  }
  .showcase-controls { top: 8px; right: 8px; }
  .showcase-ctrl {
    min-height: 30px;
    padding: 6px 10px 6px 9px;
    gap: 6px;
    font-size: 0.75rem;
  }
  .showcase-ctrl--icon { width: 30px; padding: 0; }
  .showcase-ctrl svg { width: 14px; height: 14px; }
  .showcase-play {
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
  }
  .showcase-play svg { width: 22px; height: 22px; margin-left: 2px; }
  .showcase-timeline { left: 8px; right: 8px; bottom: 8px; gap: 8px; padding-right: 10px; }
  .showcase-rewind { width: 26px; min-height: 26px; }
  .showcase-time { display: none; }
  .showcase-fallback { font-size: 0.8rem; padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .video-focus-backdrop { transition: none; }
  .showcase-cta.is-pulsing::before { animation: none; }
  .showcase-has-tilt .showcase-frame,
  .showcase-frame {
    transform: none;
    will-change: auto;
  }
  .showcase-halo { opacity: 1; }
  .showcase-placeholder::before { animation: none; opacity: 0; }
}
