/* ==========================================================================
   Pascal Sun — visionneuse immersive
   Vue 3D (toile + tranche + dos), réalité augmentée caméra, mise en
   situation salon à l'échelle.
   ========================================================================== */

.viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  background: color-mix(in srgb, var(--ink) 96%, transparent);
  color: var(--paper);
}
.viewer-modal.open { display: flex; }

.viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(18px, 3vw, 40px);
  border-bottom: 1px solid rgba(247, 243, 236, .14);
}
.viewer-top h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(18px, 2.4vw, 26px); }
.viewer-top h2 span { color: var(--accent-soft); font-style: italic; }

.viewer-close {
  background: none;
  border: 1px solid rgba(247, 243, 236, .35);
  color: var(--paper);
  border-radius: 999px;
  width: 44px; height: 44px;
  font-size: 20px;
  cursor: pointer;
  transition: .25s;
}
.viewer-close:hover { background: var(--accent); border-color: var(--accent); }

.viewer-tabs {
  display: flex;
  gap: 8px;
  padding: 14px clamp(18px, 3vw, 40px) 0;
  flex-wrap: wrap;
}
.viewer-tab {
  background: none;
  border: 1px solid rgba(247, 243, 236, .25);
  color: rgba(247, 243, 236, .75);
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: .25s;
}
.viewer-tab:hover { border-color: var(--paper); color: var(--paper); }
.viewer-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.viewer-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 20px;
}
.viewer-pane { position: absolute; inset: 0; display: none; place-items: center; }
.viewer-pane.active { display: grid; }

.viewer-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12.5px;
  letter-spacing: .06em;
  color: rgba(247, 243, 236, .75);
  background: rgba(22, 19, 15, .55);
  border: 1px solid rgba(247, 243, 236, .16);
  padding: 9px 18px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* ------------------------------------------------------------ vue 3D -- */

.v3d-scene {
  perspective: 1400px;
  touch-action: none;
  cursor: grab;
}
.v3d-scene:active { cursor: grabbing; }

.canvas3d {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .18s ease-out;
}
.canvas3d .face {
  position: absolute;
  background-color: #f6f1e8;
  backface-visibility: hidden;
}
.canvas3d .face.front { box-shadow: 0 0 0 1px rgba(0,0,0,.12) inset; }
.canvas3d .face.back {
  background:
    linear-gradient(90deg, transparent 46%, rgba(22,19,15,.16) 46%, rgba(22,19,15,.16) 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, rgba(22,19,15,.16) 46%, rgba(22,19,15,.16) 54%, transparent 54%),
    linear-gradient(#e5d9c3, #dccfb6);
  display: grid;
  place-items: end center;
}
.canvas3d .face.back::after {
  content: "Pascal Sun — Tahiti";
  font-family: var(--serif);
  font-style: italic;
  color: rgba(22, 19, 15, .55);
  font-size: 13px;
  padding-bottom: 10px;
}
.canvas3d .edge { filter: brightness(.82); }

.v3d-presets {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.v3d-presets button {
  background: rgba(247, 243, 236, .08);
  border: 1px solid rgba(247, 243, 236, .25);
  color: rgba(247, 243, 236, .85);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: .25s;
}
.v3d-presets button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* --------------------------------------------------------------- AR -- */

.ar-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ar-art {
  position: absolute;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 22px 60px -18px rgba(0, 0, 0, .65);
  border: 6px solid #1a140f;
  border-image: linear-gradient(135deg, #26201a, #15100c, #1d1712) 1;
  background: #1a140f;
}
.ar-art:active { cursor: grabbing; }
.ar-art img { width: 100%; height: 100%; pointer-events: none; }

.ar-controls {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(22, 19, 15, .6);
  border: 1px solid rgba(247, 243, 236, .16);
  border-radius: 999px;
  padding: 10px 20px;
}
.ar-controls label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(247,243,236,.8); }
.ar-controls input[type="range"] { width: min(220px, 40vw); accent-color: var(--accent); }

.ar-fallback {
  max-width: 520px;
  text-align: center;
  padding: 30px;
}
.ar-fallback h3 { font-family: var(--serif); font-size: 26px; font-weight: 500; margin-bottom: 12px; }
.ar-fallback p { color: rgba(247, 243, 236, .75); font-size: 15px; margin-bottom: 22px; }

.btn-light {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 13px 26px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: .25s;
}
.btn-light:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* -------------------------------------------------------- salon réel -- */

.room-wrap {
  position: relative;
  width: min(1020px, 94vw);
}
.room-wrap svg { width: 100%; height: auto; display: block; border-radius: 6px; }
.room-art {
  position: absolute;
  border: 3px solid #1a140f;
  background: #1a140f;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55);
}
.room-art img { width: 100%; height: 100%; display: block; }

/* boutons d'ouverture sur la fiche œuvre */
.viewer-launch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.viewer-launch button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 20px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: .25s;
}
.viewer-launch button:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.viewer-launch .ico { color: var(--accent); font-size: 15px; }

@media (max-width: 640px) {
  .viewer-tabs { padding-top: 10px; }
  .ar-controls { bottom: 76px; padding: 8px 14px; }
}
