/* =========================================================
   Shad'Owl — base : variables, décor commun, en-tête, bulle
   ========================================================= */
:root {
  --nuit: #0d1020;
  --nuit-2: #151933;
  --creme: #f1e8da;
  --texte: #d9d3e2;
  --texte-doux: rgba(217, 211, 226, 0.68);
  --or: #d6b07a;
  --or-vif: #e6c48f;
  --or-sombre: #a8834f;
  --verre: rgba(16, 18, 36, 0.62);
  --verre-bord: rgba(255, 255, 255, 0.09);
  --ombre: 0 30px 80px rgba(3, 4, 12, 0.55);
  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --rayon: 28px;
  --ratio-image: 1.7768;           /* 1672 / 941 : proportions de fond-musee.jpg */
  --focus-x: 0.72;                 /* quelle partie de l'image garder visible quand l'écran est étroit (0 = gauche, 1 = droite) */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--nuit);
  color: var(--texte);
  font-family: var(--sans);
  font-weight: 400;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--or-vif); outline-offset: 3px; border-radius: 999px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- Décor ---------------- */
.decor { position: fixed; inset: 0; overflow: hidden; z-index: 0; }

/* Le cadre a exactement les proportions de l'image et "couvre" l'écran,
   comme object-fit: cover, mais en gardant un repère commun pour les calques. */
.decor-cadre {
  position: absolute;
  width: max(100vw, calc(100vh * var(--ratio-image)));
  aspect-ratio: 1672 / 941;
  left: calc((100vw - max(100vw, calc(100vh * var(--ratio-image)))) * var(--focus-x));
  top: calc((100vh - max(100vh, calc(100vw / var(--ratio-image)))) * 0.5);
  animation: respiration 22s ease-in-out infinite;
  transform-origin: 72% 45%;
}
.decor-parallaxe {
  position: absolute; inset: 0;
  transition: transform 1.2s cubic-bezier(.2, .7, .2, 1);
  will-change: transform;
}
.decor-image { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; }

/* Voile : assombrit la gauche pour la lisibilité, comme sur la maquette */
.decor-voile {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11, 13, 28, 0.86) 0%, rgba(11, 13, 28, 0.62) 34%, rgba(11, 13, 28, 0.12) 58%, rgba(11, 13, 28, 0) 70%),
    linear-gradient(0deg, rgba(9, 10, 22, 0.55) 0%, rgba(9, 10, 22, 0) 22%),
    linear-gradient(180deg, rgba(9, 10, 22, 0.45) 0%, rgba(9, 10, 22, 0) 16%);
}
.decor-poussiere { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Calques posés sur l'image : positions en % de l'image (x / 1672, y / 941) */
.chouette-paupieres {
  position: absolute;
  left: 66.986%; top: 31.881%; width: 12.261%; height: 14.346%;
  opacity: 0; pointer-events: none; user-select: none;
}
.chouette-paupieres.fermees { opacity: 1; }

.lueur {
  position: absolute; border-radius: 50%; pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 214, 150, 0.55) 0%, rgba(255, 200, 120, 0.18) 35%, transparent 70%);
  mix-blend-mode: screen;
  animation: vacille 5s ease-in-out infinite;
}
.lueur-ampoule    { left: 2.81%;  top: 46.2%; width: 9%;  aspect-ratio: 1; }
.lueur-suspension { left: 63.1%;  top: 37.4%; width: 4%;  aspect-ratio: 1; animation-delay: -1.7s; }
.lueur-sphere     { left: 84.45%; top: 27.8%; width: 6%;  aspect-ratio: 1; animation-delay: -3.1s; opacity: .7; }

.eclat {
  position: absolute; border-radius: 50%; pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 240, 210, 0.35) 40%, transparent 70%);
  mix-blend-mode: screen;
  animation: scintille 4.5s ease-in-out infinite;
}
.eclat-medaillon { left: 73.2%; top: 49.0%; width: 1.6%; aspect-ratio: 1; animation-duration: 6s; }
.eclat-oeil-g    { left: 69.83%; top: 36.52%; width: 0.9%; aspect-ratio: 1; }
.eclat-oeil-d    { left: 75.09%; top: 39.24%; width: 0.75%; aspect-ratio: 1; animation-delay: -.4s; }

/* Halo quand Shad'Owl écoute (micro actif) */
.chouette-ecoute {
  position: absolute; left: 72.9%; top: 47%; width: 26%; aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(.9);
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(214, 176, 122, 0.22) 0%, rgba(214, 176, 122, 0.08) 45%, transparent 68%);
  transition: opacity .5s ease, transform .5s ease;
}
body.ecoute .chouette-ecoute, body.parle .chouette-ecoute { opacity: 1; transform: translate(-50%, -50%) scale(1); animation: pouls 1.6s ease-in-out infinite; }

/* ---------------- En-tête ---------------- */
.entete {
  position: fixed; z-index: 20; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(18px, 2.6vh, 30px) clamp(20px, 6.8vw, 116px);
  pointer-events: none;
}
.entete > * { pointer-events: auto; }
.marque { display: flex; align-items: center; gap: 18px; color: var(--creme); text-decoration: none; }
.marque-logo { width: clamp(46px, 4.4vw, 72px); color: var(--or); filter: drop-shadow(0 0 12px rgba(214, 176, 122, .25)); }
.marque-texte { display: flex; flex-direction: column; gap: 2px; }
.marque-nom { font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 2.5vw, 42px); line-height: 1; letter-spacing: .01em; }
.marque-sous-titre { font-size: clamp(12px, .92vw, 15px); color: var(--texte-doux); letter-spacing: .01em; }

.bouton-sans-ia {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px;
  background: rgba(13, 15, 30, 0.55);
  border: 1px solid rgba(241, 232, 218, 0.32);
  backdrop-filter: blur(10px);
  font-size: 14px; font-weight: 500; color: var(--creme);
  transition: background .3s ease, border-color .3s ease, color .3s ease;
}
.bouton-sans-ia svg { width: 18px; height: 18px; }
.bouton-sans-ia:hover { border-color: var(--or); }
.bouton-sans-ia[aria-pressed="true"] { background: var(--or); color: #1a1624; border-color: var(--or); }

/* ---------------- Bulle de Shad'Owl ---------------- */
.bulle {
  position: fixed; z-index: 15;
  width: max-content;               /* sinon la bulle rétrécit près du bord droit de l'écran */
  max-width: min(320px, 70vw);
  padding: 16px 20px;
  border-radius: 20px;
  background: rgba(16, 18, 36, 0.82);
  border: 1px solid rgba(214, 176, 122, 0.35);
  box-shadow: var(--ombre);
  backdrop-filter: blur(12px);
  color: var(--creme);
  font-size: 15px; line-height: 1.5;
  transform: translate(-50%, -100%);
  animation: bulle-entree .45s cubic-bezier(.2, .8, .2, 1);
}
/* petite pointe vers la tête de Shad'Owl */
.bulle::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(16, 18, 36, 0.92);
  border-right: 1px solid rgba(214, 176, 122, 0.35); border-bottom: 1px solid rgba(214, 176, 122, 0.35);
}
.bulle::before {
  content: "Shad’Owl"; display: block; margin-bottom: 4px;
  font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--or);
}

/* ---------------- Animations ---------------- */
@keyframes respiration { 0%, 100% { transform: scale(1.035); } 50% { transform: scale(1.06); } }
@keyframes vacille {
  0%, 100% { opacity: .75; transform: translate(-50%, -50%) scale(1); }
  40% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  70% { opacity: .82; transform: translate(-50%, -50%) scale(.97); }
}
@keyframes scintille { 0%, 70%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 80% { opacity: .9; transform: translate(-50%, -50%) scale(1.2); } }
@keyframes pouls { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@keyframes bulle-entree { from { opacity: 0; transform: translate(-50%, -100%) translateY(10px) scale(.96); } }

@media (prefers-reduced-motion: reduce) {
  .decor-cadre, .lueur, .eclat, body.ecoute .chouette-ecoute { animation: none !important; }
  .decor-parallaxe { transition: none; }
}

/* ---------------- Changement de décor (accueil / salle d'exposition) ----------------
   body[data-decor] est posé par chaque scène (js/scenes/*.js, dans entrer()). */
.decor-cadre { transition: opacity 1s ease; }
.decor-salle { --focus-x: 0.5; opacity: 0; }
body[data-decor="salle"] .decor-accueil { opacity: 0; }
body[data-decor="salle"] .decor-salle { opacity: 1; }
body[data-decor="salle"] .decor-voile {
  background:
    linear-gradient(90deg, rgba(11, 13, 28, 0.72) 0%, rgba(11, 13, 28, 0.35) 28%, rgba(11, 13, 28, 0) 45%),
    linear-gradient(0deg, rgba(9, 10, 22, 0.75) 0%, rgba(9, 10, 22, 0) 25%),
    linear-gradient(180deg, rgba(9, 10, 22, 0.55) 0%, rgba(9, 10, 22, 0) 18%);
}

/* Hologramme dans la vitrine (positions en % de salle-vitrine.jpg, 1776 x 1000) */
.vitrine-hologramme {
  position: absolute; left: 50.1%; top: 59%; width: 13%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid; place-items: center;
  color: #ffe2a8;
  filter: drop-shadow(0 0 10px rgba(255, 210, 140, .9)) drop-shadow(0 0 28px rgba(255, 190, 110, .55));
  perspective: 600px;
  pointer-events: none;
}
.vitrine-hologramme svg {
  width: 72%; height: 72%;
  animation: hologramme 9s ease-in-out infinite;
  transform-style: preserve-3d;
}
.vitrine-hologramme.change svg { animation: hologramme-apparition .9s cubic-bezier(.2, .8, .2, 1), hologramme 9s ease-in-out .9s infinite; }
.vitrine-faisceau {
  position: absolute; left: 50.1%; top: 47%; width: 17%; height: 24.5%;
  transform: translateX(-50%);
  background: linear-gradient(0deg, rgba(255, 214, 150, .42) 0%, rgba(255, 214, 150, .12) 45%, transparent 100%);
  clip-path: polygon(18% 100%, 82% 100%, 100% 0, 0 0);
  mix-blend-mode: screen; pointer-events: none;
  animation: faisceau 4s ease-in-out infinite;
}
@keyframes hologramme {
  0%, 100% { transform: translateY(0) rotateY(-18deg); }
  50% { transform: translateY(-6%) rotateY(18deg); }
}
@keyframes hologramme-apparition { from { opacity: 0; transform: translateY(14%) scale(.6); filter: blur(6px); } }
@keyframes faisceau { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .vitrine-hologramme svg, .vitrine-faisceau { animation: none !important; }
}
.vitrine-hologramme.futur {
  color: #d6e4ff;
  filter: drop-shadow(0 0 10px rgba(150, 190, 255, .9)) drop-shadow(0 0 28px rgba(140, 170, 255, .55));
}
