/* Offline event build for Meta Quest Browser.
   Dark "glass" look, Inter typeface (bundled for offline use), large ray-friendly targets.
   Brand colors are overridden at runtime from brand.json. */
@font-face {
  font-family: "Inter";
  src: url("vendor/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --accent: #3dcd58;
  --accent-text: #0a1a0e;
  --bg: #0c100e;
  --surface: #18201b;
  --text: #ffffff;
  --muted: #a7b4ab;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .22);
  --glass: rgba(16, 21, 18, .58);
  --glass-strong: rgba(16, 21, 18, .82);
  --glow: rgba(61, 205, 88, .35);
  --radius: 22px;
  --target: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 20px; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(61, 205, 88, .16), transparent 62%),
    radial-gradient(900px 520px at 100% 0%, rgba(61, 205, 88, .07), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "ss01", "cv11";
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Faint technical grid behind the home page */
body:not(.pano-page)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  pointer-events: none;
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
main:focus { outline: none; }

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.status { color: var(--muted); text-align: center; margin-top: 30vh; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: var(--target);
  padding: 0 28px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn:hover { background: rgba(255, 255, 255, .10); border-color: rgba(255, 255, 255, .4); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px var(--glow); }
.btn-small { min-height: 52px; padding: 0 20px; font-size: .8rem; }
.btn[disabled] { opacity: .45; cursor: default; }

.icon-btn {
  width: var(--target);
  height: var(--target);
  padding: 0;
  border-radius: 50%;
  flex: none;
}

/* ---------- Home ---------- */

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 36px 48px 56px;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 56px;
}
.logo { height: 40px; max-width: 260px; display: block; pointer-events: none; user-select: none; }
/* Click target for the hidden staff panel (5 clicks on the logo) */
.logo-hold { display: inline-block; padding: 12px; margin: -12px; border-radius: 14px; user-select: none; -webkit-user-select: none; }
.logo-white { filter: brightness(0) invert(1); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 550;
  text-decoration: none;
}
.status-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.status-chip.is-ready::before { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.status-chip.is-busy::before { background: #ffd166; animation: pulse 1.2s ease-in-out infinite; }

.hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 32px; margin-bottom: 40px; }
.hero h1 {
  margin: 14px 0 12px;
  font-size: 3rem;
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -.035em;
  max-width: 16ch;
}
.hero p.lead { margin: 0; color: var(--muted); font-size: 1.05rem; max-width: 46ch; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tiles li { animation: rise .6s var(--ease) both; }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  isolation: isolate;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.tile img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease), filter .35s var(--ease);
  filter: saturate(.9);
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(5, 8, 6, 0) 30%, rgba(5, 8, 6, .55) 62%, rgba(5, 8, 6, .94) 100%);
}
.tile:hover, .tile:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(61, 205, 88, .7);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(61, 205, 88, .35), 0 0 48px rgba(61, 205, 88, .18);
  outline: none;
}
.tile:hover img, .tile:focus-visible img { transform: scale(1.06); filter: saturate(1.05); }

.tile-chips { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; gap: 8px; }
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.chip-warn { background: rgba(255, 209, 102, .16); color: #ffd166; border-color: rgba(255, 209, 102, .3); }

.tile-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 22px 24px; }
.tile-cat { display: block; margin-bottom: 6px; }
.tile-title { display: block; font-size: 1.22rem; font-weight: 620; line-height: 1.2; letter-spacing: -.01em; }
.tile-go {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.tile-go svg { width: 20px; height: 20px; }
.tile:hover .tile-go, .tile:focus-visible .tile-go { background: var(--accent); border-color: var(--accent); color: var(--accent-text); transform: translateX(4px); }
.tile.is-unavailable { opacity: .4; pointer-events: none; }

.footer { margin-top: 44px; text-align: center; color: var(--muted); font-size: .72rem; letter-spacing: .02em; }

/* ---------- Offline setup ---------- */

.setup { max-width: 860px; margin: 0 auto; }
.setup h1 { margin: 28px 0 8px; font-size: 2.2rem; font-weight: 650; letter-spacing: -.03em; }
.setup h2 { font-size: 1rem; margin: 36px 0 10px; }
.setup .lead { color: var(--muted); margin: 0 0 28px; }
.setup-card { padding: 28px; border-radius: var(--radius); }
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; margin: 0 0 22px; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; font-weight: 600; }
.progress { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #8ff0a4); box-shadow: 0 0 16px var(--glow); transition: width .3s var(--ease); }
.actions { display: flex; flex-wrap: wrap; gap: 16px; margin: 24px 0 0; }
.missing { color: var(--muted); font-size: .78rem; }

/* ---------- Video player ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: rgba(3, 5, 4, .92);
  backdrop-filter: blur(10px);
  animation: fade .25s var(--ease);
}
.modal .viewer-bar { display: flex; align-items: center; gap: 20px; padding: 16px 24px; }
.viewer-title { flex: 1; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 24px 24px; }
.modal-stage video { max-width: 100%; max-height: 100%; border-radius: 16px; background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.modal-message { color: var(--muted); padding: 24px; text-align: center; }

/* ---------- 360° viewer ---------- */

.pano-page { overflow: hidden; background: #000; }
/* Photos are bright: use deeper glass so controls stay crisp and readable. */
.pano-page .glass {
  background: rgba(8, 11, 9, .74);
  border-color: rgba(255, 255, 255, .14);
  backdrop-filter: blur(24px) saturate(160%) brightness(.8);
  -webkit-backdrop-filter: blur(24px) saturate(160%) brightness(.8);
}

.v-top {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: none;
}
.v-top > * { pointer-events: auto; }
.v-title { padding: 10px 22px 11px; border-radius: 999px; min-width: 0; }
.v-title h1 { margin: 2px 0 0; font-size: .95rem; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.v-dock {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  transform: translateX(-50%);
}
.v-dock .icon-btn { border-color: transparent; background: transparent; }
.v-dock .icon-btn:hover { background: rgba(255, 255, 255, .1); }
.v-dock .icon-btn.is-on { background: rgba(61, 205, 88, .18); color: var(--accent); }
.v-count { min-width: 92px; text-align: center; font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.v-count strong { color: var(--text); font-weight: 650; }
.v-sep { width: 1px; height: 30px; background: var(--line-strong); margin: 0 6px; }

.v-panel {
  position: fixed;
  top: 100px;
  right: 20px;
  max-height: calc(100vh - 210px);
  z-index: 9;
  width: 380px;
  padding: 26px;
  border-radius: var(--radius);
  overflow: auto;
  animation: slide-in .35s var(--ease);
}
.v-panel h2 { margin: 8px 0 14px; font-size: 1.3rem; font-weight: 650; letter-spacing: -.02em; }
.v-panel ul { margin: 0; padding: 0; list-style: none; }
.v-panel li { position: relative; padding: 10px 0 10px 22px; border-top: 1px solid var(--line); font-size: .85rem; }
.v-panel li::before { content: ""; position: absolute; left: 2px; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.v-panel .how { margin-top: 22px; color: var(--muted); font-size: .78rem; }

.v-card {
  position: fixed;
  left: 20px;
  bottom: 110px;
  z-index: 11;
  width: min(440px, calc(100vw - 40px));
  padding: 24px 26px;
  border-radius: var(--radius);
  animation: rise .35s var(--ease);
}
.v-card h3 { margin: 8px 0 8px; font-size: 1.15rem; font-weight: 650; }
.v-card p { margin: 0 0 18px; color: #d9e2dc; font-size: .86rem; line-height: 1.55; }

.v-hint {
  position: fixed;
  left: 50%;
  top: 104px;
  z-index: 9;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: .8rem;
  transform: translateX(-50%);
  animation: hint-in .5s var(--ease) both, fade-out .6s ease 6s forwards;
  pointer-events: none;
}
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, 14px); } }

.v-loading {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: radial-gradient(800px 500px at 50% 40%, rgba(61, 205, 88, .10), transparent 70%), var(--bg);
  text-align: center;
  transition: opacity .5s var(--ease);
}
.v-loading.is-done { opacity: 0; pointer-events: none; }
.v-loading p { margin: 0; color: var(--muted); }

.spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .1);
  border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}

.placeholder-note {
  position: fixed;
  left: 20px;
  bottom: 110px;
  z-index: 9;
  max-width: 460px;
  margin: 0;
  padding: 12px 18px;
  border-radius: 16px;
  color: #ffd166;
  font-size: .76rem;
}

.v-sub { margin: 2px 0 0; color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mini-map: top-down plan of the points; dots are clickable */
.v-map {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 9;
  padding: 10px;
  border-radius: 20px;
}
.v-map svg { display: block; max-width: 200px; height: auto; }
.v-map .link { stroke: rgba(255, 255, 255, .18); stroke-width: 1.5; }
.v-map .dot { fill: rgba(255, 255, 255, .75); cursor: pointer; transition: fill .2s; }
.v-map .dot:hover { fill: #fff; }
.v-map .dot.is-here { fill: var(--accent); }
.v-map .hit { fill: transparent; cursor: pointer; }
.v-map .cone { fill: rgba(61, 205, 88, .28); }

.v-tour {
  position: fixed;
  left: 50%;
  top: 104px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: .78rem;
  transform: translateX(-50%);
}
.v-tour .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }

/* Staff panel switches */
.settings { padding: 8px 24px; }
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  cursor: pointer;
}
.setting:first-child { border-top: 0; }
.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 60px;
  height: 34px;
  margin: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  cursor: pointer;
  transition: background .2s var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s var(--ease);
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(26px); }
.num {
  width: 110px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font: inherit;
  text-align: right;
}
.muted { color: var(--muted); font-size: .8rem; }
.pin { display: grid; gap: 14px; max-width: 420px; }
.pin input { min-height: 56px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 1.2rem; letter-spacing: .3em; }

/* Edit mode: aim with the crosshair, copy the hotspot JSON */
.v-cross {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 8;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .5);
  pointer-events: none;
}
.v-editor {
  position: fixed;
  top: 100px;
  left: 20px;
  z-index: 12;
  width: 340px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 20px 22px;
  border-radius: var(--radius);
  font-size: .8rem;
}
.v-editor h3 { margin: 16px 0 8px; font-size: .72rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.v-editor .muted { margin: 6px 0 0; font-size: .72rem; }
.v-editor code { font-size: .7rem; }
.v-edit-read { margin: 6px 0 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.v-edit-row { display: flex; flex-wrap: wrap; gap: 8px; }
.v-edit-row .btn { min-height: 44px; padding: 0 14px; font-size: .74rem; }
.v-edit-row .btn.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.v-map.is-edit { bottom: 110px; }
/* Size the editing map by height so tall (corridor) plans stay on screen; wide plans letterbox. */
.v-map.is-edit svg { width: auto; height: min(460px, calc(100vh - 330px)); max-width: 360px; }
.v-map.is-edit g[data-i] { cursor: grab; }

/* ---------- Motion ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } }

@media (max-width: 760px) {
  html { font-size: 17px; }
  main { padding: 24px 16px 40px; }
  .topline { margin-bottom: 32px; }
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .tiles { grid-template-columns: 1fr; }
  .v-top { top: 12px; left: 12px; right: 12px; }
  .v-panel { left: 12px; right: 12px; width: auto; }
  .v-dock { bottom: 12px; }
  .v-card, .placeholder-note { left: 12px; bottom: 96px; }
  .v-map { right: 12px; bottom: 96px; }
  .v-map svg { max-width: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
