/* door.css — the front door (js/door.js).
   The void with nothing on it but the drifting words, the typed lines, and
   the pills. The chrome steps back while the door stands: no portal, no Lexi,
   no profile, because nobody has been handed those yet. The sound toggle, the
   feedback beacon and the version stamp stay. */

/* ---------- the chrome, stepped back ---------- */

/* The sound toggle is the one control that stays (Ahmet, 2026-09-02): the
   ambient may rise on the door's first tap, and it should be turnable there. */
body.at-door #map-btn,
body.at-door #counter,
body.at-door #back-btn,
body.at-door #profile-btn {
  opacity: 0;
  pointer-events: none;
}

/* A returning traveller's own sky glows softly behind the door: the promise
   that it was kept. A stranger's sky is empty, so this costs them nothing. */
#constellation { transition: opacity 1.2s ease; }
body.at-door #constellation { opacity: 0.5; }

/* ---------- the door ---------- */

.fd-head {
  font-size: clamp(2rem, 6vw, 3.4rem);
  margin-bottom: 0.35em;
  min-height: 1.2em;
}

.fd {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 46vh;
  justify-content: center;
}

.fd-line {
  min-height: 3.2em;
  max-width: 30em;
}

.fd-choices {
  margin-top: 2em;
}

/* The one word that stands out: the way back in, or the way in. */
.fd-continue,
.fd-begin {
  font-size: clamp(0.92rem, 2.3vw, 1.08rem);
  padding: 0.6em 1.5em;
}
.fd-continue .pill-tag {
  display: block;
  margin-top: 0.25em;
}

/* Sign in and the two panels are quieter: doors, not answers. */
.fd-signin,
.fd-info {
  font-family: var(--sans);
  font-size: clamp(0.74rem, 1.8vw, 0.84rem);
  color: var(--lavender);
  border-color: rgba(154, 147, 184, 0.35);
}
.fd-signin:hover, .fd-signin:focus-visible,
.fd-info:hover, .fd-info:focus-visible {
  color: var(--cream);
  border-color: rgba(185, 180, 232, 0.8);
  background: rgba(140, 135, 220, 0.08);
}

.fd-nudge {
  margin-top: 1.4em;
  max-width: 26em;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--lavender);
  opacity: 0;
  transition: opacity 0.9s ease;
}
.fd-nudge.show { opacity: 0.8; }

.fd-finding {
  font-family: var(--sans);
  font-style: italic;
  font-size: 13px;
  color: var(--lavender);
  padding: 0.6em 0;
  animation: hint-pulse 2.6s ease-in-out infinite;
}

/* ---------- the drifting words ---------- */

/* Each crossing is one element with its own numbers (js/door.js): the band
   it starts in (--y), the slant it takes (--dy), its pace (--dur), and the
   period of its bob (--bob). The drift is the outer span; the bob is the
   inner one, so the two motions add without fighting over one transform. */
.fd-fly {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}
.fd-word {
  position: absolute;
  top: var(--y, 12vh);
  left: 0;
  pointer-events: auto;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3.2vw, 1.7rem);
  white-space: nowrap;
  will-change: transform;
  animation: door-drift var(--dur, 26s) linear var(--delay, 0s) 1 forwards;
  cursor: help;
}
.fd-word-bob {
  display: inline-block;
  animation: door-bob var(--bob, 3s) ease-in-out infinite alternate;
}
.fd-word:hover,
.fd-word:hover .fd-word-bob { animation-play-state: paused; }
@keyframes door-drift {
  from { transform: translate(-30vw, 0); }
  to   { transform: translate(130vw, var(--dy, 0vh)); }
}
@keyframes door-bob {
  from { transform: translateY(-5px) rotate(-1.5deg); }
  to   { transform: translateY(5px) rotate(1.5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .fd-word {
    animation: none;
    left: 50%;
    transform: translateX(-50%);
  }
  .fd-word-bob { animation: none; }
}

/* ---------- the panels ---------- */

#door-panel {
  position: fixed;
  inset: 0;
  z-index: 45; /* under the account door (50), over everything else */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 6, 20, 0.72);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.35s ease;
  cursor: default;
  text-align: left;
}
#door-panel.show { opacity: 1; }

.dp-shell {
  position: relative;
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 34px 32px 28px;
  background: rgba(20, 15, 40, 0.96);
  border: 1px solid rgba(140, 135, 220, 0.3);
  border-radius: 16px;
  box-shadow: 0 12px 60px rgba(5, 4, 16, 0.6), 0 0 32px rgba(140, 135, 220, 0.12);
  transform: translateY(10px);
  transition: transform 0.35s ease;
}
#door-panel.show .dp-shell { transform: none; }

.dp-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--lavender);
  font-size: 15px;
  cursor: pointer;
  opacity: 0.6;
  padding: 6px;
}
.dp-close:hover { opacity: 1; }

.dp-title {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--cream);
  margin: 0 0 16px;
}
.dp-p {
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--lavender);
  margin: 0 0 12px;
}
.dp-p .m-root { cursor: help; }
.dp-back {
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--lavender);
}

@media (max-width: 600px) {
  .dp-shell { padding: 28px 22px 22px; }
  .dp-title { font-size: 19px; }
}
