/* 360 tour viewer, nickypandelaki.com style (Inter + IBM Plex Mono, #0a0a0a, #ff5e2c). Phone first. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../vendor/fonts/inter-5.3.0/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../vendor/fonts/ibm-plex-mono-5.3.0/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

:root {
  --bg: #0a0a0a;
  --bg-2: #161616;
  --text: #fafafa;
  --text-2: #a8a8a8;
  --text-3: #7a7a7a;
  --rule: #262626;
  --accent: #ff5e2c;
  --accent-2: #ff7a4d;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --gutter: 16px;
  --icon: 20px;
  --pad: 12px;
  --nav-h: 44px;
  --glass: rgba(10, 10, 10, 0.55);
  color-scheme: dark;
}
@media (pointer: coarse) {
  :root { --icon: 22px; --pad: 13px; --nav-h: 48px; }
}
@media (min-width: 900px) {
  :root { --gutter: 28px; }
}
@media (max-width: 600px) {
  .tour-meta .tour-loc { flex-basis: 100%; }
  .tour-meta .tour-loc::before { content: none; }
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.tour {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
/* only our own elements; PSV relies on content-box sizing for its buttons */
.tour-hud, .tour-hud *, .tour-back, .tour-progress, .tour-message, .tour-message *, .hs, .hs * { box-sizing: border-box; }

/* ---------- loading state ---------- */

.tour-poster {
  position: absolute;
  inset: -6%;
  z-index: 3;
  background-color: var(--bg-2);
  background-size: cover;
  background-position: var(--poster-x, 50%) 50%;
  filter: blur(22px) saturate(1.08);
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.tour-boot {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(250, 250, 250, 0.85);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.tour-boot i {
  display: block;
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat;
  background-size: 50% 100%;
  animation: tour-sweep 1.1s ease-in-out infinite;
}
@keyframes tour-sweep {
  from { background-position: -100% 0; }
  to { background-position: 200% 0; }
}
.tour.is-ready .tour-poster,
.tour.is-ready .tour-boot { opacity: 0; }

.tour-progress {
  position: absolute;
  z-index: 60;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.tour-progress.is-on { opacity: 1; }
.tour-progress i {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  background: var(--accent);
  transition: width 0.25s linear;
}
.tour-progress.is-indeterminate i {
  width: 30%;
  animation: tour-indeterminate 1.2s ease-in-out infinite;
}
@keyframes tour-indeterminate {
  from { transform: translateX(-100%); }
  to { transform: translateX(340%); }
}

.tour-message {
  position: absolute;
  z-index: 70;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(320px, calc(100% - 2 * var(--gutter)));
  margin: 0;
  padding: 18px 20px;
  background: rgba(10, 10, 10, 0.86);
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-align: center;
  font: 400 15px/1.45 var(--sans);
  color: var(--text);
}
.tour-message p { margin: 0; }
.tour-retry {
  margin-top: 12px;
  min-height: 44px;
  padding: 0 18px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 100px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.tour-retry:hover, .tour-retry:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }

/* ---------- heading over the view ---------- */

.tour-hud {
  position: absolute;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 40px;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.78), rgba(10, 10, 10, 0.42) 55%, rgba(10, 10, 10, 0));
  pointer-events: none;
}
.tour-meta {
  margin: 0;
  padding-right: 120px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font: 500 11px/1.35 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 250, 250, 0.82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}
.tour-count { color: var(--accent-2); }
.tour-loc::before { content: '· '; color: rgba(250, 250, 250, 0.55); }
.tour-test {
  padding: 2px 7px 1px;
  border: 1px solid var(--accent);
  border-radius: 100px;
  color: var(--accent);
}
.tour-scene {
  margin: 6px 0 0;
  font: 600 clamp(22px, 3vw, 40px)/1.08 var(--sans);
  letter-spacing: -0.025em;
  color: var(--text);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
}
.tour-back {
  position: absolute;
  z-index: 51;
  top: calc(4px + env(safe-area-inset-top));
  right: calc(var(--gutter) - 10px);
  min-height: 44px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(250, 250, 250, 0.82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  text-decoration: none;
  transition: color 0.2s ease;
}
.tour-back:hover, .tour-back:focus-visible { color: var(--accent); outline: none; }

.is-embed .tour-hud { padding: 10px 12px 26px; }
.is-embed .tour-meta { padding-right: 0; }
.is-embed .tour-title, .is-embed .tour-loc { display: none; }
.is-embed .tour-scene { margin-top: 4px; font-size: clamp(16px, 2.2vw, 26px); }

/* ---------- Photo Sphere Viewer, restyled ---------- */

.psv-container {
  background: var(--bg);
  font-family: var(--sans);
}
.psv-loader-container { display: none !important; }

.psv-navbar {
  height: var(--nav-h);
  bottom: calc(-1 * var(--nav-h));
  padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left));
  background: linear-gradient(to top, rgba(10, 10, 10, 0.78), rgba(10, 10, 10, 0.5));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--sans);
}
.psv-navbar--open { bottom: 0; }
.psv-button {
  width: var(--icon);
  height: var(--icon);
  padding: var(--pad);
  color: rgba(250, 250, 250, 0.88);
  transition: color 0.2s ease;
}
.psv-button--active { background: transparent; color: var(--accent); }
.psv-container:not(.psv--is-touch) .psv-button:not(.psv-button--disabled):hover { color: var(--accent); }
.psv-button:not(.psv-button--disabled):focus-visible { outline: 2px solid var(--accent); outline-offset: -5px; }
.psv-custom-button svg { display: block; width: 100%; height: 100%; }
.psv-caption { pointer-events: none; }
.psv-caption-content { display: none; }
.psv-zoom-range-line, .psv-zoom-range-handle { background: rgba(250, 250, 250, 0.8); }

.psv-notification-content, .psv-tooltip-content {
  font: 400 13px/1.4 var(--sans);
}
.psv-notification-content {
  background: rgba(10, 10, 10, 0.86);
  border: 1px solid var(--rule);
}
.psv--has-navbar .psv-notification--visible { bottom: calc(var(--nav-h) + 16px); }
.psv-overlay { background: rgba(10, 10, 10, 0.92); opacity: 1; }
.psv-overlay-image { color: var(--text-3); }
.psv-overlay-title { color: var(--text); font: 600 20px/1.3 var(--sans); }
.psv-overlay-text { color: var(--text-2); font: 400 15px/1.4 var(--sans); }

/* gallery: a sideways strip at every size (the plugin turns it into a full screen grid below 500 px) */
.psv-gallery {
  --psv-gallery-breakpoint: 0px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(250, 250, 250, 0.08);
}
.psv--has-navbar .psv-gallery {
  bottom: var(--nav-h);
  transform: translateY(calc(100% + var(--nav-h)));
}
.psv-gallery-container {
  padding: 10px var(--gutter);
  overflow: auto hidden;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.psv-gallery-container::-webkit-scrollbar { display: none; }
.psv-gallery-item {
  border-radius: 4px;
  scroll-snap-align: start;
  box-shadow: inset 0 0 0 1px rgba(250, 250, 250, 0.1);
}
.psv-gallery-item:not(:last-child) { margin-right: 10px; }
.psv-gallery-item-title {
  top: auto;
  bottom: 0;
  height: auto;
  min-height: 0;
  padding: 22px 8px 7px;
  justify-content: flex-start;
  align-items: flex-end;
  background: linear-gradient(to top, rgba(10, 10, 10, 0.88), rgba(10, 10, 10, 0));
  font: 500 10px/1.25 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  transition: none;
}
.psv-gallery-item-title span,
.psv-gallery-item:hover .psv-gallery-item-title span {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.psv-gallery-item:hover .psv-gallery-item-title { height: auto; }
.psv-gallery-item:hover .psv-gallery-item-thumb { transform: scale3d(1.05, 1.05, 1); }
.psv-gallery-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.psv-gallery-item--active::after { border: 2px solid var(--accent); border-radius: 4px; }
.psv-gallery-arrow svg { color: rgba(250, 250, 250, 0.75); filter: none; }
.psv-gallery-arrow--left { background: linear-gradient(to left, transparent, rgba(10, 10, 10, 0.7) 60%); }
.psv-gallery-arrow--right { background: linear-gradient(to right, transparent, rgba(10, 10, 10, 0.7) 60%); }

@container psv-container (max-width: 500px) {
  .psv-gallery { top: auto; }
  .psv-gallery-container {
    flex-wrap: nowrap;
    height: auto;
    margin-top: 0;
    padding: 10px var(--gutter);
    overflow: auto hidden;
  }
  .psv-gallery-item { width: 120px !important; margin-bottom: 0; }
  .psv-gallery .psv-panel-close-button { display: none; }
}

/* ---------- hotspots ---------- */

.hs { cursor: pointer; }
.hs--link .hs-dot {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.4);
  border: 1.5px solid rgba(250, 250, 250, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  color: #fff;
  transform: scale(var(--s, 1));
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.hs--link .hs-dot svg { width: 20px; height: 20px; display: block; }
.hs--link:hover .hs-dot { background: var(--accent); border-color: var(--accent); transform: scale(calc(var(--s, 1) * 1.08)); }
.hs-label {
  display: inline-block;
  padding: 5px 9px 4px;
  border-radius: 100px;
  background: rgba(10, 10, 10, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font: 500 10px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text);
}
.hs--link .hs-label {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(calc(-50% + var(--dx, 0px)));
  transition: opacity 0.15s ease;
}
/* tap target = the .hs-hit circle only (sized by layoutLabels so neighbours never overlap);
   the marker box, the dot and the label do not take taps */
.psv-marker.hs--link, .psv-marker.hs--label { pointer-events: none; }
.hs--link .hs-dot, .hs--link .hs-label { pointer-events: none; }
.hs-hit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--hit, 44px);
  height: var(--hit, 44px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: auto;
  cursor: pointer;
}
/* set by layoutLabels() in tour.js */
.hs--up .hs-label { top: auto; bottom: calc(100% + 2px); }
.hs--quiet .hs-label { opacity: 0; pointer-events: none; }
.psv-marker.hs--quiet { z-index: var(--zq, 300) !important; } /* a hidden-label dot sits above the marker covering it */
.psv-container:not(.psv--is-touch) .hs--quiet:hover .hs-label,
.hs--peek .hs-label { opacity: 1; }
.psv-container:not(.psv--is-touch) .psv-marker.hs:hover,
.psv-marker.hs--peek { z-index: 1000 !important; }
.hs--label { cursor: default; }
.hs--label .hs-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 1px 0;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- small embeds (phone iframe is about 357 x 268) ---------- */

@media (max-height: 340px) {
  .is-embed .tour-hud { padding: 8px 10px 22px; }
  .is-embed .tour-scene { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-boot i, .tour-progress.is-indeterminate i { animation: none; }
  .tour-poster, .psv-gallery { transition: none; }
}

.tour-noscript, .tour > noscript p { color: var(--text-2); }
