:root {
  --ink: #0d0f12;
  --panel: rgba(14, 16, 20, 0.62);
  --line: rgba(244, 238, 228, 0.16);
  --sand: #f4eee4;
  --muted: #b9b2a6;
  --brass: #dcb682;
  --brass-2: #f0cf9f;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
  --gap: clamp(12px, 2.2vw, 24px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--sand);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  outline: none;
}

#view.is-dragging {
  cursor: grabbing;
}

#view.is-door {
  cursor: pointer;
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0;
}

/* ── Brand ─────────────────────────────────────────────── */
.brand {
  position: fixed;
  top: var(--gap);
  left: var(--gap);
  z-index: 5;
  padding: 14px 18px 15px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  max-width: calc(100vw - 2 * var(--gap));
}

.brand-name {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  font-variation-settings: "wdth" 120;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-unit {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.demo-tag {
  display: inline-block;
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--brass);
  padding: 4px 8px;
  border-radius: 999px;
}

.mode-link {
  display: inline-block;
  margin-top: 9px;
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mode-link:hover,
.mode-link:focus-visible {
  color: var(--brass-2);
}

/* ── Floor plan ────────────────────────────────────────── */
#minimap {
  position: fixed;
  top: var(--gap);
  right: var(--gap);
  z-index: 5;
  width: 220px;
  height: 172px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}

/* ── Room chips ────────────────────────────────────────── */
.rooms {
  position: fixed;
  left: 50%;
  bottom: calc(var(--gap) + env(safe-area-inset-bottom));
  translate: -50% 0;
  z-index: 5;
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  max-width: calc(100vw - 2 * var(--gap));
  overflow-x: auto;
  scrollbar-width: none;
}

.rooms::-webkit-scrollbar {
  display: none;
}

.rooms button {
  flex: none;
  font: 500 13px var(--font-display);
  color: var(--sand);
  background: transparent;
  border: 0;
  padding: 9px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}

.rooms button:hover {
  background: rgba(244, 238, 228, 0.1);
}

.rooms button.is-here {
  background: var(--sand);
  color: var(--ink);
}

.rooms button:focus-visible,
.book:focus-visible,
.btn:focus-visible,
.pin:focus-visible {
  outline: 2px solid var(--brass-2);
  outline-offset: 2px;
}

/* ── Hint ──────────────────────────────────────────────── */
.hint {
  position: fixed;
  left: 50%;
  bottom: calc(var(--gap) + 62px + env(safe-area-inset-bottom));
  translate: -50% 0;
  z-index: 4;
  margin: 0;
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(14, 16, 20, 0.5);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: opacity 0.8s;
  pointer-events: none;
}

.hint b {
  color: var(--sand);
  font-weight: 600;
}

.hint.is-gone {
  opacity: 0;
}

/* ── Book ──────────────────────────────────────────────── */
.book {
  position: fixed;
  right: var(--gap);
  bottom: calc(var(--gap) + env(safe-area-inset-bottom));
  z-index: 5;
  font: 600 13px var(--font-display);
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--brass);
  border: 0;
  padding: 13px 18px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 30px -10px rgba(220, 182, 130, 0.7);
  transition: background 0.25s;
}

.book:hover {
  background: var(--brass-2);
}

/* ── Pins ──────────────────────────────────────────────── */
#pins {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.pin {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 13px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(14, 16, 20, 0.66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--sand);
  font: 500 13px var(--font-display);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.35s, background 0.25s;
  will-change: transform;
}

.pin::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--brass-2) 0 4px, rgba(220, 182, 130, 0.25) 5px 100%);
  box-shadow: 0 0 0 0 rgba(220, 182, 130, 0.6);
  animation: ping 2.4s ease-out infinite;
}

@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 182, 130, 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 12px rgba(220, 182, 130, 0);
  }
}

.pin small {
  color: var(--muted);
  font-size: 12px;
}

.pin:hover {
  background: rgba(14, 16, 20, 0.85);
}

.pin.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.pin.is-open {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  white-space: normal;
  width: 230px;
}

.pin.is-open::before {
  display: none;
}

.pin .pin-body {
  display: none;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pin.is-open .pin-body {
  display: block;
}

/* ── Cursor label (door) ───────────────────────────────── */
#cursor-label {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 6;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--sand);
  padding: 5px 9px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.15s;
}

#cursor-label.is-on {
  opacity: 1;
}

/* ── Modal ─────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 7, 9, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  max-width: 460px;
  padding: 26px 26px 22px;
  border-radius: 18px;
  background: #15171b;
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
}

.modal-card h2 {
  margin: 10px 0 10px;
  font-size: 28px;
  font-weight: 700;
  font-variation-settings: "wdth" 112;
  line-height: 1.05;
}

.modal-card p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.btn {
  font: 600 14px var(--font-display);
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--brass);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--sand);
  border-color: var(--line);
}

.credit {
  margin: 16px 0 0;
  font-size: 12px !important;
}

.credit a {
  color: var(--sand);
}

/* ── Loader ────────────────────────────────────────────── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--ink);
  transition: opacity 0.9s;
}

.loader.is-done {
  opacity: 0;
  pointer-events: none;
}

.loader-line {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  font-variation-settings: "wdth" 110;
}

.bar {
  width: 180px;
  height: 2px;
  background: rgba(244, 238, 228, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brass);
  transition: width 0.3s;
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

/* ── Phones ────────────────────────────────────────────── */
@media (max-width: 720px) {
  .brand {
    padding: 10px 13px 11px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-unit {
    font-size: 11px;
  }

  .demo-tag {
    margin-top: 6px;
  }

  #minimap {
    top: auto;
    right: auto;
    left: var(--gap);
    bottom: calc(var(--gap) + 64px + env(safe-area-inset-bottom));
    width: 132px;
    height: 104px;
  }

  .pin:not(.is-open) small {
    display: none;
  }

  .hint {
    flex-direction: column;
    gap: 3px;
    bottom: auto;
    top: 50%;
    translate: -50% -50%;
    text-align: center;
  }

  .book {
    bottom: calc(var(--gap) + 64px + env(safe-area-inset-bottom));
    padding: 11px 15px;
  }

  .rooms {
    left: var(--gap);
    right: var(--gap);
    translate: none;
  }

  .pin.is-open {
    width: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pin::before {
    animation: none;
  }
}
