:root {
  --bg: #070707;
  --panel: #141414;
  --panel-soft: #1d1d1f;
  --text: #f5f5f7;
  --muted: #a7a7ad;
  --line: rgba(255, 255, 255, 0.12);
  --button: #f5f5f7;
  --button-text: #050505;
  --yellow: #ffd84d;
  --yellow-strong: #ffcc00;
  --safe-bottom: max(20px, env(safe-area-inset-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body {
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

.home-shell,
.guide-shell {
  min-height: 100svh;
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.12), transparent 34rem),
    linear-gradient(180deg, #101010 0%, var(--bg) 52%);
}

.home-shell,
.intro-screen,
.finish-screen,
.error-screen {
  display: grid;
  place-items: center;
  padding: max(28px, env(safe-area-inset-top)) 20px var(--safe-bottom);
}

.intro-panel,
.finish-panel {
  width: min(100%, 430px);
  text-align: center;
}

.eyebrow,
.guide-brand,
.step-count,
.step-kicker {
  margin: 0;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.eyebrow,
.guide-brand {
  color: var(--text);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.45rem, 15vw, 4.7rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin: 4px 0 10px;
  font-size: clamp(2rem, 10vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro-copy {
  margin: 0 auto 32px;
  max-width: 22rem;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.45;
}

.home-actions,
.intro-actions {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.primary-button,
.primary-link,
.secondary-link,
.open-view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  padding: 0 28px;
  text-decoration: none;
  cursor: pointer;
}

.primary-button,
.primary-link {
  width: min(100%, 320px);
  background: var(--button);
  color: var(--button-text);
  font-weight: 750;
  font-size: 1rem;
}

.secondary-link {
  min-height: 44px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.94rem;
}

.guide-page {
  touch-action: manipulation;
}

.walk-screen {
  min-height: 100svh;
  padding: max(14px, env(safe-area-inset-top)) 14px calc(116px + var(--safe-bottom));
}

.guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  width: min(100%, 560px);
  margin: 0 auto 12px;
}

.step-count {
  margin-top: 4px;
}

.back-button {
  min-width: 76px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.progress-track {
  width: min(100%, 560px);
  height: 5px;
  margin: 0 auto 16px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--button);
  transition: width 220ms ease;
}

.step-card {
  width: min(100%, 560px);
  margin: 0 auto;
}

.fade-in {
  animation: fadeIn 180ms ease both;
}

.step-copy {
  padding: 2px 2px 12px;
}

.step-instruction {
  margin: 0;
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.4;
}

.scene-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(52svh, 470px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01)),
    #101010;
}

.scene-shell::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.scene-shell::after {
  content: "";
  position: absolute;
  inset: auto auto 18px 18px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.scene-loading,
.scene-fallback {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(86%, 330px);
  text-align: center;
}

.scene-loading {
  color: var(--muted);
  font-size: 1rem;
}

.scene-fallback p {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.35;
}

.open-view-button {
  min-height: 54px;
  width: min(100%, 280px);
  color: var(--button-text);
  background: var(--button);
  font-weight: 750;
}

.return-note {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.special-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.special-note strong {
  display: block;
  margin-bottom: 3px;
  font-size: 1.02rem;
}

.special-note small {
  display: block;
  color: var(--muted);
  line-height: 1.3;
}

.alert-card {
  color: #171100;
  background: linear-gradient(180deg, #ffe681, var(--yellow-strong));
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 216, 77, 0.3), 0 18px 42px rgba(255, 204, 0, 0.18);
}

.alert-card small {
  color: rgba(23, 17, 0, 0.72);
}

.access-card-icon {
  flex: 0 0 auto;
  width: 52px;
  height: 36px;
  border-radius: 7px;
  background: #fff7cf;
  border: 2px solid rgba(23, 17, 0, 0.24);
  position: relative;
}

.access-card-icon::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 12px;
  height: 10px;
  border-radius: 2px;
  border: 2px solid rgba(23, 17, 0, 0.42);
}

.access-card-icon span,
.access-card-icon::after {
  content: "";
  position: absolute;
  right: 9px;
  height: 2px;
  width: 16px;
  border-radius: 999px;
  background: rgba(23, 17, 0, 0.42);
}

.access-card-icon span {
  top: 12px;
}

.access-card-icon::after {
  top: 20px;
}

.pulse {
  animation: pulse 1.6s ease-in-out infinite;
}

.floor-card {
  border-color: rgba(255, 255, 255, 0.22);
  background: #171717;
}

.lift-icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 6px;
  font-weight: 800;
}

.lift-icon::before,
.lift-icon::after {
  content: "";
  position: absolute;
  top: -10px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

.lift-icon::before {
  left: 9px;
  border-bottom: 7px solid var(--text);
}

.lift-icon::after {
  right: 9px;
  border-top: 7px solid var(--text);
}

.lift-icon span {
  color: var(--yellow);
  font-size: 1.45rem;
}

.apartment-marker {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  border: 2px solid var(--yellow);
  background: rgba(255, 216, 77, 0.08);
  box-shadow: 0 0 28px rgba(255, 216, 77, 0.18);
}

.guide-marker-label {
  color: var(--yellow);
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.marker-number {
  color: var(--text);
  font-size: 3.6rem;
  font-weight: 850;
  line-height: 0.92;
}

.home-card {
  background: #171717;
}

.home-icon {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 44px;
}

.home-icon::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 3px;
  width: 28px;
  height: 28px;
  transform: rotate(45deg);
  border-radius: 3px;
  background: var(--button);
}

.home-icon span {
  position: absolute;
  left: 8px;
  bottom: 0;
  width: 32px;
  height: 27px;
  border-radius: 3px;
  background: var(--button);
}

.home-icon span::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 0;
  width: 8px;
  height: 15px;
  border-radius: 4px 4px 0 0;
  background: var(--bg);
}

.bottom-controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 10px 18px var(--safe-bottom);
  background: linear-gradient(180deg, rgba(7, 7, 7, 0), rgba(7, 7, 7, 0.86) 22%, rgba(7, 7, 7, 0.98));
}

.arrow-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  max-width: 360px;
  width: min(100%, 360px);
  padding: 8px 18px 8px 10px;
  border: 0;
  border-radius: 999px;
  color: var(--button-text);
  background: var(--button);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.arrow-ring {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  color: var(--button);
  background: var(--button-text);
}

.arrow-symbol {
  display: block;
  transform: translateY(-1px);
  font-size: 2rem;
  line-height: 1;
}

.arrow-label {
  min-width: 0;
  font-size: 1rem;
  line-height: 1.1;
  white-space: normal;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.015);
  }
}

@media (min-width: 720px) {
  .walk-screen {
    padding-top: 24px;
  }

  .scene-shell {
    min-height: 460px;
  }
}

@media (max-width: 360px) {
  .walk-screen {
    padding-left: 12px;
    padding-right: 12px;
  }

  .arrow-button {
    min-height: 64px;
  }

  .arrow-ring {
    width: 48px;
    height: 48px;
  }

  .marker-number {
    font-size: 3rem;
  }
}

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