:root {
  --bg: #0e1013;
  --glass: rgba(14, 16, 19, 0.58);
  --glass-strong: rgba(14, 16, 19, 0.82);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f4f5f7;
  --muted: rgba(244, 245, 247, 0.66);
  --accent: #e8b04a;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }

#viewer { position: fixed; inset: 0; }
/* the last frame of the room you walk out of, grown and faded over the next one (tour.js stepInto) */
.ghost { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; transform-origin: 50% 50%; will-change: transform, opacity; }
.psv-container { background: var(--bg) !important; }
.psv-loader-container { display: none !important; }

/* ---------- splash ---------- */
.splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at center, rgba(14,16,19,.35), rgba(14,16,19,.85));
  transition: opacity .7s var(--ease), visibility .7s; }
.splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }
body.intro .strip, body.intro .psv-markers, body.intro .credit { opacity: 0; pointer-events: none; }
.strip, .psv-markers, .credit { transition: opacity .6s var(--ease); }
.splash-inner { text-align: center; max-width: 520px; }
.splash h1 { font-size: clamp(34px, 7vw, 58px); font-weight: 600; letter-spacing: -.02em; margin: 6px 0 8px; line-height: 1.05; }
.splash-sub { color: var(--muted); margin: 0; font-size: 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 600; color: var(--accent); margin: 0; }
.splash-progress { margin: 28px auto 0; width: 160px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.splash-progress span { display: block; height: 100%; width: 0; background: var(--text); transition: width .3s; }

/* ---------- hotspots ---------- */
/* a small dot that breathes gently; the room's name appears only while the pointer is on it */
.hs { position: relative; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; user-select: none; }
.hs-dot { width: 13px; height: 13px; border-radius: 50%; background: rgba(255, 255, 255, .94);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .28), 0 2px 8px rgba(0, 0, 0, .35); animation: breathe 2.8s ease-in-out infinite;
  transition: transform .2s var(--ease); }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 255, 255, .28), 0 2px 8px rgba(0, 0, 0, .35); }
  50% { box-shadow: 0 0 0 7px rgba(255, 255, 255, .07), 0 2px 8px rgba(0, 0, 0, .35); }
}
.hs:hover .hs-dot { transform: scale(1.3); animation-play-state: paused; }
.hs-text { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translate(-50%, 4px); opacity: 0; pointer-events: none;
  display: flex; align-items: baseline; gap: 6px; white-space: nowrap; padding: 5px 11px; border-radius: 999px;
  background: var(--glass-strong); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 500; color: #fff; transition: opacity .18s, transform .18s var(--ease); }
.hs-text small { font-size: 11px; color: var(--muted); }
.hs:hover .hs-text { opacity: 1; transform: translate(-50%, 0); }

/* cursor ring that follows the pointer on the floor */
.floor-cursor { position: fixed; z-index: 12; left: 0; top: 0; pointer-events: none; opacity: 0; transition: opacity .15s; }
.floor-cursor.show { opacity: 1; }
.fc-ring { position: absolute; width: var(--w, 60px); height: var(--h, 20px); transform: translate(-50%, -50%); border-radius: 50%;
  border: 2px solid rgba(255,255,255,.85); background: rgba(255,255,255,.12); box-shadow: 0 0 10px rgba(0,0,0,.35); }
.floor-cursor.go .fc-ring { border-color: var(--accent); background: rgba(232,176,74,.18); }
.fc-label { position: absolute; left: 14px; top: 14px; white-space: nowrap; font-size: 12px; font-weight: 500; background: var(--glass-strong);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; opacity: 0; }
#viewer.walkable .psv-canvas-container { cursor: none; }

/* ---------- strip: a slim bar on the bottom edge ---------- */
.strip { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; }
.strip-toggle { display: inline-flex; align-items: center; gap: 6px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; padding: 4px 10px 3px 14px; font-size: 12px; font-weight: 500; color: var(--muted); }
.strip-toggle svg { width: 16px; height: 16px; transition: transform .3s var(--ease); transform: rotate(180deg); }
.strip.collapsed .strip-toggle svg { transform: none; }
.strip.collapsed .strip-toggle { margin-bottom: var(--safe-b); }
.strip-body { width: 100%; display: flex; align-items: center; gap: 4px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 6px 10px calc(6px + var(--safe-b)); }
.strip.collapsed .strip-body { display: none; }
.strip-arrow { width: 28px; height: 62px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); flex: none; }
.strip-arrow:hover { background: rgba(255,255,255,.08); color: var(--text); }
.strip-scroll { flex: 1; display: flex; justify-content: safe center; gap: 6px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; min-width: 0; }
.strip-scroll::-webkit-scrollbar { display: none; }
.group { display: flex; flex-direction: column; gap: 4px; flex: none; }
.group + .group { padding-left: 6px; border-left: 1px solid var(--line); }
.group-name { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding-left: 2px; }
.group-items { display: flex; gap: 5px; }
.thumb { position: relative; width: 104px; height: 58px; border-radius: 7px; overflow: hidden; flex: none; outline: 2px solid transparent; outline-offset: -2px;
  transition: outline-color .2s, opacity .2s; opacity: .82; }
.thumb:hover, .thumb.active { opacity: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 6px 4px; font-size: 10.5px; font-weight: 500; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb.active { outline-color: var(--text); }
.thumb.active::after { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- credit: small text, bottom right, just above the strip (tour.js keeps --strip-h current) ---------- */
.credit { position: fixed; z-index: 19; right: 14px; bottom: calc(var(--strip-h, 96px) + 8px); font-size: 11px; letter-spacing: .02em;
  color: rgba(255,255,255,.72); text-decoration: none; text-shadow: 0 1px 3px rgba(0,0,0,.6); transition: color .2s, opacity .6s var(--ease); }
.credit:hover { color: #fff; }

/* ---------- edit-mode coordinates ---------- */
.coords { position: fixed; z-index: 70; left: 16px; bottom: 16px; background: #111; color: #9f9; font: 12px ui-monospace, monospace; padding: 8px 10px; border-radius: 8px; }

/* ---------- phone ---------- */
@media (max-width: 700px) {
  .strip-arrow { display: none; }
  .strip-body { padding: 5px 6px calc(5px + var(--safe-b)); }
  .thumb { width: 88px; height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
