/*
 * ════════════════════════════════════════════════════════════
 *  Layout gallery — ART AU FÉMININ
 *  Chargé par : layouts/gallery.html.erb
 *  Utilisé par : galerie#accueil (/), galerie#show
 * ════════════════════════════════════════════════════════════
 */

body {
  overflow: hidden;
  background: var(--foreground);
  font-family: var(--font-serif);
  animation: body-fadein 150ms ease both;
}

@keyframes body-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#galerie-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#galerie-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

#galerie-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

/* Drawn by the CPU (gallery/software_renderer.ts): without a GPU, the browser blurs what lies
   behind a glass panel again on every frame the scene moves, a frame's whole budget. The
   panels keep their tint, opaque enough to read on. */
#galerie-wrapper.is-software-rendered * {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ── Loading screen: the arrival view draws itself, then fades out on the scene ── */

.chargement {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  container-type: size;   /* the drawing below takes its size from the screen height */
  background: var(--background);
  /* Fade-out (is-done), once the door's last line has landed */
  transition: opacity 0.4s ease-out 0.3s;
}

/* The arrival view (galerie/_scene_trait), traced from the scene: as tall as the screen and centred,
   like the camera's fixed vertical field of view, so each line lies on what it reveals */
.chargement-scene {
  position: absolute;
  top: 0;
  left: 50%;
  width: 300cqh;   /* viewBox 6000 × 2000 */
  max-width: none;   /* wider than the screen: base.css caps svg at 100 % */
  height: 100cqh;
  translate: -50% 0;
  color: var(--foreground);
  animation: chargement-trace 1.2s ease-out both;
}

/* --progress (0 to 1, galerie#_setLoadProgress) draws each line between its own --from and --to.
   --intro draws the ground and wall lines before the gallery script has even arrived. */
@property --intro {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@keyframes chargement-trace { to { --intro: 0.15; } }
/* While the shaders compile (no progress to follow), the door draws itself, slowing as it nears the end */
.chargement.is-compiling .chargement-scene { animation: chargement-porte 2.5s cubic-bezier(0.2, 0, 0, 1) both; }
@keyframes chargement-porte { from { --intro: 0.85; } to { --intro: 0.97; } }

.chargement-scene path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: clamp(0, calc((var(--to) - max(var(--progress, 0), var(--intro))) / (var(--to) - var(--from))), 1);
  transition: stroke-dashoffset 0.3s ease-out;
}

/* In the sky above the wall line (31 % of the height) */
.chargement-texte {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  height: 31%;
  padding: 0 var(--space-6);
}

.chargement-titre {
  max-width: 26ch;
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
  text-align: center;
  text-wrap: balance;
  color: var(--foreground);
  animation: chargement-in 0.9s ease both;
}

.chargement-statut {
  display: flex;
  gap: var(--space-3);
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--muted-foreground);
  animation: chargement-in 0.9s ease 0.2s both;
}
.chargement-pourcent { font-variant-numeric: tabular-nums; }

/* Held on their first frame until the serif face is loaded */
.chargement:not(.is-font-ready) :is(.chargement-scene, .chargement-titre, .chargement-statut) { animation-play-state: paused; }

.chargement.is-done { opacity: 0; pointer-events: none; }

@keyframes chargement-in {
  from { opacity: 0; transform: translateY(var(--space-2)); }
  to   { opacity: 1; transform: none; }
}

/* If the gallery script never runs, the veil still lifts */
.chargement { animation: chargement-secours 0s linear 20s forwards; }
@keyframes chargement-secours { to { opacity: 0; visibility: hidden; } }

.chargement[hidden] { display: none; }

/* The drawing still follows the loading, in steps; the veil still cross-fades */
@media (prefers-reduced-motion: reduce) {
  .chargement-scene, .chargement.is-compiling .chargement-scene { animation: none; --intro: 0.15; }
  .chargement-scene path { transition: none; }
  .chargement-titre, .chargement-statut { animation: none; }
}

/* ── Entrance caption (forecourt, before the visit starts) ── */

#entree-hint {
  position: fixed;
  bottom: var(--space-10);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - var(--space-8));
  padding: var(--space-4) var(--space-6);
  text-align: center;
  /* Glassmorphism (design.md): the caption floats over the door */
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  pointer-events: none;
  user-select: none;
  z-index: 20;
  transition: opacity 0.6s ease;
}

#entree-hint.is-leaving,
#galerie-wrapper:has(#intro-overlay:not(.is-leaving)) #entree-hint {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0s 0.6s;
}

/* Page H1: names the site for visitors and search engines without covering the door */
.entree-title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-serif);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--muted-foreground);
}

.entree-cta {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-widest);
  color: var(--muted-foreground);
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  animation: hint-pulse 3s ease-in-out infinite;
}

.entree-cta:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .entree-cta { animation: none; opacity: 1; }
}

/* ── Top-left panel: time of day + navigation (replaces the site header) ── */

/* ── Degraded mode: the CPU draws the gallery (gallery/software_renderer.ts) ──
   A calm note on the accent edge, like the other notices; in the panel and the intro card */

.degraded-notice { display: none; }
.is-software-rendered .degraded-notice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  background: var(--accent-tint);
  border-left: 2px solid var(--accent);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--foreground);
}
.degraded-notice svg { flex-shrink: 0; width: 18px; height: 18px; color: var(--accent); }
.degraded-notice a { color: var(--accent); text-underline-offset: 0.2em; }

.panneau {
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  /* Above the pause menu (80): time and navigation stay usable while paused */
  z-index: 85;
  width: min(18.5rem, calc(100vw - var(--space-8)));
  padding: var(--space-5) var(--space-6) var(--space-6);
  /* Same dark glass as the intro card: --card inside .dark, --glass-* */
  background: var(--card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--glass-radius);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--border);
  font-family: var(--font-sans);
  color: var(--foreground);
}

.panneau-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.panneau-brand {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
}
.panneau-brand span { color: var(--accent); }

.panneau-toggle {
  display: grid;
  place-items: center;
  width: var(--space-8);
  height: var(--space-8);
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--foreground);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-base);
}
.panneau-toggle svg { width: var(--space-4); height: var(--space-4); }
.panneau-toggle:hover { background: var(--muted); color: var(--foreground); }
.panneau.is-collapsed .panneau-toggle { transform: rotate(-90deg); }

.panneau-clock {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.panneau-icon {
  display: grid;
  width: var(--space-8);
  height: var(--space-8);
  color: var(--accent);
}
.panneau-icon svg { width: 100%; height: 100%; }

.panneau-time {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.panneau-phase {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.panneau-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.panneau.is-collapsed .panneau-body { display: none; }

/* Degraded mode: a card of its own at the foot of the panel, collapsed or not. Solid
   --foreground, the contrast of the banners (tokens.css), to stand out of the dark glass */
.is-software-rendered .degraded-notice--card {
  align-items: flex-start;
  margin-top: var(--space-5);
  padding: var(--space-4);
  border-left: 0;
  border-radius: var(--radius-lg);
  background: var(--foreground);
  color: var(--background);
}
.degraded-notice--card svg { width: var(--space-5); height: var(--space-5); color: var(--background); }
.degraded-notice--card a { color: var(--background); font-weight: 600; }
.panneau .degraded-notice--card a:focus-visible { outline-color: var(--background); }

.panneau-row,
.panneau-chips,
.panneau-presets {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.panneau-chips {
  padding: var(--space-1);
  background: var(--muted);
  border-radius: var(--radius-pill);
}
.panneau-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-1);
}
.panneau-presets .panneau-chip { padding-inline: 0; }

/* Chips: .dark secondary buttons; active = .dark default (light) */
.panneau-chip {
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  color: var(--foreground);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  font-variant-numeric: tabular-nums;
}
.panneau-chips .panneau-chip { background: none; }
.panneau-chip:hover { background: var(--secondary); color: var(--foreground); }
.panneau-chip.is-active {
  background: var(--foreground);
  color: var(--background);
}
.panneau-chip-icon {
  display: grid;
  place-items: center;
  width: var(--space-8);
  height: var(--space-8);
  padding: 0;
}
.panneau-chip-icon svg { width: var(--space-4); height: var(--space-4); }

/* Time slider: the track runs night → dawn → day → golden hour → night */
.panneau-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: var(--space-2);
  margin: var(--space-2) 0 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg,
    var(--background) 0%, var(--accent) 27%, var(--foreground) 45%,
    var(--accent) 75%, var(--background) 100%);
  cursor: pointer;
}
.panneau-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--space-5);
  height: var(--space-5);
  border-radius: 50%;
  background: var(--foreground);
  border: 3px solid var(--accent);
  box-shadow: var(--shadow-lg);
}
.panneau-slider::-moz-range-thumb {
  width: var(--space-5);
  height: var(--space-5);
  border-radius: 50%;
  background: var(--foreground);
  border: 3px solid var(--accent);
  box-shadow: var(--shadow-sm);
}

.panneau-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: calc(-1 * var(--space-1));
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

/* Navigation: Inter labels in capitals (design.md), set apart by space, never a line */
.panneau-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-3);
}
.panneau-nav a,
.panneau-nav button {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--foreground);
  cursor: pointer;
  transition: color var(--transition-fast);
}
.panneau-nav a:hover,
.panneau-nav button:hover { color: var(--foreground); }
/* The panel's call to action, below the links */
.panneau-cta { margin-top: var(--space-2); }

.panneau button:focus-visible,
.panneau a:focus-visible,
.panneau-slider:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: var(--focus-offset);
}

/* ── HUD ─────────────────────────────────────────────── */

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

#hud-audio-player {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 20;
  pointer-events: all;
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0.5px solid var(--input);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  min-width: 220px;
  max-width: 280px;
}

#hud-audio-label {
  display: block;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.4rem;
  font-family: var(--font-serif);
}

#hud-audio-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.hud-audio-progress {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  background: var(--secondary);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.hud-audio-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--foreground);
  cursor: pointer;
  margin-top: -3.5px;
}
.hud-audio-progress::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--foreground);
  border: none;
  cursor: pointer;
}

.hud-audio-time {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  white-space: nowrap;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* ── En-tête (partial layouts/_header, styles dans nav.css) ── */
/* Sous le menu pause (80) et le modal catalogue (100), au-dessus de l'intro (60). */

/* ── Cartel: styles live in components/cartel.css ────── */

/* The cartel lives inside #hud (z-index 10): the crosshair would sit on top of it */
body:has(.cartel.visible) #crosshair { display: none; }

/* ── Crosshair ───────────────────────────────────────── */

#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: transparent;
  border: 2px solid var(--background);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--muted-foreground);
  pointer-events: none;
  z-index: 15;
}

#crosshair::before,
#crosshair::after {
  display: none;
}

/* Something to click under the crosshair: the mouse icon at its lower right, drawn
   like the crosshair (dark stroke, light halo) */
.click-hint {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 24px;
  transform: translate(10px, 4px);
  color: var(--background);
  filter: drop-shadow(0 0 1px var(--foreground));
  opacity: 0;
  transition: opacity 120ms ease-out;
  pointer-events: none;
  z-index: 15;
}

.click-hint.is-visible { opacity: 1; }

/* Bolder than the intro's drawing: it sits on a busy 3D scene, at a small size */
.click-hint rect,
.click-hint line:first-of-type { stroke-width: 2.8; }

body:has(.cartel.visible) .click-hint { display: none; }

#audio-oeuvre {
  display: none;
}

/* ── Menu pause ──────────────────────────────────────── */

#pointer-lock-msg {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  background: var(--overlay);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#pointer-lock-msg.hidden { display: none; }

.pause-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 2.8rem 3rem;
  border-radius: 24px;
  background: var(--card);
  box-shadow:
    var(--shadow-md),
    inset 0 0 0 1px var(--border);
  min-width: 300px;
}

.pause-title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--foreground);
  letter-spacing: var(--tracking-tight);
  margin-bottom: 2rem;
  text-align: center;
}

.pause-actions {
  display: grid;          /* boutons .btn pleine largeur */
  gap: var(--space-3);
  width: 100%;
}

/* ── Pause audioguide ────────────────────────────────── */

.pause-audio-activate { width: 100%; margin-bottom: 0.65rem; }
.pause-audio-section {
  width: 100%;
  margin-bottom: 1.4rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--muted);
  box-shadow: inset 0 0 0 1px var(--border);
}

.pause-audio-label {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.6rem;
}

.pause-audio-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pause-audio-progress {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: var(--secondary);
  cursor: pointer;
  accent-color: var(--foreground);
}
.pause-audio-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--foreground);
  cursor: pointer;
}

.pause-audio-time {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  white-space: nowrap;
  min-width: 3.2rem;
  text-align: right;
}

/* ── Joystick mobile ─────────────────────────────────── */

#mobile-joystick {
  display: none;
  position: fixed;
  bottom: 2.5rem;
  left: 2rem;
  z-index: 30;
  pointer-events: none;
}

.joystick-base {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--muted);
  border: 1.5px solid var(--input);
  display: flex;
  align-items: center;
  justify-content: center;
}

#mobile-stick {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--secondary);
  border: 1.5px solid var(--input);
  transition: transform 0.05s linear;
}

#mobile-tap-hint {
  position: fixed;
  bottom: 3rem;
  right: 2rem;
  z-index: 30;
  display: none;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted-foreground);
  pointer-events: none;
  text-align: center;
}

/* ── Focus & accessibilité ───────────────────────────── */

/* Anneau de focus clair sur fond sombre (base.css le définit en encre) */
:focus-visible { outline-color: var(--ring); }

/* ── Responsive ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}

@media (max-width: 768px) {
  #crosshair, .click-hint { display: none; }

  .pause-panel { padding: 2rem 1.5rem; min-width: 260px; }
  .pause-title { font-size: var(--text-lg); }
}

@media (max-width: 480px) {
  .pause-panel { min-width: unset; width: 90vw; }
}

/* ── Intro card and merci overlay (galerie#show and #visite) ── */

/*
 * ════════════════════════════════════════════════════════════
 *  Galerie show — ART AU FÉMININ
 *  Chargé par : galerie/show.html.erb
 * ════════════════════════════════════════════════════════════
 */

/* ── Notification clé / porte ────────────────────────── */

.found-notification {
  position: fixed;
  bottom: 2.5rem;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  color: var(--accent);
  font: italic 1rem var(--font-serif);
  letter-spacing: var(--tracking-normal);
  padding: 0.7rem 1.6rem;
  border-radius: 3px;
  border: 1px solid var(--input);
  pointer-events: none;
  opacity: 0;
  transition: opacity 500ms ease;
  z-index: 90;
  white-space: nowrap;
}

.found-notification.is-visible { opacity: 1; }

/* ── Bulle de BD — porte secrète ─────────────────────── */

.found-notification.speech-bubble {
  background: var(--background);
  color: var(--foreground);
  border: 2.5px solid var(--accent);
  border-radius: 18px;
  padding: 0.75rem 1.1rem;
  font-style: italic;
  font-size: var(--text-base);
  letter-spacing: var(--tracking-normal);
  max-width: 230px;
  white-space: normal;
  text-align: center;
  line-height: 1.5;
  box-shadow: 3px 4px 0 var(--border);
}

/* Queue extérieure (bordure) */
.found-notification.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  border: 16px solid transparent;
  border-top-color: var(--accent);
  border-bottom: 0;
}

/* Queue intérieure (remplissage) */
.found-notification.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  border: 11px solid transparent;
  border-top-color: var(--background);
  border-bottom: 0;
  z-index: 1;
}

/* ── Overlay intro ────────────────────────────────────── */

#intro-overlay {
  position: fixed;
  inset: 0;
  /* Above the top-left panel (85) while the visitor reads */
  z-index: 88;
  background: var(--overlay);
  overflow-y: auto;
  transition: opacity 600ms ease;
}

#intro-overlay.is-leaving {
  opacity: 0;
  pointer-events: none;
}

/* ── Intro card: one dark glass card, the hero above, the controls below ── */

.expo-intro {
  min-height: 100%;
  padding: 4rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.intro-card {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--glass-radius);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--border);
  background: var(--card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.intro-hero {
  position: relative;
  display: flex;
  height: min(58vh, 580px);
}

.slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
  filter: brightness(0.36);
}

.slide-overlay {
  position: absolute;
  inset: 0;
  background:
    var(--gradient-overlay);
}

.slide-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 2.4rem;
  display: flex;
  flex-direction: column;
}

/* Hero : deux colonnes — expo à gauche, audioguide à droite */

.hero-content {
  display: grid;
  grid-template-columns: 1fr 290px;
  align-items: stretch;
  padding: 0;
  gap: 0;
}

.hero-main {
  padding: 2.4rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.slide-kicker {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.slide-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
  color: var(--foreground);
  font-size: var(--text-4xl);
  max-width: 8ch;
}

.slide-subtitle {
  margin: 1rem 0 0;
  max-width: 560px;
  color: var(--foreground);
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1.7;
  font-size: var(--text-base);
}

.slide-meta {
  margin-top: 1.1rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  font-size: var(--text-sm);
}

/* Close: top right corner of the card */
.intro-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 3;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Degraded mode, above the controls: the card's own inset */
.is-software-rendered .intro-card .degraded-notice { padding: var(--space-4) 2.4rem; }

/* ── Controls and the way in, at the foot of the card ── */
/* A tonal step down from the card instead of a dividing line */

.intro-controles {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-5) 2.4rem;
  background: var(--muted);
}

.intro-touches {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin: 0;
  padding: 0;
  list-style: none;
}

.intro-touche {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.intro-touche .nav-key { width: 26px; height: 26px; }
.intro-touche .nav-key--escape { width: 52px; }
.intro-touche .nav-icon { width: 20px; height: 30px; }

.nav-keys {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.nav-key-row { display: flex; gap: 0.3rem; }

.nav-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--muted);
  box-shadow:
    inset 0 0 0 1px var(--input),
    0 2px 0 var(--overlay);
  color: var(--foreground);
  font-family: var(--font-serif);
  font-size: var(--text-xs);
  font-style: normal;
}

/* Arrow keys (partial galerie/_arrow): one glyph, turned per direction */
.arrow-glyph { width: 12px; height: 12px; }
.arrow-glyph--right { transform: rotate(90deg); }
.arrow-glyph--down  { transform: rotate(180deg); }
.arrow-glyph--left  { transform: rotate(-90deg); }

.nav-key--escape { width: 58px; height: 32px; font-size: var(--text-xs); letter-spacing: var(--tracking-wide); }

.nav-icon { width: 26px; height: 40px; color: var(--foreground); }
.intro-touche .nav-icon--geste { width: 30px; height: 30px; }

/* The in-scene joystick (#mobile-joystick), in miniature */
.nav-joystick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--muted);
  border: 1.5px solid var(--input);
}

.nav-joystick span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--secondary);
  border: 1.5px solid var(--input);
}

.nav-label {
  margin: 0;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted-foreground);
  text-align: center;
  line-height: 1.4;
}

/* The gesture under a touch label: the how, in the card's italic aside */
.nav-hint {
  display: block;
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-style: italic;
  letter-spacing: normal;
  text-transform: none;
  color: var(--foreground);
}

/* ── Overlay merci (sortie galerie) ───────────────────── */

#merci-overlay {
  position: fixed;
  inset: 0;
  /* End of the visit: above the top-left panel (85), below the loading screen (100) */
  z-index: 95;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--background);
  opacity: 0;
  transition: opacity 600ms ease;
}

#merci-overlay.is-visible { opacity: 1; }

.merci-retour {
  font: 0.75rem/1 var(--font-sans);
  letter-spacing: var(--tracking-wide);
  color: var(--accent);
  text-decoration: none;
  transition: color 200ms;
  margin-top: 0.5rem;
}

.merci-retour:hover { color: var(--accent); }

@media (max-width: 900px) {
    .intro-hero { height: auto; min-height: min(70vh, 640px); }
    .slide-content { padding: 1.4rem; }
    .hero-content { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
    .intro-controles { padding: var(--space-4) 1.4rem; }
    .is-software-rendered .intro-card .degraded-notice { padding: var(--space-4) 1.4rem; }
}

/* Touch screens (same test as the controller's isMobile): the touch list replaces the keys */
.intro-touches--tactile { display: none; }

@media not all and (hover: hover) and (pointer: fine) {
    .intro-touches--clavier { display: none; }
    .intro-touches--tactile { display: flex; }
}

@media (max-width: 768px) {
    .intro-touches--clavier { display: none; }
    .intro-controles { flex-direction: column; justify-content: center; gap: var(--space-4); }
    .intro-touches--tactile { width: 100%; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
    .intro-touches--tactile .intro-touche { flex: 1; flex-direction: column; gap: var(--space-2); }
}

@media (max-width: 480px) {
    /* padding-top kept at 4rem to clear the fixed top panel */
    .expo-intro { padding: 4rem 1rem 1.5rem; }
    .intro-card { border-radius: 16px; }
    .intro-hero { min-height: 0; }
    .slide-content { padding: 1rem; }
    .slide-title { font-size: var(--text-2xl); max-width: 100%; }
    .slide-kicker { font-size: var(--text-xs); margin-bottom: 0.6rem; }
    .intro-controles .btn { width: 100%; }
}

/* Dialog : le catalogue reçoit .dark (layouts/gallery.html.erb), aucune surcharge ici */
