body.page-hallway {
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #0b1230;
}

.page-hallway .topbar,
.page-home .topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  pointer-events: none;
}

.page-hallway .topbar .brand,
.page-hallway .topbar .account,
.page-home .topbar .brand,
.page-home .topbar .account {
  pointer-events: auto;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.5);
}

.page-hallway [hidden] {
  display: none !important;
}

.hallway-stage {
  position: fixed;
  inset: 0;
}

.hallway-stage .engine-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}

.hallway-stage .engine-canvas:focus-visible {
  outline: 3px solid var(--glow);
  outline-offset: -3px;
}

/* Glassy pills, like the room's chips but cooler for the vault. */
.pill,
.hallway-modes button,
.hallway-find,
.hallway-sound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  color: #eef1ff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.pill {
  background: #f4b860;
  color: #241634;
}

.pill:hover,
.pill:focus-visible {
  background: #ffd08a;
}

.pill-light {
  background: #f6efe4;
}

.pill-quiet {
  background: rgb(255 255 255 / 0.1);
  color: #eef1ff;
}

.pill-quiet:hover,
.pill-quiet:focus-visible {
  background: rgb(255 255 255 / 0.18);
}

.hallway-dock,
.hallway-ride,
.door-card {
  position: fixed;
  left: 50%;
  z-index: 15;
  transform: translateX(-50%);
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgb(14 19 44 / 0.78);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.45);
  backdrop-filter: blur(12px);
}

.hallway-dock {
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem;
  border-radius: 999px;
}

.hallway-modes {
  display: flex;
  gap: 0.25rem;
}

.hallway-modes button {
  background: transparent;
  color: #c6cbe6;
}

.hallway-modes button[aria-pressed='true'] {
  background: #f6efe4;
  color: #1c1430;
}

.hallway-modes button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hallway-sound {
  gap: 0.35rem;
  color: #c6cbe6;
}

.hallway-sound[aria-pressed='true'] {
  background: rgb(244 184 96 / 0.22);
  color: #ffd08a;
  box-shadow: inset 0 0 0 1px rgb(244 184 96 / 0.5);
}

.hallway-ride {
  top: max(4.2rem, calc(env(safe-area-inset-top) + 3.6rem));
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: calc(100vw - 1.5rem);
  padding: 0.35rem 0.4rem 0.35rem 1.1rem;
  border-radius: 999px;
  color: #c6cbe6;
  font-size: 0.92rem;
  white-space: nowrap;
}

.hallway-ride-name {
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
}

.door-card {
  bottom: calc(max(1.1rem, env(safe-area-inset-bottom)) + 4rem);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.4rem 0.9rem;
  width: min(28rem, calc(100vw - 1.5rem));
  padding: 1rem 1rem 1rem 1.1rem;
  border-radius: 20px;
  animation: card-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.97);
  }
}

.door-card-swatch {
  width: 34px;
  height: 52px;
  border-radius: 6px 6px 3px 3px;
  box-shadow: inset 0 0 0 3px rgb(0 0 0 / 0.18), 0 0 18px rgb(255 201 120 / 0.35);
}

.door-card-name {
  margin: 0;
  font-size: 1.1rem;
}

.door-card-status {
  margin: 0.15rem 0 0;
  color: #c6cbe6;
  font-size: 0.88rem;
}

.door-card-where {
  margin: 0 0 0.15rem;
  color: #8fb3ff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.door-card.is-near {
  border-color: rgb(255 180 77 / 0.55);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.45), 0 0 34px rgb(255 180 77 / 0.28);
}

.door-card.is-near .door-card-where {
  color: #ffc46b;
}

.hallway-near-count {
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgb(255 180 77 / 0.2);
  color: #ffd08a;
  font-size: 0.78rem;
  font-weight: 700;
}

.hallway-city {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  color: #c6cbe6;
  font-size: 0.9rem;
}

.hallway-city select {
  flex: 1;
  min-height: 40px;
  padding: 0 0.75rem;
  border: 1px solid rgb(255 180 77 / 0.4);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.06);
  color: var(--ink);
  font: inherit;
}

.hallway-city option {
  background: #121a3d;
}

.door-list-near {
  margin-left: auto;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgb(255 180 77 / 0.2);
  color: #ffd08a;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.door-list-item.is-near .door-list-swatch {
  box-shadow: inset 0 0 0 2px rgb(0 0 0 / 0.2), 0 0 12px rgb(255 180 77 / 0.7);
}

.door-card-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
}

.door-card-actions .pill {
  flex: 1;
}

.door-card-close {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  color: #eef1ff;
  font-size: 1.2rem;
  cursor: pointer;
}

.hallway-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 16;
  margin: 0;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgb(14 19 44 / 0.85);
  color: #fff;
  font-size: 0.85rem;
  pointer-events: none;
  white-space: nowrap;
}

/* Warm light that fills the screen as you go through a door. */
.hallway-fade {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: radial-gradient(circle at 50% 55%, #fff4dc 0%, #ffd9a0 45%, #2b1d2e 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

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

body.is-arriving .hallway-dock,
body.is-arriving .topbar {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hallway-dialog {
  width: min(30rem, calc(100vw - 2rem));
  max-height: min(36rem, calc(100dvh - 3rem));
  padding: 1.4rem;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 20px;
  background: #121a3d;
  color: var(--ink);
}

.hallway-dialog::backdrop {
  background: rgb(5 8 22 / 0.6);
  backdrop-filter: blur(3px);
}

.hallway-dialog h2 {
  margin: 0 0 0.8rem;
}

.hallway-dialog-close-form {
  float: right;
}

.hallway-dialog-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  color: var(--ink);
  font-size: 1.3rem;
  cursor: pointer;
}

.hallway-search {
  width: 100%;
  min-height: 44px;
  margin-bottom: 0.75rem;
  padding: 0 0.9rem;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.06);
  color: var(--ink);
  font: inherit;
}

.door-list {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.door-list-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
}

.door-list-link:hover,
.door-list-link:focus-visible {
  background: rgb(255 255 255 / 0.08);
}

.door-list-swatch {
  flex: none;
  width: 22px;
  height: 34px;
  border-radius: 4px 4px 2px 2px;
  background: var(--door);
  box-shadow: inset 0 0 0 2px rgb(0 0 0 / 0.2);
}

.door-list-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.door-list-name {
  font-weight: 600;
}

.door-list-status {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.door-list-empty,
.door-list-claim {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.hallway-fallback {
  position: relative;
  z-index: 5;
  max-width: 32rem;
  margin: 5rem auto 2rem;
  padding: 1.5rem;
  border-radius: 20px;
  background: #121a3d;
}

body.page-hallway:has(.hallway-fallback:not([hidden])) {
  overflow: auto;
}

@media (max-width: 600px) {
  .hallway-ride-hint,
  .hallway-sound-label {
    display: none;
  }

  .hallway-dock {
    width: calc(100vw - 1.5rem);
    justify-content: space-between;
  }

  .hallway-modes button,
  .hallway-find,
  .hallway-sound {
    padding: 0 0.8rem;
    font-size: 0.86rem;
  }

  .hallway-near-count {
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
  }
}

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

  .hallway-fade {
    transition: none;
  }
}

/* ---- Home page: the rails behind the headline ---- */

body.page-home {
  min-height: 100dvh;
  background: #0b1230;
}

.home-stage {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

.home-stage.is-ready {
  opacity: 1;
}

.home-stage .engine-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Keeps the words readable over the doors. */
.home-shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgb(11 18 48 / 0.92) 0%, rgb(11 18 48 / 0.7) 38%, rgb(11 18 48 / 0) 70%),
    linear-gradient(0deg, rgb(11 18 48 / 0.7) 0%, rgb(11 18 48 / 0) 30%);
}

.home-hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 34rem;
  min-height: 100dvh;
  padding: 6rem clamp(1.25rem, 6vw, 4.5rem) 3rem;
}

.home-kicker {
  margin: 0;
  color: #8fb3ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.home-title {
  margin: 0.6rem 0 0.9rem;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: clamp(2.8rem, 8vw, 4.8rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.home-title em {
  color: #f4b860;
  font-weight: 500;
}

.home-lede {
  max-width: 28rem;
  margin: 0;
  color: #c6cbe6;
  font-size: 1.08rem;
  line-height: 1.6;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.8rem;
}

.pill-big {
  min-height: 50px;
  padding: 0 1.5rem;
  font-size: 1rem;
}

.home-actions .pill:not(.pill-quiet) {
  box-shadow: 0 8px 30px rgb(244 184 96 / 0.35);
}

.home-alt {
  margin: 1.4rem 0 0;
  color: #9aa2c8;
  font-size: 0.92rem;
}

.home-alt a {
  color: #ffd08a;
}

@media (max-width: 600px) {
  .home-shade {
    background: linear-gradient(0deg, rgb(11 18 48 / 0.95) 0%, rgb(11 18 48 / 0.75) 55%, rgb(11 18 48 / 0.2) 100%);
  }

  .home-hero {
    justify-content: flex-end;
    padding-bottom: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-stage {
    transition: none;
  }
}
