/* Masque la barre de scroll dans tous les navigateurs */
*::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari */
}

* {
  -ms-overflow-style: none;
  /* IE / Edge */
  font-family: "Public Sans", sans-serif;
  scrollbar-width: none;
  /* Firefox */
}

.menu-open div div:nth-child(1) {
  rotate: 45deg;
  top: 50%;
  transform: translateY(-50%);
}

.menu-open div div:nth-child(2) {
  opacity: 0;
}

.menu-open div div:nth-child(3) {
  rotate: -45deg;
  bottom: 50%;
  transform: translateY(50%);
}

body {
  overflow: hidden;
}

/* swiper */
.swiper-slide {
  width: auto !important;
  height: 100% !important;
  aspect-ratio: 1;
  transition: transform 0.3s ease;
  transform: scale(0.75);
}

.swiper-slide-active {
  transform: scale(1) !important;
}

#contactForm input {
  outline: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  border-radius: 16px;
}

#contactForm textarea {
  outline: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  border-radius: 16px;
}

@keyframes animateOverlayInner {
  0% {
    scale: 0;
    opacity: 0;
  }

  15% {
    scale: 1;
    opacity: 1;
  }

  25% {
    scale: 1;
    opacity: 1;
  }

  35% {
    scale: 0.8;
    opacity: 0.8;
  }

  45% {
    scale: 1;
    opacity: 1;
  }

  60% {
    scale: 1;
    opacity: 1;
  }

  80% {
    opacity: 0;
    scale: 0;
  }

  100% {
    scale: 0;
    opacity: 0;
  }
}

@keyframes animateOverlayOuter {
  0% {
    scale: 0.8;
    opacity: 0;
  }

  15% {
    scale: 1;
    opacity: 1;
  }

  25% {
    scale: 1;
    opacity: 1;
  }

  35% {
    opacity: 0.3;
  }

  45% {
    scale: 1;
    opacity: 1;
  }

  60% {
    scale: 1;
    opacity: 1;
  }

  80% {
    opacity: 0;
    scale: 0;
  }

  100% {
    scale: 0;
    opacity: 0;
  }
}

.overlay-inner-animate {
  animation: animateOverlayInner 3.5s ease infinite forwards;
}

.overlay-outer-animate {
  animation: animateOverlayOuter 3.5s ease infinite forwards;
}

/* STATIC */

:root {
  --bg: black;
  --panel: #151821;
  --muted: #9aa3b2;
  --text: #e6e8ee;
  --accent: #6ee7ff;
  --panel-w: clamp(260px, 28vw, 360px);
  --sheet-h: min(48vh, 420px);
  --radius: 8px;
  --poi-ratio: 1; /* taille relative des POI */
}

/* État initial + perf */
[data-scale-on-scroll] {
  transform: scale(0.7);
  transform-origin: center center;
  will-change: transform;
}

/* Accessibilité : si l’utilisateur préfère réduire les animations */
@media (prefers-reduced-motion: reduce) {
  [data-scale-on-scroll] {
    transform: none !important;
  }
}

@supports (height: 1dvh) {
  :root {
    --sheet-h: min(48dvh, 420px);
  }
}

.app {
  width: 100%;
}

.viewer {
  position: relative;
  width: 100%;
  height: clamp(360px, 55vh, 820px);
  background: radial-gradient(black 60%, rgb(150, 150, 150) 200%);
  border: 1px solid rgba(150, 150, 150, 0.2);
  overflow: hidden;
  overscroll-behavior: contain;
  border-radius: var(--radius);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  touch-action: manipulation;
}

/* plein écran natif + fallback */
.viewer:fullscreen,
.viewer:-webkit-full-screen,
.viewer.fake-fs {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  z-index: 9999;
  background: #000;
  /* optionnel */
}

#viewer,
#stage,
#image {
  touch-action: pan-y pinch-zoom;
  /* iOS/Android ok en 2025 */
}

/* Si #fx est un overlay pour le scale/opacité, ne capte rien */

/* Évite d’emprisonner l’overscroll sur le hero */
#viewer {
  overscroll-behavior: auto;
}

/* si tu veux que le body ne scrolle plus en fake-fs */
html.fake-fs,
body.fake-fs {
  overflow: hidden;
}

/* coupe l’anim de transform pendant l’amorçage */
.viewer.boot .stage {
  transition: none !important;
}

/* Calque transformable (image + POI) */
.stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.1, 1);
  /* CSS var mise à jour en JS pour contre-scaler les POI */
  --z: 1;
}

.stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

/* Points d'intérêt — taille fixe à l'écran (ne scale pas) */
.poi {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%) scale(calc(1 / (var(--z) * var(--fx, 1))));
  transform-origin: center;
  width: 30px;
  height: 30px;
  background: rgba(122, 144, 196, 0.6);
  border-radius: 999px;
  border: none;
  cursor: pointer;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
}

.poi * {
  border-radius: 50%;
}

/* Tooltip label */
.poi::after {
  content: attr(data-label);
  position: absolute;
  top: -10px;
  left: 14px;
  transform: translateY(-100%);
  background: rgba(15, 18, 26, 0.92);
  color: var(--text);
  border: 1px solid #1f2a3f;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  translate: 0 6px;
}
.viewer.active .poi::after {
  display: none;
}
.poi:hover::after,
.poi:focus-visible::after {
  opacity: 1;
  translate: 0 0;
}

.fx {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  transform: scale(var(--fx, 1));
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.1, 1);
  will-change: transform;
  touch-action: pan-y pinch-zoom;
}

.viewer.boot .fx {
  transition: none !important;
}

/* Anim d'entrée/sortie (déjà présentes chez toi) */
.viewer.pois-ready .poi {
  animation: poi-in 0.7s cubic-bezier(0.2, 0.8, 0.1, 1) both;
  animation-delay: var(--reveal-delay, 0s);
  opacity: 1;
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
}

.viewer.pois-leave .poi {
  animation: poi-out 0.35s ease both;
}

/* Désactive tout hover quand un POI est actif */

.viewer.poi-active .poi:hover .poi-base-overlay,
.viewer.poi-active .poi:hover .poi-pulse-ring-animated {
  transform: none !important;
  opacity: 0 !important;
  animation-play-state: paused !important;
}

.viewer.poi-active .poi:hover .poi-core {
  transform: none;
}
.viewer.poi-active .poi-core {
  transform: scale(1);
}

.viewer.poi-active .poi:hover .poi-core {
  transform: scale(0.6);
}

/* ---------- Nouveau design interne du POI ---------- */
.poi-base-overlay {
  position: absolute;
  background: rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: opacity 0.2s;
}

.poi-base {
  background-color: rgba(122, 144, 196, 1);
  width: 20px;
  height: 20px;
  position: absolute;
}

/* Container du core (petit cercle au centre) */
.poi-core-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
}

/* Wrapper animé en idle (respiration) */
.poi-core-animated {
  position: absolute;
  transform: scale(1);
  transition: transform 0.35s ease; /* sortie douce quand .idle disparaît */
}

/* Le core visuel : TOUJOURS visible */
.poi-core {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: rgba(200, 200, 200, 1);
  border-radius: 50%;
  transition: transform 0.25s ease; /* hover */
}

/* Hover interactif (toujours actif) */
.poi:hover .poi-core {
  transform: scale(0.6);
  transform-origin: center center;
}

.poi:hover .poi-base-overlay {
  opacity: 1;
}

.poi-pulse-ring-animated {
  position: absolute;
  border-radius: 50%;
  background: rgba(122, 144, 196, 0.3);
  z-index: -5;
  opacity: 0;
  transform: scale(1);
  transition: opacity 0.35s ease, transform 0.35s ease;
  width: 30px;
  height: 30px;
}

/* quand le viewer est en idle → idle visible + animé */
.viewer.idle .poi .poi-core-animated {
  animation: pulsatingCore 1.5s ease-in-out infinite;
}

.viewer.idle .poi .poi-pulse-ring-animated {
  animation: pulseRing 1.5s infinite;
}

/* Animations internes */
.viewer.idle .poi:hover .poi-pulse-ring-animated {
  animation-play-state: paused;
  opacity: 0.4;
}

@keyframes pulsatingCore {
  0%,
  30% {
    transform: scale(1);
  }
  60% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulseRing {
  0% {
    transform: scale(1);
    opacity: 0;
  }
  40% {
    transform: scale(1);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes poi-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(calc(0.6 / var(--z)));
    filter: blur(2px);
  }

  60% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(calc(1.08 / var(--z)));
    filter: blur(0);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(calc(1 / var(--z)));
  }
}

/* keyframes sortie (inverse du "pop-in") */
@keyframes poi-out {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(calc(1 / var(--z)));
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(calc(0.85 / var(--z)));
    filter: blur(2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .viewer.idle .poi .poi-core-animated,
  .viewer.idle .poi .poi-pulse-ring-animated {
    animation: none !important;
  }
}

/* Overlay UI */
.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Panneau d'info animé: desktop = tiroir gauche, mobile = bottom sheet */
.panel {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: var(--text);
  transition: transform 0.8s 0.32s cubic-bezier(0.2, 0.8, 0.1, 1), opacity 0.32s ease;
  opacity: 0;
  pointer-events: none;
}

/* nav header du panel */
.panel .panel-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.panel .panel-title {
  text-align: center;
  flex: 1;
}

.panel .nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
  pointer-events: auto;
}

.panel .nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.panel .nav-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.panel .nav-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.panel .nav-btn.prev svg {
  transform: rotate(180deg);
}

/* Desktop: left drawer (de -100% à 0%) */
.panel.left {
  top: 0;
  width: var(--panel-w);
  border-right: 1px solid rgba(150, 150, 150, 0.2);
  border-radius: var(--radius) 0 0 var(--radius);
  transform: translateX(-100%);
  height: 100%;
}

.panel.left.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Mobile: bottom sheet (de 100% à 0%) */
.panel.bottom {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--sheet-h);
  border-top: 1px solid rgba(150, 150, 150, 0.2);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  border-radius: var(--radius) var(--radius) 0 0;
  --sheet-base: 100%;
  --drag: 0px;
  transform: translateY(calc(var(--sheet-base) + var(--drag)));
}

.panel.bottom.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  --sheet-base: 0%;
  transform: translateY(calc(var(--sheet-base) + var(--drag)));
}

.panel .content {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
}

.panel h3 {
  padding: 12px 0px;
  font-size: clamp(16px, 2.2vw, 18px);
}

.panel p {
  color: white;
  font-size: clamp(13px, 2vw, 14px);
}

.panel .panel-content p {
  margin: 0 0 10px;
  line-height: 1.55;
}

.panel .panel-content p + p {
  margin-top: 8px;
}

#panel {
  display: flex;
  flex-direction: column;
  max-height: 100dvh;
  overflow: hidden;
}

/* Zone de contenu qui scrolle */
#panel .panel-content {
  flex: 1 1 auto;
  min-height: 0;
  /* évite le shrink bug */
  overflow: auto;
  /* <- seul endroit scrollable */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  /* évite les gestes horizontaux parasites */
}

/* Header / nav / médias restent fixes dans le panel */
#panel .panel-nav,
#panel .media {
  flex: 0 0 auto;
}

#panel,
#panel * {
  touch-action: auto;
}

/* Media block dans le panel */
.panel .media {
  position: relative;
  margin-top: 10px;
  border: 1px solid rgba(150, 150, 150, 0.2);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  aspect-ratio: 16 / 9;
  /* responsive, modifie si besoin */
}

/* single */
.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* carousel */
.media.media-carousel .slides {
  position: absolute;
  inset: 0;
}

.media .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.media .slide.active {
  opacity: 1;
  transform: none;
}

.media .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* flèches */
.media .nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  padding: 4px 6px;
  border-radius: 4px;
  background: #1a1a1a;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(2px);
  z-index: 3;
  /* ⬅️ au-dessus des slides */
}

.media .nav:hover {
  background: rgba(0, 0, 0, 0.55);
}

.media .nav.prev {
  left: 8px;
}

.media .nav.next {
  right: 8px;
}

.media .nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
}

/* petits bullets (optionnels) */
.media .dots {
  position: absolute;
  left: 50%;
  bottom: 8px;
  translate: -50% 0;
  display: flex;
  gap: 6px;
  z-index: 3;
  pointer-events: none;
}

.media .slides {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.media .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.media .dot.active {
  background: #fff;
}

/* accessibilité */
@media (prefers-reduced-motion: reduce) {
  .media .slide {
    transition: none;
  }
}

.meta {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #2a3a55;
  background: #141a27;
  color: #cfe9ff;
}

/* Handle visuel pour le bottom sheet */
.handle {
  display: none;
}

@media (max-width: 640px) {
  .viewer {
    height: clamp(360px, 70vh, 820px);
  }

  .panel-content {
    height: 200px;
  }

  .handle {
    display: block;
    position: relative;
    width: 100%;
    height: 24px;
    /* zone de prise en main */
    touch-action: none;
    /* nécessaire pour capturer le geste */
    cursor: grab;
  }

  .panel.bottom.dragging .handle {
    cursor: grabbing;
  }

  .handle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 8px;
    translate: -50% 0;
    width: 60px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
  }
}

/*reveal*/

[data-reveal] {
  --shift: 300px;
  /* distance par défaut */
  opacity: 0;
  transform: translate3d(var(--x, 0), 0, 0) scale(0.985);
  filter: blur(2px);
  transition: opacity 0.6s ease, transform 1.2s cubic-bezier(0.22, 0.8, 0.12, 1), filter 0.6s ease;
  will-change: transform, opacity, filter;
}

[data-reveal="right"] {
  --x: var(--shift);
}

[data-reveal="left"] {
  --x: calc(-1 * var(--shift));
}

/* état visible */
[data-reveal].in {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* accessibilité */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    transition: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.prism-cover {
  min-height: 100px;
  max-height: 140px;
  min-width: 0;
  font-size: 10px;
  text-align: center;
}

.prism-cover div {
  padding: 0px 8px;
}

@media (min-width: 600px) {
  .prism-cover {
    font-size: 14px;
  }
}

@media (min-width: 900px) {
  #vignette-row {
    flex-flow: row nowrap;
  }

  .prism-cover {
    min-height: 160px;
    max-height: 240px;
    min-width: 0;
    font-size: 16px;
  }
}
