/* Everything on screen is meant to sit quietly behind the rooms themselves. */

:root {
  --ink: #16161a;
  --paper: #f4f2ee;
  --muted: rgba(244, 242, 238, 0.55);
  --hairline: rgba(244, 242, 238, 0.18);
  --sans: "Helvetica Neue", Helvetica, "Inter", "Segoe UI", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

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

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

[hidden] { display: none !important; }

/* ------------------------------------------------------------- entry / pause */

#overlay, #desktop-only {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 6vh 6vw;
  background: radial-gradient(120% 90% at 50% 40%, rgba(12, 12, 14, 0.86), rgba(8, 8, 10, 0.97));
  backdrop-filter: blur(14px) saturate(0.9);
  -webkit-backdrop-filter: blur(14px) saturate(0.9);
  transition: opacity 0.7s var(--ease);
}

#overlay.leaving { opacity: 0; pointer-events: none; }

.overlay-inner {
  width: min(560px, 100%);
  text-align: left;
  animation: rise 1.1s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

#overlay h1, #desktop-only h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 68px);
  font-weight: 300;
  letter-spacing: 0.16em;
  line-height: 1.02;
}

.lede {
  margin: 16px 0 0;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.rule {
  height: 1px;
  background: var(--hairline);
  margin: 38px 0 26px;
}

.keys {
  margin: 0 0 38px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px 28px;
}

.keys > div { display: flex; align-items: baseline; gap: 12px; }

.keys dt {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  min-width: 74px;
}

.keys dd {
  margin: 0;
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
}

#enter {
  appearance: none;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 17px 40px;
  cursor: pointer;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), opacity 0.3s;
}

#enter:hover:not(:disabled) { background: rgba(244, 242, 238, 0.1); border-color: rgba(244, 242, 238, 0.4); }
#enter:disabled { opacity: 0.4; cursor: default; }

.fine {
  margin: 22px 0 0;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: rgba(244, 242, 238, 0.32);
}

/* -------------------------------------------------------------------- in-room */

#reticle {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 10;
  translate: -50% -50%;
  pointer-events: none;
}

#reticle span {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s var(--ease);
}

#reticle.active span {
  width: 9px;
  height: 9px;
  background: rgba(255, 255, 255, 0.85);
}

#plaque {
  position: fixed;
  left: 50%;
  bottom: 8vh;
  translate: -50% 0;
  z-index: 12;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
}

#plaque.show { opacity: 1; transform: none; }

.plaque-title {
  font-size: 17px;
  font-weight: 300;
  letter-spacing: 0.09em;
}

.plaque-meta {
  margin-top: 7px;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.plaque-hint {
  margin-top: 14px;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
}

#toast {
  position: fixed;
  left: 50%;
  top: 11vh;
  translate: -50% 0;
  z-index: 12;
  font-size: 11px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s var(--ease);
}

#toast.show { opacity: 1; }

/* ----------------------------------------------------------------- focus view */

#focus {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 14;
  padding: 0 0 6vh;
  display: grid;
  justify-items: center;
  gap: 22px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
  background: linear-gradient(to top, rgba(8, 8, 10, 0.55), rgba(8, 8, 10, 0));
  padding-top: 14vh;
}

#focus.show { opacity: 1; }

.focus-inner { text-align: center; max-width: min(620px, 80vw); }

.focus-title {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.1em;
}

.focus-meta {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.focus-note {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.62);
}

.focus-hint {
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
}

/* ------------------------------------------------------------ walking together */

.together {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--hairline);
  display: grid;
  gap: 14px;
  justify-items: start;
}

.field {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 280px;
}

.field span {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.share input {
  appearance: none;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 11px 13px;
  width: 100%;
}

.field input:focus,
.share input:focus {
  outline: none;
  border-color: rgba(244, 242, 238, 0.45);
}

.share {
  display: flex;
  gap: 8px;
  width: 100%;
  align-items: stretch;
}

.share input { font-size: 12px; color: var(--muted); }

button.ghost {
  appearance: none;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 12px 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

button.ghost:hover { background: rgba(244, 242, 238, 0.08); border-color: rgba(244, 242, 238, 0.35); }

#presence {
  position: fixed;
  right: 22px;
  bottom: 22px;
  /* Above the entry overlay: with the pointer locked the mouse cannot reach this
     button at all, so it has to stay clickable on the one screen where there is
     a cursor. */
  z-index: 45;
  display: grid;
  gap: 10px;
  justify-items: end;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.here { color: rgba(255, 255, 255, 0.55); }

.mic {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 10, 12, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.75);
  font: inherit;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.mic:hover { color: #fff; border-color: rgba(255, 255, 255, 0.45); }

.mic-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.mic.live .mic-dot {
  background: #7ee08a;
  box-shadow: 0 0 0 3px rgba(126, 224, 138, 0.18);
}

.mic.muted .mic-dot { background: #e07e7e; box-shadow: 0 0 0 3px rgba(224, 126, 126, 0.16); }

/* Direction to a work someone has just pointed out. */
#pointer {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 11;
  translate: -50% -50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

#pointer.show { opacity: 1; }

/* Only drawn while the work is off screen — once it is in view the crop marks
   in the room itself do the job, and two markers on one work read as noise. */
#pointer .ring {
  width: 74px;
  height: 74px;
  margin: -37px 0 0 -37px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  position: absolute;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

#pointer.edge .ring { opacity: 1; }

#pointer .who {
  position: absolute;
  /* Clear of the crop marks, which sit roughly a work's half-height away. */
  translate: -50% 92px;
  white-space: nowrap;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}

.plaque-with { color: rgba(255, 255, 255, 0.75) !important; }
