/* ==========================================================
   3D studio overlays: loader, check-in, HUD, dialogue, panels, modals
   ========================================================== */
:root {
  --bg: #0a0a0a;
  --lime: #d4ff3a;
  --text: #f5f5f2;
  --muted: rgba(245, 245, 242, 0.62);
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(14, 15, 16, 0.74);
  --glass-strong: rgba(12, 12, 13, 0.88);
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Archivo", "Arial Black", sans-serif;
  --font-body: "Montserrat", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

[hidden] {
  display: none !important;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  cursor: grab;
}

#scene:active {
  cursor: grabbing;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom-width: 3px;
  font: 600 12px/1 var(--font-mono);
  color: var(--text);
}

.eyebrow {
  margin: 0 0 8px;
  font: 500 11px/1.2 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
}

/* ---------- Buttons, chips, fields ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 700 14px/1 var(--font-body);
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn--primary {
  background: var(--lime);
  color: #0a0a0a;
  box-shadow: 0 10px 30px -12px rgba(212, 255, 58, 0.7);
}

.btn--primary:hover {
  background: #e6ff7a;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--lime);
  color: var(--lime);
}

.btn--small {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
}

.btn--block {
  width: 100%;
}

.chip {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font: 600 13px/1 var(--font-body);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.chip:hover {
  border-color: var(--lime);
  color: var(--lime);
  background: rgba(212, 255, 58, 0.08);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
  flex: none;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.icon-btn:hover {
  border-color: var(--lime);
  color: var(--lime);
}

.icon-btn--lime {
  background: var(--lime);
  color: #0a0a0a;
  border-color: var(--lime);
}

.icon-btn--lime:hover {
  color: #0a0a0a;
  background: #e6ff7a;
}

.field {
  display: grid;
  gap: 7px;
}

.field__label {
  font: 500 11px/1.2 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0;
}

.field__label em {
  font-style: normal;
  opacity: 0.7;
  text-transform: none;
  letter-spacing: 0;
}

.field__input {
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: 500 15px/1.3 var(--font-body);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.field__input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.field__input:focus {
  outline: none;
  border-color: var(--lime);
  background: rgba(255, 255, 255, 0.09);
}

textarea.field__input {
  resize: vertical;
}

/* ==========================================================
   Loader: an elevator ride up to the studio
   ========================================================== */
.loader {
  --progress: 0;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #fff;
  overflow: hidden;
  perspective: 1600px;
  transition: opacity 0.6s ease;
}

.loader__scene {
  position: absolute;
  inset: 0;
}

.loader__doors {
  position: absolute;
  inset: 0;
  display: flex;
  transform-style: preserve-3d;
}

.loader__door {
  flex: 1;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, #15161a 0%, #2a2c31 38%, #1d1e22 62%, #121316 100%);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.65);
  transition: transform 1.3s cubic-bezier(0.7, 0, 0.2, 1), filter 1.3s ease;
}

.loader__door--l {
  transform-origin: left center;
  border-right: 1px solid rgba(0, 0, 0, 0.7);
}

.loader__door--r {
  transform-origin: right center;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

/* Light leaking through the seam grows with progress */
.loader__doors::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: var(--lime);
  box-shadow: 0 0 calc(10px + var(--progress) * 40px) calc(2px + var(--progress) * 8px) rgba(212, 255, 58, 0.55);
  opacity: calc(0.35 + var(--progress) * 0.65);
  animation: seam 2.4s ease-in-out infinite;
}

@keyframes seam {
  50% {
    filter: brightness(1.4);
  }
}

.loader__panel {
  position: absolute;
  top: calc(7vh + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-radius: 14px;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 20px rgba(212, 255, 58, 0.08), 0 20px 40px rgba(0, 0, 0, 0.6);
  z-index: 3;
}

.loader__floor {
  min-width: 1.4em;
  text-align: center;
  font: 700 34px/1 var(--font-mono);
  color: var(--lime);
  text-shadow: 0 0 14px rgba(212, 255, 58, 0.8);
}

.loader__arrow {
  font-size: 18px;
  color: var(--lime);
  animation: blink 0.9s steps(2) infinite;
}

@keyframes blink {
  50% {
    opacity: 0.15;
  }
}

.loader > p,
.loader > .loader__bar {
  position: relative;
  z-index: 2;
  margin: 0;
  transition: opacity 0.4s ease, transform 0.6s var(--ease);
}

.loader__brand {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 125;
  font-weight: 800;
  font-size: clamp(30px, 5vw, 58px);
  letter-spacing: -0.02em;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.loader__brand span {
  color: var(--lime);
}

.loader__status {
  font: 500 13px/1.4 var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.04em;
  min-height: 1.4em;
}

.loader__bar {
  width: min(320px, 68vw);
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.loader__fill {
  display: block;
  height: 100%;
  width: calc(var(--progress) * 100%);
  background: var(--lime);
  box-shadow: 0 0 12px var(--lime);
  transition: width 0.35s ease;
}

.loader__pct {
  font: 500 12px/1 var(--font-mono);
  color: var(--lime);
}

.loader.is-arrived .loader__panel {
  box-shadow: inset 0 0 30px rgba(212, 255, 58, 0.3), 0 0 60px rgba(212, 255, 58, 0.25);
}

.loader.is-arrived .loader__arrow {
  animation: none;
  opacity: 0;
}

.loader.is-open > p,
.loader.is-open > .loader__bar,
.loader.is-open .loader__panel {
  opacity: 0;
  transform: translateY(-12px);
}

.loader.is-open .loader__door--l {
  transform: translateX(-101%) rotateY(14deg);
  filter: brightness(1.6);
}

.loader.is-open .loader__door--r {
  transform: translateX(101%) rotateY(-14deg);
  filter: brightness(1.6);
}

.loader.is-open .loader__doors::after {
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

/* ==========================================================
   Overlay root
   ========================================================== */
.ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.ui > * {
  pointer-events: auto;
}

.ui > .hud {
  pointer-events: none;
}

.glass,
.checkin__card,
.dialogue__box,
.dialogue__card,
.panel,
.modal__box,
.hud__objective,
.hud__brand,
.hud__prompt,
.hud__tour,
.hud__map {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}

/* ---------- Visitor badge chip (HUD) ---------- */
.hud__badge {
  position: absolute;
  top: calc(76px + var(--safe-t));
  left: calc(16px + var(--safe-l));
  display: grid;
  gap: 2px;
  padding: 9px 16px 10px 14px;
  border-radius: 14px;
  background: #f7f6f2;
  color: #111;
  border-top: 5px solid #0e0f10;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
  animation: badge-in 0.6s var(--ease);
}

.hud__badge span {
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
  color: #5d7400;
}

.hud__badge strong {
  font: 800 16px/1.1 var(--font-display);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud.has-badge .hud__tour {
  top: calc(140px + var(--safe-t));
}

@keyframes badge-in {
  from {
    opacity: 0;
    transform: translateY(-10px) rotate(-4deg);
  }
}

/* ---------- Lift floor picker ---------- */
.lift__box {
  width: min(520px, 100%);
}

.lift__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.lift__btn {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 2px 12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
  font: 600 13px/1.25 var(--font-body);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease);
}

.lift__btn:hover:not(:disabled),
.lift__btn:focus-visible {
  background: rgba(212, 255, 58, 0.12);
  border-color: rgba(212, 255, 58, 0.6);
  transform: translateY(-1px);
  outline: none;
}

.lift__num {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  font: 800 18px/1 var(--font-display);
}

.lift__btn:hover:not(:disabled) .lift__num {
  background: var(--lime);
  border-color: var(--lime);
  color: #0a0a0a;
}

.lift__btn.is-done .lift__label::after {
  content: " ✓";
  color: var(--lime);
}

.lift__btn.is-here {
  cursor: default;
  opacity: 0.55;
}

.lift__btn em {
  font: 500 11px/1.2 var(--font-mono);
  font-style: normal;
  color: var(--lime);
}

.lift__modes {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 10px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.lift__modes button {
  padding: 7px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 700 12px/1 var(--font-body);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.lift__modes button[aria-checked="true"] {
  background: var(--lime);
  color: #0a0a0a;
}

.lift__modes button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.lift__modes button.is-hint:not([aria-checked="true"]) {
  box-shadow: inset 0 0 0 1px rgba(212, 255, 58, 0.75);
  animation: hint 1.4s ease-in-out infinite;
}

@keyframes hint {
  50% {
    background: rgba(212, 255, 58, 0.16);
  }
}

.lift__status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 12px;
  font: 500 11px/1.4 var(--font-mono);
  color: var(--muted);
}

.lift__status b {
  color: var(--text);
  font-weight: 700;
}

.lift__status .lift__note {
  flex-basis: 100%;
  color: var(--lime);
}

/* ---------- Fade to black between floors on the stairs ---------- */
.fade {
  position: absolute;
  inset: 0;
  background: #050506;
  opacity: 0;
  transition: opacity 0.55s ease;
  pointer-events: none;
  z-index: 11;
}

.fade.is-on {
  opacity: 1;
}

/* ---------- Floor counter during a lift ride ---------- */
.floorflash {
  position: absolute;
  top: calc(84px + var(--safe-t));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 22px 10px 12px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  transform: translate(-50%, -8px);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s var(--ease);
  pointer-events: none;
  z-index: 12;
}

.floorflash.is-in {
  opacity: 1;
  transform: translate(-50%, 0);
}

.floorflash__num {
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 46px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--lime);
  color: #0a0a0a;
  font: 800 24px/1 var(--font-display);
}

.floorflash__label {
  font: 700 15px/1.2 var(--font-body);
}

/* ---------- Skills card ---------- */
.card__groups {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.card__groups li {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.card__groups h4 {
  margin: 0;
  font-size: 13px;
}

/* ---------- Check-in ---------- */
.checkin {
  position: absolute;
  left: calc(clamp(16px, 5vw, 72px) + var(--safe-l));
  top: 50%;
  width: min(410px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  transform: translate(-24px, -50%);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.6s var(--ease);
  scrollbar-width: thin;
}

.checkin.is-in {
  opacity: 1;
  transform: translate(0, -50%);
}

.checkin__card {
  display: grid;
  gap: 16px;
  padding: 28px;
  border-radius: 26px;
}

.checkin__title {
  margin: -4px 0 0;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 125;
  font-weight: 800;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.checkin__intro {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.checkin__hint {
  margin: -4px 0 0;
  text-align: center;
  font: 500 11px/1.4 var(--font-mono);
  color: rgba(255, 255, 255, 0.4);
}

/* Visitor pass badge */
.pass {
  position: relative;
  padding: 16px 18px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f7f7f2, #dedfd6);
  color: #0a0a0a;
  overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(212, 255, 58, 0.45);
}

.pass::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: var(--lime);
}

.pass__top {
  display: flex;
  justify-content: space-between;
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
  opacity: 0.7;
}

.pass__name {
  margin: 12px 0 2px;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 125;
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pass__role {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.65;
}

.pass__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.pass__code {
  width: 120px;
  height: 22px;
  background: repeating-linear-gradient(90deg, #0a0a0a 0 2px, transparent 2px 4px, #0a0a0a 4px 5px, transparent 5px 8px, #0a0a0a 8px 11px, transparent 11px 13px);
  opacity: 0.85;
}

.pass__holo {
  width: 42px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(120deg, #d4ff3a, #8ff7ff, #f5a3ff, #d4ff3a);
  background-size: 300% 100%;
  animation: holo 5s linear infinite;
}

@keyframes holo {
  to {
    background-position: 300% 0;
  }
}

.segmented {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.segmented legend {
  grid-column: 1 / -1;
  margin-bottom: 7px;
}

.segmented__opt {
  position: relative;
}

.segmented__opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.segmented__opt span {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.segmented__opt input:checked + span {
  border-color: var(--lime);
  background: rgba(212, 255, 58, 0.12);
  color: var(--lime);
}

.segmented__opt input:focus-visible + span {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hud.is-in {
  opacity: 1;
}

.hud > * {
  pointer-events: auto;
}

.hud__brand {
  position: absolute;
  top: calc(16px + var(--safe-t));
  left: calc(16px + var(--safe-l));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px 8px 8px;
  border-radius: 999px;
}

.hud__logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--lime);
  color: #0a0a0a;
  font: 800 13px/1 var(--font-display);
}

.hud__brand strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.hud__area {
  display: block;
  font: 500 11px/1.3 var(--font-mono);
  color: var(--lime);
  min-height: 1.3em;
}

.hud__actions {
  position: absolute;
  top: calc(16px + var(--safe-t));
  right: calc(16px + var(--safe-r));
  display: flex;
  gap: 8px;
}

.hud__objective {
  position: absolute;
  top: calc(18px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  max-width: min(520px, calc(100vw - 420px));
  padding: 11px 20px 11px 40px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud__objective::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(212, 255, 58, 0.6);
  animation: ping 1.8s ease-out infinite;
}

@keyframes ping {
  to {
    box-shadow: 0 0 0 12px rgba(212, 255, 58, 0);
  }
}

.hud__tour {
  position: absolute;
  top: calc(80px + var(--safe-t));
  left: calc(16px + var(--safe-l));
  margin: 0;
  padding: 12px 14px;
  list-style: none;
  border-radius: 18px;
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.hud__tour li {
  display: flex;
  align-items: center;
  gap: 9px;
  transition: color 0.3s ease;
}

.hud__tick {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.hud__tick svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  color: #0a0a0a;
}

.hud__tour li.is-done {
  color: var(--text);
}

.hud__tour li.is-done .hud__tick {
  background: var(--lime);
  border-color: var(--lime);
}

.hud__tour li.is-done .hud__tick svg {
  opacity: 1;
}

.hud__prompt {
  position: absolute;
  left: 50%;
  bottom: calc(28px + var(--safe-b));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 22px 8px 10px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  animation: rise 0.4s var(--ease);
}

.hud__prompt kbd {
  background: var(--lime);
  color: #0a0a0a;
  border-color: #a7cc22;
  min-width: 34px;
  height: 34px;
  font-size: 13px;
}

.hud__prompt.is-hint kbd {
  display: none;
}
.hud__prompt.is-hint {
  cursor: default;
}
.hud__prompt:hover {
  border-color: var(--lime);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

.hud__map {
  position: absolute;
  right: calc(16px + var(--safe-r));
  bottom: calc(16px + var(--safe-b));
  width: 180px;
  height: 180px;
  border-radius: 20px;
  cursor: pointer;
}

body.is-talking .hud__prompt,
body.is-talking .hud__tour,
body.is-reading .hud {
  display: none;
}

/* ---------- Dialogue ---------- */
.dialogue {
  position: absolute;
  left: 50%;
  bottom: calc(20px + var(--safe-b));
  width: min(820px, calc(100vw - 32px));
  transform: translate(-50%, 24px);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.5s var(--ease);
}

.dialogue.is-in {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dialogue__box {
  position: relative;
  padding: 20px 22px 18px;
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
}

.dialogue__speaker {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialogue__speaker > div {
  flex: 1;
  min-width: 0;
}

.dialogue__avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--lime);
  color: #0a0a0a;
  font: 800 18px/1 var(--font-display);
  box-shadow: 0 0 0 4px rgba(212, 255, 58, 0.15);
}

.dialogue__name {
  display: block;
  font-size: 15px;
}

.dialogue__title {
  display: block;
  font: 500 11px/1.3 var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dialogue__text {
  margin: 0;
  min-height: 3.1em;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.55;
  font-weight: 500;
  cursor: default;
}

.dialogue__thinking {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font: 500 12px/1 var(--font-mono);
  color: var(--muted);
}

.dialogue__thinking span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  animation: bounce 1s ease-in-out infinite;
}

.dialogue__thinking span:nth-child(2) {
  animation-delay: 0.15s;
}

.dialogue__thinking span:nth-child(3) {
  animation-delay: 0.3s;
  margin-right: 6px;
}

@keyframes bounce {
  50% {
    transform: translateY(-5px);
    opacity: 0.4;
  }
}

.dialogue__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dialogue__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.dialogue__ask {
  display: flex;
  gap: 8px;
}

.dialogue__ask input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: 500 14px/1 var(--font-body);
}

.dialogue__ask input:focus {
  outline: none;
  border-color: var(--lime);
}

.dialogue__ask.is-busy {
  opacity: 0.6;
}

/* Topic card: floats on the left so Maya stays in view on the right */
.dialogue__card {
  position: fixed;
  left: calc(20px + var(--safe-l));
  top: calc(84px + var(--safe-t));
  width: min(380px, 32vw);
  max-height: calc(100vh - 84px - 330px);
  overflow: auto;
  padding: 22px;
  border-radius: var(--radius);
  scrollbar-width: thin;
  animation: fade-in 0.4s var(--ease);
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- Area panel ---------- */
.panel {
  position: absolute;
  right: calc(20px + var(--safe-r));
  top: calc(80px + var(--safe-t));
  bottom: calc(210px + var(--safe-b));
  width: min(430px, 36vw);
  overflow: auto;
  padding: 26px;
  border-radius: var(--radius);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.4s ease, transform 0.5s var(--ease);
  scrollbar-width: thin;
}

.panel.is-in {
  opacity: 1;
  transform: translateX(0);
}

.panel__close {
  position: sticky;
  top: 0;
  float: right;
  margin: -8px -8px 0 8px;
  z-index: 2;
}

.panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

/* ---------- Cards ---------- */
.card {
  display: grid;
  gap: 12px;
}

.card__kicker {
  margin: 0;
  font: 500 11px/1.2 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
}

.card__title {
  margin: 0;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 125;
  font-weight: 800;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.card__role,
.card__meta {
  margin: 0;
  font: 500 12px/1.4 var(--font-mono);
  color: var(--muted);
}

.card__lead {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

.card__text,
.card li p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.card h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.card--about {
  grid-template-columns: 76px 1fr;
  align-items: center;
}

.card--about > :not(:nth-child(-n + 2)) {
  grid-column: 1 / -1;
}

.card__portrait {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #e6ff8a, #9cc21a);
}

.card__portrait img {
  width: 100%;
  height: 130%;
  object-fit: cover;
  object-position: 50% 12%;
}

.card__stats {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.card__stats li {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.card__stats strong {
  display: block;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 125;
  font-weight: 800;
  font-size: 26px;
  color: var(--lime);
}

.card__stats span {
  font-size: 12px;
  color: var(--muted);
}

.card__list,
.card__steps,
.card__projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.card__list li,
.card__steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.card__projects li {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

.card__num {
  font: 700 13px/1.6 var(--font-mono);
  color: var(--lime);
}

.card__tags,
.card__highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0 !important;
}

.card__tags span {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font: 500 11px/1.3 var(--font-mono);
  color: var(--text);
}

.card__highlights span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(212, 255, 58, 0.14);
  color: var(--lime);
  font: 700 12px/1.3 var(--font-body);
}

.card__email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.card__email a {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 112;
  font-weight: 700;
  font-size: 19px;
  color: var(--lime);
  text-decoration: none;
  word-break: break-all;
}

.card__links {
  display: flex;
  gap: 16px;
  margin: 0;
}

.card__links a {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.card__links a:hover {
  color: var(--lime);
  border-color: var(--lime);
}

/* ---------- Modals ---------- */
.modal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 20;
}

.modal.is-in {
  opacity: 1;
}

.modal__box {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
  border-radius: 26px;
  background: var(--glass-strong);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.4s var(--ease);
}

.modal.is-in .modal__box {
  transform: none;
}

.modal__box--wide {
  width: min(760px, 100%);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.modal__title {
  margin: 0 0 14px;
  padding-right: 52px;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 125;
  font-weight: 800;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.modal__text {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.booking__frame {
  width: 100%;
  height: min(640px, 66vh);
  border: 0;
  border-radius: 16px;
  background: #fff;
}

.booking__alt {
  margin: 12px 0 0;
  font-size: 13px;
}

.booking__alt a {
  color: var(--lime);
}

.booking__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.booking__form .field--full,
.booking__row {
  grid-column: 1 / -1;
}

.booking__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.help__list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 12px;
  font-size: 14px;
}

.help__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.help__list span {
  margin-left: auto;
  color: var(--muted);
}

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  left: 50%;
  top: calc(76px + var(--safe-t));
  transform: translate(-50%, -10px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--lime);
  color: #0a0a0a;
  font-weight: 700;
  font-size: 13px;
  opacity: 0;
  pointer-events: none !important;
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
  z-index: 30;
  white-space: nowrap;
}

.toast.is-in {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Touch joystick ---------- */
.joystick {
  display: none;
  position: fixed;
  left: calc(22px + var(--safe-l));
  bottom: calc(22px + var(--safe-b));
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: rgba(14, 15, 16, 0.55);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 9; /* under panels and modals */
  touch-action: none;
}

.joystick.is-active {
  display: block;
}

.joystick__knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50px;
  height: 50px;
  margin: -25px 0 0 -25px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.08s linear;
}

body.is-talking .joystick,
body.is-reading .joystick {
  display: none;
}

/* ---------- Text version ---------- */
.text-version {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: auto;
  padding: clamp(24px, 6vw, 72px) clamp(18px, 6vw, 72px) 80px;
  background: #0d0d0e;
  color: var(--text);
  line-height: 1.6;
}

.text-version.is-open {
  display: block;
}

.text-version > * {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.text-version__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.text-version h1 {
  margin: 0;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 125;
  font-weight: 800;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.text-version h2 {
  margin: 40px 0 12px;
  font: 500 12px/1.2 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
}

.text-version h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.text-version h3 span {
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
}

.text-version p {
  margin: 0 0 10px;
  color: rgba(245, 245, 242, 0.8);
}

.text-version__lead {
  font-size: 20px;
  font-weight: 600;
  color: var(--text) !important;
}

.text-version__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 18px;
}

.text-version__list li {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.text-version__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 0;
  list-style: none;
}

.text-version__stats strong {
  color: var(--lime);
}

.text-version__tags,
.text-version__meta {
  font: 500 12px/1.5 var(--font-mono);
  color: var(--muted) !important;
}

.text-version a {
  color: var(--lime);
}

.text-version__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 0;
  list-style: none;
}

.text-version__close {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--lime);
  background: var(--lime);
  color: #0a0a0a;
  font: 700 14px/1 var(--font-body);
  cursor: pointer;
}

.text-version.is-fallback {
  padding-top: 110px;
}

/* ---------- Fallback + noscript ---------- */
.fallback {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  padding: 18px 24px;
  background: var(--lime);
  color: #0a0a0a;
  font-weight: 700;
  text-align: center;
}

.fallback p {
  margin: 0;
}

.noscript {
  position: fixed;
  inset: auto 0 0;
  z-index: 200;
  margin: 0;
  padding: 16px;
  background: var(--lime);
  color: #0a0a0a;
  text-align: center;
  font-weight: 700;
}

/* ==========================================================
   Phones / narrow screens
   ========================================================== */
@media (max-width: 760px) {
  .checkin {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 64vh;
    transform: translateY(30px);
  }

  .checkin.is-in {
    transform: none;
  }

  .checkin__card {
    gap: 12px;
    padding: 20px 18px calc(20px + var(--safe-b));
    border-radius: 24px 24px 0 0;
  }

  .checkin__title {
    font-size: 28px;
  }

  .checkin__intro {
    display: none;
  }

  .pass {
    padding: 12px 14px 10px;
  }

  .pass__name {
    font-size: 24px;
    margin-top: 8px;
  }

  .pass__bottom {
    display: none;
  }

  .hud__brand strong {
    font-size: 12px;
  }

  .hud__brand {
    padding-right: 14px;
  }

  .hud__actions {
    gap: 6px;
  }

  .hud__tour {
    display: none;
  }

  .hud__badge {
    top: auto;
    left: auto;
    right: calc(16px + var(--safe-r));
    bottom: calc(150px + var(--safe-b));
    padding: 7px 12px 8px 10px;
  }

  .lift__grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .lift__btn {
    grid-template-columns: 36px 1fr;
    padding: 8px 10px;
    font-size: 12px;
  }

  .lift__num {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .floorflash {
    top: calc(76px + var(--safe-t));
  }

  .hud__objective {
    top: auto;
    bottom: calc(150px + var(--safe-b));
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: left;
    font-size: 12px;
    border-radius: 18px;
  }

  .hud__map {
    width: 118px;
    height: 118px;
    border-radius: 16px;
    bottom: calc(22px + var(--safe-b));
  }

  .hud__prompt {
    bottom: calc(158px + var(--safe-b));
  }

  .dialogue {
    left: 0;
    bottom: 0;
    width: 100%;
    transform: translateY(24px);
    max-height: 72vh;
    display: flex;
    flex-direction: column;
  }

  .dialogue.is-in {
    transform: none;
  }

  .dialogue__box {
    border-radius: 24px 24px 0 0;
    padding: 16px 16px calc(16px + var(--safe-b));
    gap: 10px;
    overflow: auto;
  }

  .dialogue__card {
    position: static;
    width: auto;
    max-height: 30vh;
    margin: 0 10px 8px;
    padding: 16px;
    border-radius: 20px;
  }

  .dialogue__text {
    font-size: 15px;
    min-height: 2.6em;
  }

  .dialogue__topics {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .chip {
    flex: none;
  }

  .panel {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 62vh;
    padding: 20px 18px calc(20px + var(--safe-b));
    border-radius: 24px 24px 0 0;
    transform: translateY(24px);
  }

  .panel.is-in {
    transform: none;
  }

  .booking__form {
    grid-template-columns: 1fr;
  }

  .modal__box {
    padding: 22px 18px;
  }

  .card__title {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
