/* Brikka — virtual tour viewer (proyectos/*-recorrido-*.html) */
@font-face { font-family: 'PP Mori'; src: url('../fonts/PPMori-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'PP Mori'; src: url('../fonts/PPMori-Semibold.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --bone: #F5F3EA;
  --white: #FFFFFF;
  --ink: #0A0A0A;
  --stone: #C4C2BB;
  --font: 'PP Mori', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --glass: rgba(10, 10, 10, 0.62);
  --gutter: clamp(1rem, 3vw, 2rem);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--bone); font-family: var(--font); overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }

#pano { position: fixed; inset: 0; width: 100%; height: 100%; background: var(--ink); }
.pnlm-container { background: var(--ink) !important; font-family: var(--font) !important; }
.pnlm-load-box { background: var(--glass) !important; border-radius: 16px !important; }
.pnlm-about-msg, .pnlm-controls-container { display: none !important; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: calc(var(--gutter) + env(safe-area-inset-top)) var(--gutter) 3rem;
  background: linear-gradient(to bottom, rgba(10,10,10,.6), rgba(10,10,10,0));
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.back { display: inline-flex; align-items: center; gap: .4rem; color: var(--bone); text-decoration: none; font-size: .875rem; opacity: .85; }
.back:hover { opacity: 1; }
.title { margin: .5rem 0 0; font-weight: 600; font-size: clamp(1.25rem, 2.6vw, 1.75rem); line-height: 1.1; }
.subtitle { margin: .25rem 0 0; font-size: .875rem; opacity: .8; }
.tools { display: flex; gap: .5rem; }
.tool {
  width: 44px; height: 44px; border-radius: 999px; border: 0;
  background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center; transition: background .2s;
}
.tool:hover, .tool[aria-pressed="true"] { background: var(--bone); color: var(--ink); }
.tool svg { width: 20px; height: 20px; }
.tool[hidden] { display: none; }

/* ---------- room label + hint ---------- */
.room {
  position: fixed; left: var(--gutter); bottom: calc(132px + env(safe-area-inset-bottom)); z-index: 5;
  pointer-events: none;
}
.room__name { font-weight: 600; font-size: clamp(1.5rem, 4vw, 2.5rem); line-height: 1; text-shadow: 0 2px 18px rgba(0,0,0,.45); }
.room__meta { margin-top: .35rem; font-size: .875rem; opacity: .9; text-shadow: 0 1px 10px rgba(0,0,0,.5); }

.hint {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4;
  display: flex; align-items: center; gap: .6rem; padding: .8rem 1.1rem; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: .9375rem; pointer-events: none; transition: opacity .6s var(--ease);
}
.hint svg { width: 22px; height: 22px; animation: sway 2.4s var(--ease) infinite; }
.hint.is-gone { opacity: 0; }
@keyframes sway { 0%,100% { transform: translateX(-6px); } 50% { transform: translateX(6px); } }

/* ---------- scene strip ---------- */
.strip {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 2.5rem var(--gutter) calc(var(--gutter) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(10,10,10,.7), rgba(10,10,10,0));
}
.strip__list { display: flex; gap: .5rem; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.strip__list::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: .55rem;
  padding: .3rem .9rem .3rem .3rem; border: 0; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: .875rem; white-space: nowrap; transition: background .2s, color .2s;
}
.chip img { width: 46px; height: 46px; border-radius: 999px; object-fit: cover; display: block; }
.chip:hover { background: rgba(245,243,234,.22); }
.chip.is-active { background: var(--bone); color: var(--ink); }

/* ---------- floor plan ---------- */
.plan {
  position: fixed; right: var(--gutter); top: calc(var(--gutter) + 56px + env(safe-area-inset-top)); z-index: 6;
  width: min(270px, calc(100vw - 2 * var(--gutter)));
  background: var(--bone); color: var(--ink); border-radius: 16px; padding: .75rem;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  transform-origin: top right; transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.plan[hidden] { display: block; opacity: 0; transform: scale(.94); pointer-events: none; visibility: hidden; }
.plan__head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; margin: 0 .25rem .5rem; font-size: .875rem; }
.plan__head span { font-size: .75rem; opacity: .7; text-align: right; }
.plan__head strong { font-weight: 600; }
.plan__map { position: relative; }
.plan__map img { display: block; width: 100%; height: auto; border-radius: 8px; }
.pin {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 0; padding: 0;
  border-radius: 999px; background: var(--ink); color: var(--bone);
  display: grid; place-items: center; font-size: .75rem; font-weight: 600;
  box-shadow: 0 0 0 3px var(--bone); transition: transform .2s var(--ease), background .2s;
}
.pin:hover { transform: scale(1.12); }
.pin.is-active { background: #B5643C; }
.pin.is-active::after {
  content: ""; position: absolute; inset: -8px; border-radius: 999px; border: 2px solid #B5643C;
  animation: ping 1.8s var(--ease) infinite;
}
@keyframes ping { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.plan__note { margin: .5rem .25rem 0; font-size: .75rem; opacity: .65; }

/* ---------- hotspots ---------- */
.hs { width: 0; height: 0; }
.hs__btn {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: .5rem; white-space: nowrap;
  padding: .35rem .9rem .35rem .35rem; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--bone); font-size: .875rem; cursor: pointer;
  transition: background .2s, color .2s;
}
.hs__btn:hover { background: var(--bone); color: var(--ink); }
.hs__dot {
  width: 30px; height: 30px; border-radius: 999px; background: var(--bone); color: var(--ink);
  display: grid; place-items: center; flex: 0 0 auto;
}
.hs__btn:hover .hs__dot { background: var(--ink); color: var(--bone); }
.hs__dot svg { width: 16px; height: 16px; }
.hs--scene .hs__dot { animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(245,243,234,.6); } 100% { box-shadow: 0 0 0 14px rgba(245,243,234,0); } }

.disclaimer {
  position: fixed; right: var(--gutter); bottom: calc(var(--gutter) + env(safe-area-inset-bottom) + 64px); z-index: 5;
  font-size: .6875rem; opacity: .6; pointer-events: none; text-align: right;
}

@media (max-width: 640px) {
  .room { bottom: calc(120px + env(safe-area-inset-bottom)); }
  .chip { padding-right: .75rem; }
  .chip img { width: 38px; height: 38px; }
  .disclaimer { display: none; }
  .plan { top: auto; bottom: calc(110px + env(safe-area-inset-bottom)); transform-origin: bottom right; }
}
@media (prefers-reduced-motion: reduce) {
  .hint svg, .hs--scene .hs__dot, .pin.is-active::after { animation: none; }
}
