/* ------------------------------- the hall -------------------------------- */

body.hall {
  height: 100vh;
  overflow: hidden;
  background: #05050b;
}

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

/* On screens wider than the painting, the artwork is shown whole and a
   blurred copy fills the space either side, so no wing is ever cropped. */
.stage::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: 0;
  background: url("/assets/hall.jpg") center / cover no-repeat;
  filter: blur(80px) brightness(0.62) saturate(0.85) hue-rotate(-8deg);
  pointer-events: none;
}

.hall-frame {
  position: relative;
  z-index: 1;
  width: max(100vw, 150vh);
  aspect-ratio: 3 / 2;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  box-shadow: 0 0 150px 34px rgba(4, 5, 14, 0.92);
}

@media (min-aspect-ratio: 3 / 2) {
  .hall-frame { width: min(100vw, 150vh); }
}

.hall-frame.zooming {
  transition: transform 1s cubic-bezier(0.62, 0.02, 0.36, 1), filter 1s ease;
  transform: scale(3.1);
  filter: brightness(0.98) saturate(1.14);
}

.hall-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  filter: saturate(1.05) contrast(1.1) brightness(1.12);
}

/* A cold wash over the painted hall: the room reads as lit from above by
   moonlight, which keeps the warmth in the picture instead of in the chrome. */
.hall-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 8%, rgba(150, 175, 255, 0.24), transparent 62%),
    linear-gradient(200deg, rgba(64, 70, 140, 0.2), transparent 45%, rgba(12, 14, 34, 0.34));
  mix-blend-mode: soft-light;
}

.grade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 62% at 50% 46%, rgba(0, 0, 0, 0) 38%, rgba(4, 5, 14, 0.42) 100%),
    linear-gradient(180deg, rgba(4, 4, 12, 0.5) 0%, rgba(4, 4, 12, 0) 20%, rgba(4, 4, 12, 0) 76%, rgba(4, 4, 12, 0.55) 100%);
}

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

.hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  padding: 0;
  border: 0;
  background: none;
  border-radius: 50% 50% 7% 7% / 34% 34% 4% 4%;
  -webkit-tap-highlight-color: transparent;
}

.hotspot .glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s ease, box-shadow 0.4s ease;
  background: radial-gradient(
    ellipse 62% 64% at 50% 58%,
    rgba(255, 205, 130, 0.26) 0%,
    rgba(255, 178, 88, 0.12) 46%,
    rgba(255, 160, 70, 0) 72%
  );
  box-shadow: inset 0 0 34px rgba(255, 205, 140, 0.22);
  pointer-events: none;
}

.hotspot:hover .glow,
.hotspot:focus-visible .glow,
.hotspot.pulse .glow {
  opacity: 1;
}

.hotspot .plaque {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -46%);
  display: grid;
  gap: 1px;
  padding: 0.32rem 0.62rem;
  border: 1px solid rgba(233, 182, 77, 0.3);
  border-radius: 2px;
  background: rgba(8, 6, 4, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(5px);
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s, border-color 0.25s;
}

.hotspot:hover .plaque,
.hotspot:focus-visible .plaque {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.02);
  border-color: rgba(232, 198, 110, 0.6);
}

.hotspot .plaque b {
  font-family: var(--sans);
  font-size: clamp(0.58rem, 0.85vw, 0.9rem);
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #f5f2ea;
}
.hotspot .plaque i {
  font-style: normal;
  font-size: clamp(0.46rem, 0.6vw, 0.62rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(240, 236, 226, 0.72);
  opacity: 1;
}

.hotspot.globe .glow {
  background: radial-gradient(
    ellipse 60% 60% at 50% 50%,
    rgba(214, 228, 255, 0.34) 0%,
    rgba(168, 192, 255, 0.16) 48%,
    rgba(140, 170, 255, 0) 74%
  );
  box-shadow: inset 0 0 44px rgba(190, 212, 255, 0.26);
}

.hotspot.gate .plaque b { color: #eef1ff; }

.hotspot.globe .plaque { top: auto; bottom: -4%; transform: translate(-50%, 6px); }
.hotspot.globe:hover .plaque, .hotspot.globe:focus-visible .plaque { transform: translate(-50%, 0); }

/* ------------------------------- chrome --------------------------------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 3vw, 2.4rem);
  background: linear-gradient(180deg, rgba(4, 4, 12, 0.82), rgba(4, 4, 12, 0));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-mark { width: 38px; height: 38px; color: #e9b64d; opacity: 0.95; flex: none; }
.brand h1 {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.6vw, 1.4rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #f5f2ea;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
}
.brand p {
  margin-top: 0.18rem;
  font-size: clamp(0.55rem, 0.7vw, 0.64rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(240, 236, 226, 0.62);
}

.topnav { display: flex; align-items: center; gap: 0.6rem; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid rgba(176, 184, 214, 0.24);
  border-radius: 2px;
  background: rgba(8, 9, 18, 0.55);
  backdrop-filter: blur(6px);
  color: #f0f1f6;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.nav-btn svg { width: 15px; height: 15px; }
.nav-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(176, 184, 214, 0.5); }
.nav-btn.ghost { border-color: transparent; background: transparent; color: #9d9fb4; }
.nav-btn.ghost:hover { color: #f5f2ea; background: rgba(255, 255, 255, 0.06); }
.nav-btn kbd {
  margin-left: 0.15rem;
  padding: 0 0.28rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.62rem;
  color: #9d9fb4;
}

.featured { display: grid; gap: 0.4rem; }
.featured-label {
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 236, 226, 0.62);
  padding: 0 0.15rem;
}
.featured-hint {
  margin-top: 0.55rem;
  padding: 0.85rem 0.15rem 0;
  border-top: 1px solid rgba(176, 184, 214, 0.16);
  font-size: 0.68rem;
  color: #9d9fb4;
  letter-spacing: 0.02em;
}
.featured-hint kbd {
  font-family: var(--mono, monospace);
  font-size: 0.66rem;
  padding: 0.05rem 0.32rem;
  border: 1px solid rgba(176, 184, 214, 0.32);
  border-radius: 2px;
  color: #f1ece0;
}

.hall-hint {
  position: fixed;
  left: clamp(1rem, 3vw, 2.4rem);
  bottom: 1.4rem;
  z-index: 15;
  font-size: 0.62rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: #eceef5;
  text-shadow: 0 1px 3px #000, 0 0 18px rgba(0, 0, 0, 0.95);
  opacity: 0.88;
  transition: opacity 0.6s;
  pointer-events: none;
}
.hall-hint.gone { opacity: 0; }

.wing-list { display: none; }

/* ------------------------------- search --------------------------------- */

.search-card {
  width: min(760px, 100%);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(80vh, 700px);
}
.search-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.search-head svg { width: 20px; height: 20px; color: #e9b64d; flex: none; }
.search-head input::-webkit-search-cancel-button { display: none; }
.search-head input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0;
  border: 0;
  background: transparent;
  font-size: 1.02rem;
  color: var(--ink);
}
.search-head input:focus { outline: none; }
.search-head input::placeholder { color: #7d819b; }

.search-filters {
  display: flex;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: none;
}
.search-filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 0.32rem 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: transparent;
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9d9fb4;
  transition: all 0.18s;
}
.chip:hover { color: #f5f2ea; border-color: rgba(233, 182, 77, 0.4); }
.chip.active { background: rgba(176, 184, 214, 0.18); border-color: rgba(233, 182, 77, 0.55); color: #f5efe2; }

.search-results { overflow-y: auto; padding: 0.5rem 0.6rem 1rem; }
.search-empty { padding: 2.4rem 1rem; text-align: center; color: #7d819b; font-family: var(--serif); font-style: italic; }
.result {
  display: block;
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 0;
  border-radius: 3px;
  background: transparent;
  text-align: left;
  transition: background 0.15s;
}
.result:hover, .result:focus-visible { background: rgba(176, 184, 214, 0.1); }
.result-top { display: flex; align-items: baseline; gap: 0.55rem; flex-wrap: wrap; }
.result-title { font-family: var(--serif); font-size: 1rem; color: #f6f1e7; }
.result-wing {
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e9b64d;
  border: 1px solid rgba(233, 182, 77, 0.28);
  border-radius: 2px;
  padding: 0.1rem 0.35rem;
}
.result-path { font-size: 0.62rem; letter-spacing: 0.08em; color: #7d819b; text-transform: uppercase; }
.result-snippet { margin-top: 0.28rem; font-size: 0.8rem; line-height: 1.5; color: #a3a6bd; }
.result mark { background: rgba(233, 182, 77, 0.26); color: #f8f4ea; padding: 0 1px; }

/* -------------------------------- auth ---------------------------------- */

.auth-card { width: min(430px, 100%); }
.auth-card h2 { font-size: 1.45rem; margin-bottom: 0.4rem; padding-right: 2rem; }
.auth-sub { font-size: 0.82rem; line-height: 1.55; color: #a3a6bd; margin-bottom: 1.3rem; }
.auth-card form { display: grid; gap: 0.95rem; }
.auth-switch { margin-top: 1.1rem; font-size: 0.8rem; color: #a3a6bd; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.auth-card .display-row { display: none; }

.auth-pending { text-align: center; padding: 0.4rem 0 0.2rem; }
.auth-pending .pending-mark {
  font-size: 1.5rem;
  line-height: 1;
  color: #e9b64d;
  margin: 0.2rem 0 0.9rem;
  opacity: 0.85;
}
.auth-pending h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  color: #f6f1e7;
  margin-bottom: 0.55rem;
}
.auth-pending p:not(.pending-mark) {
  font-size: 0.8rem;
  line-height: 1.65;
  color: #a3a6bd;
  max-width: 30ch;
  margin: 0 auto 1.3rem;
}
.auth-card.register .display-row { display: block; }

.license-card { width: min(640px, 100%); }
.license-body { display: grid; gap: 1rem; margin-top: 1.2rem; }
.lic-item { padding-bottom: 0.9rem; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.lic-item:last-child { border-bottom: 0; }
.lic-item h3 { font-family: var(--serif); font-size: 1.05rem; color: #f6f1e7; }
.lic-item .lic-meta { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: #e9b64d; margin: 0.25rem 0 0.45rem; }
.lic-item p { font-size: 0.76rem; line-height: 1.6; color: #a3a6bd; }
.lic-item a { color: #e9b64d; }

.transition {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--tx, 50%) var(--ty, 50%), rgba(26, 30, 54, 0.92), #05050b 62%);
  transition: opacity 0.55s ease;
}
.transition.active { opacity: 1; }

/* ------------------------------ responsive ------------------------------ */

@media (max-width: 900px) {
  .nav-btn span, .nav-btn.ghost { display: none; }
  .brand p { display: none; }
  .hotspot .plaque { padding: 0.22rem 0.4rem; }
  .hotspot .plaque i { display: none; }
}

@media (max-width: 720px) {
  .topbar { padding: 0.7rem 0.9rem; gap: 0.5rem; }
  .brand h1 { font-size: 0.8rem; letter-spacing: 0.14em; }
  .account { gap: 0.3rem; }
  .account-chip { padding: 0.3rem 0.5rem; font-size: 0.62rem; }
  .account-chip em { display: none; }
  .brand-mark { width: 30px; height: 30px; }
  .hotspot .plaque { opacity: 0; }
  .hotspot:focus-visible .plaque { opacity: 1; }
  .wing-list {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    display: flex;
    gap: 0.35rem;
    padding: 0.6rem 0.7rem calc(0.6rem + env(safe-area-inset-bottom));
    overflow-x: auto;
    background: linear-gradient(0deg, rgba(6, 4, 2, 0.94), rgba(6, 4, 2, 0.55));
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(176, 184, 214, 0.18);
    scrollbar-width: none;
  }
  .wing-list::-webkit-scrollbar { display: none; }
  .wing-list button {
    flex: none;
    padding: 0.45rem 0.6rem;
    border: 1px solid rgba(176, 184, 214, 0.22);
    border-radius: 2px;
    background: rgba(20, 14, 9, 0.8);
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #efe9de;
  }
.hall-hint { display: none; }
  .search-card { max-height: 88vh; }
}
