/* ============================================================
   Doorbin — the house of stories (museum/index.html, js/museum.js).
   The scene fills the screen; everything else is a quiet layer on top,
   in the site's own type and its circular arrows.
   ============================================================ */
html, body.museum-page { height: 100%; overflow: hidden; overscroll-behavior: none; background: #0b0807; }

.museum {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  color: #f2efe9;
}
.museum__scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
.museum__scene.is-looking { cursor: grabbing; }
/* a soft vignette, as the eye sees a dim room */
.museum::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(ellipse 75% 70% at 50% 48%, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, 0.28) 100%);
  pointer-events: none;
}
.museum__fade { position: absolute; inset: 0; z-index: 3; background: #050403; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.museum__fade.is-on { opacity: 1; }

/* ---------------- the entrance ---------------- */
.museum__intro {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 96px 24px 48px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 55%, rgba(11, 8, 7, 0.35), rgba(11, 8, 7, 0.88) 70%);
  transition: opacity 0.9s ease;
}
.museum__intro.is-gone { opacity: 0; pointer-events: none; }
.museum__eyebrow { margin: 0; font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: #cfc9bd; }
.museum__title {
  margin: 0;
  font-family: var(--font-sans);   /* the site's sans, Jost, in its thinnest weight */
  font-weight: 200;
  font-size: clamp(44px, 7.4vw, 96px);
  line-height: 1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.museum__lede { margin: 0; max-width: 34ch; font-size: clamp(16px, 1.4vw, 19px); font-weight: 300; line-height: 1.55; color: #e6e0d4; }
.museum__controls { margin: 4px 0 6px; max-width: 46ch; font-size: 12px; line-height: 1.8; letter-spacing: 0.06em; color: #b9b3a7; }
.museum__controls span { color: #f2efe9; }
.museum__enter {
  height: 46px;
  padding: 0 34px;
  border: 1px solid rgba(242, 239, 233, 0.5);
  border-radius: 999px;
  background: none;
  color: #f2efe9;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}
.museum__enter:hover:not([disabled]) { background: #f2efe9; color: #0b0807; border-color: #f2efe9; }
.museum__enter[disabled] { opacity: 0.5; cursor: progress; letter-spacing: 0.12em; text-transform: none; }
.museum__credit { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; margin: 0; font-size: 10px; letter-spacing: 0.08em; color: rgba(242, 239, 233, 0.45); text-align: center; }
.museum__credit a { color: inherit; }
.museum__enter:focus-visible { outline: 1px solid #f2efe9; outline-offset: 4px; }

/* ---------------- while walking ---------------- */
.museum__found,
.museum__hint,
.museum__corner,
.museum__toast {
  position: absolute;
  z-index: 4;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  margin: 0;
}
.museum__found {
  left: var(--gutter-sm);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #cfc9bd;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.8s ease 0.6s;
}
.museum.is-in .museum__found { opacity: 1; }
.museum__hint {
  left: 50%;
  transform: translate(-50%, 6px);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #e6e0d4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease, transform 0.9s var(--ease);
}
.museum__hint.is-on { opacity: 0.85; transform: translate(-50%, 0); }
.museum__hint.is-gone { opacity: 0; }
.museum__toast {
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 8px);
  font-family: var(--font-serif);
  font-size: 22px;
  color: #f2efe9;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.8s var(--ease);
}
.museum__toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* the tour: one quiet button beside the count */
.museum__tour {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 18px 0 14px;
  border: 1px solid rgba(242, 239, 233, 0.32);
  border-radius: 999px;
  background: rgba(11, 8, 7, 0.45);
  color: #f2efe9;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease 0.6s, border-color 0.3s ease, background 0.3s ease;
}
.museum__tour svg { width: 12px; height: 12px; display: block; }
.museum.is-in .museum__tour { opacity: 1; pointer-events: auto; }
.museum.is-focus .museum__tour { opacity: 0; pointer-events: none; transition-delay: 0s; }
.museum__tour:hover, .museum__tour[aria-pressed="true"] { border-color: #f2efe9; background: rgba(242, 239, 233, 0.14); }
.museum__tour:focus-visible { outline: 1px solid #f2efe9; outline-offset: 3px; }
.museum.is-touring .museum__hint { opacity: 0; }
@media (max-width: 699px) { .museum__tour { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); height: 34px; font-size: 10px; letter-spacing: 0.16em; } }

/* the thumb's joystick, where the thumb lands */
.museum__stick {
  position: absolute;
  z-index: 4;
  width: 112px; height: 112px;
  margin: -56px 0 0 -56px;
  border: 1px solid rgba(242, 239, 233, 0.35);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.museum__stick.is-on { opacity: 1; }
.museum__stick span {
  position: absolute;
  left: 50%; top: 50%;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(242, 239, 233, 0.22);
  border: 1px solid rgba(242, 239, 233, 0.5);
}

/* ---------------- the time of day ---------------- */
.museum__time {
  position: absolute;
  z-index: 4;
  right: var(--gutter-sm);
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 4px;
  color: #f2efe9;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease 0.6s;
}
.museum.is-in .museum__time { opacity: 1; pointer-events: auto; }
.museum.is-focus .museum__time { opacity: 0; pointer-events: none; transition-delay: 0s; }
.museum__time-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.museum__sun { width: 15px; height: 15px; display: block; }
.museum__clock {
  min-width: 64px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
.museum__range {
  -webkit-appearance: none;
  appearance: none;
  width: 168px;
  height: 28px;
  margin: 0;
  background: none;
  cursor: pointer;
  touch-action: none;
}
.museum__range::-webkit-slider-runnable-track { height: 1px; background: rgba(242, 239, 233, 0.55); }
.museum__range::-moz-range-track { height: 1px; background: rgba(242, 239, 233, 0.55); }
.museum__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  margin-top: -6px;
  border-radius: 50%;
  background: #f2efe9;
  border: 0;
  box-shadow: 0 0 0 4px rgba(242, 239, 233, 0.16);
}
.museum__range::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #f2efe9; border: 0; box-shadow: 0 0 0 4px rgba(242, 239, 233, 0.16); }
.museum__range:focus-visible { outline: 1px solid #f2efe9; outline-offset: 4px; }

/* ---------------- reading a story ---------------- */
.museum__corner { right: var(--gutter-sm); display: flex; align-items: center; gap: 12px; }
.museum__corner[hidden] { display: none; }
.museum__steps { display: flex; gap: 7px; }
.museum__step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  padding: 0;
  border: 1px solid rgba(242, 239, 233, 0.32);
  border-radius: 50%;
  background: rgba(11, 8, 7, 0.55);
  color: #f2efe9;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.museum__step:hover { background: #f2efe9; color: #0b0807; border-color: #f2efe9; }
.museum__step svg { width: 15px; height: 11px; display: block; }
.museum__pill {
  height: 42px;
  padding: 0 20px;
  border: 1px solid rgba(242, 239, 233, 0.32);
  border-radius: 999px;
  background: rgba(11, 8, 7, 0.55);
  color: #f2efe9;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.3s ease;
}
.museum__pill[hidden] { display: none; }
.museum__pill:hover { border-color: #f2efe9; }
.museum__step:focus-visible, .museum__pill:focus-visible { outline: 1px solid #f2efe9; outline-offset: 3px; }
.museum.is-focus .museum__found { opacity: 0.6; }

@media (max-width: 699px) {
  .museum__found { display: none; }
  .museum__time { right: 16px; gap: 10px; }
  .museum__range { width: 132px; }
  .museum__corner { left: 16px; right: 16px; justify-content: space-between; }
  .museum__pill { height: 38px; padding: 0 14px; font-size: 11px; letter-spacing: 0.16em; }
  .museum__step { width: 38px; height: 38px; }
  .museum__hint { font-size: 10px; letter-spacing: 0.14em; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .museum__toast { font-size: 18px; white-space: normal; text-align: center; width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  .museum__intro, .museum__fade, .museum__hint, .museum__toast { transition: none; }
}

/* put away for now; ?time brings it back */
.museum__time[hidden] { display: none !important; }

/* the walking hint sits above the tour button, never under it */
.museum__hint { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 699px) { .museum__hint { bottom: calc(112px + env(safe-area-inset-bottom, 0px)); } }

/* ---------------- no 3D: the stories as a page ---------------- */
.museum.museum--plain { position: relative; overflow: auto; height: 100%; }
.museum__plain { max-width: 760px; margin: 0 auto; padding: 120px 24px 80px; display: grid; gap: 56px; }
.museum__plain > .museum__title { font-size: clamp(40px, 7vw, 72px); }
.museum__story img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; margin-bottom: 18px; border-radius: 2px; }
.museum__story h3 { margin: 6px 0 10px; font-weight: 300; font-size: 28px; line-height: 1.15; }
.museum__fact { margin: 0; font-weight: 300; font-size: 17px; line-height: 1.6; color: #e6e0d4; }
.museum__caption { margin: 10px 0 0; font-size: 12px; letter-spacing: 0.08em; color: #b9b3a7; }
.museum--plain > [hidden] { display: none !important; }
.museum--plain::after { display: none; }

/* the hover cue on a placard or picture: a small dot that breathes */
.museum__dot { position: absolute; z-index: 4; left: 0; top: 0; width: 0; height: 0; pointer-events: none; opacity: 0; transition: opacity 0.35s ease; }
.museum__dot.is-on { opacity: 1; }
.museum__dot::before, .museum__dot::after { content: ""; position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; }
.museum__dot::before { background: #f2efe9; box-shadow: 0 0 10px rgba(242, 239, 233, 0.6); }
.museum__dot::after { border: 1px solid rgba(242, 239, 233, 0.75); animation: museum-dot 1.8s ease-out infinite; }
@keyframes museum-dot { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .museum__dot::after { animation: none; } }

/* the sound switch, bottom right */
.museum__sound { position: absolute; z-index: 4; right: var(--gutter-sm); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid rgba(242, 239, 233, 0.32); border-radius: 50%; background: rgba(11, 8, 7, 0.45); color: #f2efe9; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 0.8s ease 0.6s, border-color 0.3s ease; }
.museum__sound svg { width: 16px; height: 16px; display: block; }
.museum.is-in .museum__sound { opacity: 1; pointer-events: auto; }
.museum.is-focus .museum__sound { opacity: 0; pointer-events: none; transition-delay: 0s; }
.museum__sound:hover { border-color: #f2efe9; }
@media (max-width: 699px) { .museum__sound { right: 16px; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); } }

/* the editor's live preview (?edit): the house alone, no site menu, counters or sound button */
.museum.is-edit .museum__found, .museum.is-edit .museum__tour, .museum.is-edit .museum__sound,
.museum.is-edit .museum__hint, .museum.is-edit .museum__toast, .museum.is-edit .museum__intro { display: none !important; }
body:has(.museum.is-edit) doorbin-nav { display: none !important; }
