/* ==========================================================================
   Profusia — the Showroom (WebGL)
   The stage is one canvas; everything laid over it is ordinary DOM placed by
   the same projection, so text stays crisp and buttons stay buttons.
   Inherits the page's tokens; no palette of its own.
   ========================================================================== */

.showroom {
  position: relative;
  padding-block: clamp(56px, 7vw, 96px);
  background:
    radial-gradient(1200px 620px at 50% -8%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 62%),
    var(--raised);
  border-block: 1px solid var(--line);
  overflow: hidden;
}
.sr-head { text-align: center; margin-bottom: 26px; }

/* --------------------------------------------------------------- the stage */
.sr-stage {
  position: relative;
  height: clamp(460px, 74vh, 780px);
  border-radius: 18px;
  overflow: hidden;
  background: #dadbdf;
  border: 1px solid var(--line);
  box-shadow: 0 26px 70px rgba(9, 9, 11, .16), inset 0 1px 0 rgba(255, 255, 255, .6);
  cursor: grab;
  /* Inline, a vertical swipe still scrolls the page and a sideways one looks
     around. Fullscreen takes every gesture, including the pinch. */
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
  outline: none;
}
.sr-stage.is-dragging { cursor: grabbing; }
.sr-stage:focus-visible { box-shadow: 0 0 0 3px var(--accent), 0 26px 70px rgba(9, 9, 11, .16); }
.sr-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sr-overlay { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.sr-hud { position: absolute; inset: 0; pointer-events: none; }
.sr-hud > * { pointer-events: auto; }

/* ------------------------------------------------------- placards, markers */
.sr-tag {
  position: absolute; left: 0; top: 0;
  transform-origin: 50% 0;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: 0 0 8px 8px;
  padding: 7px 14px 8px;
  text-align: center; white-space: nowrap;
  box-shadow: 0 8px 22px rgba(9, 9, 11, .14);
  transition: opacity .2s ease;
}
.sr-tag b { display: block; font: 620 13.5px/1.2 var(--font); letter-spacing: -.012em; color: var(--ink); }
.sr-tag span { display: block; font: 400 12px/1.3 var(--font); color: var(--ink-2); margin-top: 2px; }
.sr-spot {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .95);
  background: color-mix(in srgb, var(--accent) 78%, transparent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent), 0 2px 10px rgba(9, 9, 11, .3);
  cursor: pointer; padding: 0;
  animation: sr-pulse 2.4s ease-in-out infinite;
}
.sr-spot.is-door { background: rgba(24, 24, 27, .55); box-shadow: 0 0 0 6px rgba(24, 24, 27, .16), 0 2px 10px rgba(9, 9, 11, .3); }
.sr-spot:hover, .sr-spot:focus-visible { transform: translate(-50%, -50%) scale(1.15) !important; animation: none; outline: none; }
@keyframes sr-pulse { 0%, 100% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent), 0 2px 10px rgba(9, 9, 11, .3); } 50% { box-shadow: 0 0 0 11px color-mix(in srgb, var(--accent) 10%, transparent), 0 2px 10px rgba(9, 9, 11, .3); } }

/* ------------------------------------------------------------------- HUD */
.sr-rooms {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 2px; padding: 4px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 4px 14px rgba(9, 9, 11, .1);
  max-width: calc(100% - 28px); overflow-x: auto; scrollbar-width: none;
}
.sr-rooms::-webkit-scrollbar { display: none; }
.sr-roomchip {
  border: 0; background: transparent; color: var(--ink-2);
  font: 560 13px/1 var(--font); padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.sr-roomchip:hover { color: var(--ink); }
.sr-roomchip.is-on { background: var(--ink); color: var(--surface); }
.sr-roomchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.sr-caption {
  position: absolute; top: 62px; left: 50%; transform: translate(-50%, -6px);
  max-width: min(560px, calc(100% - 40px)); margin: 0;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 16px; text-align: center;
  font-size: 14.5px; line-height: 1.45; color: var(--ink-2);
  opacity: 0; transition: opacity .35s ease, transform .35s ease; pointer-events: none;
}
.sr-caption.is-on { opacity: 1; transform: translate(-50%, 0); }

.sr-tools { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 200px); }
.sr-tool {
  border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--ink); font: 560 13px/1 var(--font); padding: 9px 12px; border-radius: 9px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(9, 9, 11, .1);
}
.sr-tool:hover { background: var(--surface); }
.sr-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sr-tool { display: inline-flex; align-items: center; gap: 6px; }
.sr-tool-icon { font-size: 13px; line-height: 1; }
.sr-tool[data-sr="zoomout"] .sr-tool-icon, .sr-tool[data-sr="zoomin"] .sr-tool-icon { font-size: 16px; }
.sr-tool[data-sr="zoomout"] .sr-tool-label, .sr-tool[data-sr="zoomin"] .sr-tool-label { display: none; }
.sr-fs-close {
  display: none; position: absolute; top: 14px; right: 14px; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--ink); font: 500 16px/1 var(--font); cursor: pointer; box-shadow: 0 4px 14px rgba(9, 9, 11, .1);
}

.sr-plan {
  position: absolute; right: 14px; bottom: 14px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 6px;
  box-shadow: 0 4px 14px rgba(9, 9, 11, .1);
}
.sr-plan-label { font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px; }
.sr-plan svg { display: block; }
.sr-plan .cell { fill: var(--sunken); stroke: var(--line-strong); stroke-width: .6; cursor: pointer; }
.sr-plan .cell:hover { fill: var(--accent-soft); }
.sr-plan .cell.is-on { fill: var(--accent-soft); stroke: var(--accent); }
.sr-plan .cam { fill: var(--ink); }
.sr-plan .cone { fill: color-mix(in srgb, var(--accent) 45%, transparent); }

.sr-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(24, 24, 27, .82); color: #fff; font: 500 13px/1 var(--font);
  padding: 9px 14px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  transition: opacity .4s ease;
}
.sr-hint.is-hidden { opacity: 0; }

.sr-loading {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.sr-loading.is-on { opacity: 1; }

/* ---------------------------------------------------------------- reader */
.sr-reader {
  position: absolute; right: 14px; top: 14px; width: min(360px, calc(100% - 28px));
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px 16px;
  box-shadow: 0 20px 50px rgba(9, 9, 11, .2);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.sr-reader.is-open { opacity: 1; transform: none; pointer-events: auto; }
.sr-reader-eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--sr-tint, var(--accent)); margin-bottom: 8px; }
.sr-reader h3 { margin: 0 0 4px; font: 650 19px/1.2 var(--font); letter-spacing: -.02em; }
.sr-reader-sub { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; }
.sr-reader-claim { margin: 0 0 14px; font-size: 14.5px; line-height: 1.55; color: var(--ink); background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 10px 12px; border-radius: 6px; }
.sr-reader-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sr-btn { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 560 13px/1 var(--font); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.sr-btn:hover { background: var(--raised); }
.sr-btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sr-btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.sr-reader-nav [data-sr="close"] { margin-left: auto; }

/* ------------------------------------------------------------- fullscreen */
html.sr-lock, html.sr-lock body { overflow: hidden; }
.showroom.is-fs .sr-stage {
  position: fixed; inset: 0; z-index: 1000;
  height: 100dvh; border-radius: 0; border: 0;
}
.sr-stage:fullscreen, .sr-stage:-webkit-full-screen { border-radius: 0; border: 0; }
.showroom.is-fullscreen .sr-stage { touch-action: none; }
.showroom.is-fullscreen .sr-fs-close { display: inline-flex; align-items: center; justify-content: center; }
.showroom.is-fullscreen .sr-tool[data-sr="flat"], .showroom.is-fullscreen .sr-tool[data-sr="fs"] { display: none; }
.showroom.is-fullscreen .sr-rooms { max-width: calc(100% - 120px); }
.showroom.is-fullscreen .sr-reader { top: 66px; }

/* -------------------------------------------------------------- lightbox */
.sr-lightbox { position: fixed; inset: 0; z-index: 1200; background: rgba(12, 12, 14, .96); display: flex; flex-direction: column; }
.sr-lightbox[hidden] { display: none; }
.sr-lb-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  color: #fff; font: 500 13px/1 var(--font);
  background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sr-lb-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-lb-zoom { font: 500 12px/1 var(--mono); color: rgba(255, 255, 255, .7); min-width: 44px; text-align: right; }
.sr-lb-btn { border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: #fff; font: 560 13px/1 var(--font); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.sr-lb-btn:hover { background: rgba(255, 255, 255, .16); }
.sr-lb-view { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: grab; }
.sr-lb-view.is-zoomed { cursor: move; }
.sr-lb-view img { position: absolute; left: 50%; top: 50%; max-width: none; border-radius: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); user-select: none; -webkit-user-drag: none; pointer-events: none; }
.sr-lb-help { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); color: rgba(255, 255, 255, .6); font: 500 12px/1 var(--font); white-space: nowrap; pointer-events: none; }

/* -------------------------------------------------------------- flat view */
.showroom[data-mode="flat"] .sr-stage { display: none; }
.showroom[data-mode="3d"] .sr-flat { display: none; }
.sr-flat { margin-top: 8px; }
.sr-nogl { color: var(--ink-2); font-size: 14.5px; text-align: center; margin: 0 0 22px; }
.sr-flat-room { margin-bottom: 42px; }
.sr-flat-room h3 { font: 650 20px/1.2 var(--font); letter-spacing: -.02em; margin: 0 0 6px; padding-left: 16px; position: relative; }
.sr-flat-room h3::before { content: ''; position: absolute; left: 0; top: 7px; width: 9px; height: 9px; border-radius: 2px; background: var(--sr-tint); }
.sr-flat-room > p { color: var(--ink-2); margin: 0 0 18px; max-width: 64ch; }
.sr-flat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.sr-flat-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sr-flat-shot { display: block; width: 100%; border: 0; padding: 0; background: var(--sunken); cursor: zoom-in; }
.sr-flat-shot img { display: block; width: 100%; height: auto; }
.sr-flat-copy { padding: 14px 16px 16px; }
.sr-flat-copy b { display: block; font: 620 15px/1.25 var(--font); margin-bottom: 4px; }
.sr-flat-copy span { color: var(--ink-2); font-size: 14px; line-height: 1.5; }

/* --------------------------------------------------------------- phone */
@media (max-width: 720px) {
  .sr-stage { height: clamp(420px, 66vh, 640px); border-radius: 14px; }
  .sr-rooms { top: 10px; }
  .sr-roomchip { padding: 8px 11px; font-size: 12.5px; }
  .sr-caption { top: 56px; font-size: 13.5px; }
  .sr-tools { left: 10px; bottom: 10px; right: 10px; max-width: none; gap: 6px; }
  .sr-tool { padding: 9px 11px; }
  .sr-tool .sr-tool-label { display: none; }
  .sr-tool .sr-tool-icon { font-size: 15px; }
  .sr-plan { display: none; }
  .sr-hint { font-size: 12.5px; white-space: normal; text-align: center; max-width: 80%; line-height: 1.35; padding: 10px 14px; border-radius: 12px; }
  .sr-fs-close { top: 10px; right: 10px; }
  .showroom.is-fullscreen .sr-rooms { left: 10px; transform: none; max-width: calc(100% - 66px); }
  .sr-reader {
    right: 0; left: 0; top: auto; bottom: 0; width: auto;
    border-radius: 14px 14px 0 0; padding: 16px 16px 14px;
    transform: translateY(8px);
  }
  .sr-reader.is-open { transform: none; }
  .sr-tag b { font-size: 12.5px; }
  .sr-tag span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sr-spot { animation: none; }
  .sr-caption, .sr-reader, .sr-hint, .sr-tag { transition: none; }
}
