/* ------------------------------------------------------------------
   Galerie Urbaine — MVP WebAR
   Base sobre, pensée pour être lue dehors, en plein jour, à bout de bras.
   Tout l'habillage tient dans ce fichier : couleurs, rythme, typographie.
   ------------------------------------------------------------------ */

:root {
  --bg:        #101114;
  --surface:   #181a1f;
  --line:      #2b2e36;
  --text:      #f3f4f6;
  --muted:     #9aa1ad;

  /* Remplacé à l'exécution par le themeColor du canal actif */
  --accent:    #e7e3da;
  --on-accent: #101114;

  --pad: 20px;
  --radius: 14px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

body {
  min-height: 100svh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

[hidden] { display: none !important; }

/* ----------------------------------------------------- écran d'attente */

.splash {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  background: var(--bg);
  z-index: 50;
}

.splash__mark {
  width: 34px;
  height: 34px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .splash__mark { animation-duration: 3s; }
}

.splash__text {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* ------------------------------------------------------------ erreur */

.error {
  padding: 48px var(--pad);
  max-width: 34rem;
  margin: 0 auto;
}

.error__title { font-size: 22px; margin: 0 0 10px; }
.error__text  { color: var(--muted); line-height: 1.6; margin: 0; }

/* --------------------------------------------------------------- app */

.app {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 var(--pad) 40px;
}

/* -------------------------------------------------------------- lieu */

.place { padding: 28px 0 18px; }

.place__label {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.place__name {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}

/* ------------------------------------------------------------ canaux */

.channels {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
  scrollbar-width: none;
}

.channels::-webkit-scrollbar { display: none; }

.channel {
  flex: 0 0 auto;
  padding: 9px 16px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.channel[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

/* -------------------------------------------------------------- scène */

.stage { margin-bottom: 24px; }

model-viewer {
  display: block;
  width: 100%;
  height: 58svh;
  min-height: 300px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  --poster-color: transparent;
}

/* Bouton AR : la cible la plus grosse de l'écran, volontairement */
.ar-button {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  min-height: 52px;
  white-space: nowrap;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.ar-button:active { transform: translateX(-50%) scale(0.97); }

.ar-button__icon {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
  transform: rotate(45deg);
}

.ar-unavailable {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.progress {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 120ms linear;
}

.progress[slot="progress-bar"]:not([style*="block"]) { opacity: 1; }

/* ------------------------------------------------------- fiche œuvre */

.sheet__title {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.sheet__artist {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
}

.sheet__desc {
  margin: 0 0 20px;
  line-height: 1.65;
  font-size: 16px;
}

.sheet__instruction {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.55;
  font-size: 15px;
}

.cta {
  display: inline-block;
  padding: 13px 22px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.sheet__meta {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* ------------------------------------------------- écrans plus larges */

@media (min-width: 820px) {
  model-viewer { height: 64svh; }
  .place { padding-top: 40px; }
}
