/* ==========================================================================
   The Galerie room (aperture and wall labels). Same rules as sections.css:
   complete without motion, motion only adds.
   ========================================================================== */

/* ---------- Aperture ---------- */
.aperture {
  /* The room is always a dark stage: the light-on-dark pair, whatever the page tokens are. */
  --ink: #0a0a0a;
  --paper: #ffffff;
  --hairline: rgb(255 255 255 / 0.16);
  --muted: rgb(10 10 10 / 0.62);
  background: var(--ink);
  color: var(--paper);
}

.aperture__stage {
  position: relative;
  height: 100svh;
  min-height: 34rem;
  overflow: hidden;
  container-type: size;
}

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

/* Image and hotspot layers share this box: the image's own aspect ratio,
   scaled to cover the stage like object-fit: cover. Percent positions inside
   it therefore land on the same spot of the photo at any screen size. */
.aperture__cover {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100cqw, calc(100cqh * 2400 / 1340));
  aspect-ratio: 2400 / 1340;
  translate: -50% -50%;
}

.aperture__cover img {
  width: 100%;
  height: 100%;
}

/* Caption gradient: above the photo, below the hotspots. */
.aperture__window::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgb(0 0 0 / 0.78), rgb(0 0 0 / 0) 55%);
  pointer-events: none;
}

.aperture__spots {
  z-index: 2;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

/* Portrait screens: crop toward the right of the room, where the labels are. */
@media (max-aspect-ratio: 1 / 1) {
  .aperture__cover {
    translate: var(--room-shift, -60%) -50%;
  }
}

.spot {
  position: absolute;
  top: var(--y);
  left: var(--x);
  pointer-events: auto;
}

.spot__dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.875rem 0 0 -0.875rem;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.7);
  border-radius: 50%;
  background: rgb(10 10 10 / 0.55);
  backdrop-filter: blur(6px);
  color: var(--paper);
  font: 500 0.6875rem/1 var(--font-mono);
  cursor: pointer;
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease, scale var(--duration-normal) var(--ease-out);
}

.spot__dot:hover,
.spot__dot:focus-visible,
.spot.is-open .spot__dot {
  background: var(--paper);
  color: var(--ink);
  scale: 1.12;
}

/* A soft ring that breathes, so the labels read as something to touch.
   Off for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .spot__dot::after {
    content: '';
    position: absolute;
    inset: -6px;
    border: 1px solid rgb(255 255 255 / 0.45);
    border-radius: 50%;
    animation: spot-breathe 2400ms ease-in-out infinite;
  }
}

@keyframes spot-breathe {
  50% {
    opacity: 0;
    scale: 1.35;
  }
}

.spot__label {
  position: absolute;
  top: 1.25rem;
  left: 50%;
  z-index: 1;
  display: grid;
  gap: 0.15rem;
  min-width: 11rem;
  padding: 0.7rem 0.85rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.35;
  box-shadow: 0 1rem 2rem -1rem rgb(0 0 0 / 0.6);
  opacity: 0;
  translate: -50% 0.35rem;
  pointer-events: none;
  transition: opacity var(--duration-fast) ease, translate var(--duration-normal) var(--ease-out);
}

.spot:hover .spot__label,
.spot:focus-within .spot__label,
.spot.is-open .spot__label {
  opacity: 1;
  translate: -50% 0;
}

.spot__title {
  font-weight: 500;
}

.spot__medium {
  color: var(--muted);
}

.spot__price {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
}

.aperture__badge {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(9rem, 17vw, 15rem);
  aspect-ratio: 1;
  translate: -50% -50%;
}

/* The badge only means something while the aperture is closed (motion only). */
html:not(.has-motion) .aperture__badge {
  display: none;
}

.aperture__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: var(--paper);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.aperture__enter {
  display: grid;
  place-items: center;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.14);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-family: var(--font-display);
  font-size: clamp(1rem, 0.75rem + 0.8vw, 1.5rem);
  font-weight: 700;
  text-transform: uppercase;
}

.aperture__caption {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  inset: auto var(--margin) clamp(2rem, 6vh, 4rem);
  display: grid;
  justify-items: start;
  gap: 1rem;
  max-width: 44rem;
}

.aperture__caption a,
.aperture__caption button {
  pointer-events: auto;
}

.aperture__caption .display {
  font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.625rem);
}

.aperture__caption p:not(.eyebrow) {
  max-width: 32rem;
  color: rgb(255 255 255 / 0.82);
  font-size: var(--text-lead);
}

/* The caption's button is light on the dark stage. */
.aperture .button {
  border-color: #fff;
  background: #fff;
  color: #0a0a0a;
}

/* ---------- Rooms: one panel per room, switched by tabs and doorways ---------- */
.aperture__room {
  position: absolute;
  inset: 0;
}

/* Walking into a room: it comes forward out of the doorway. */
@media (prefers-reduced-motion: no-preference) {
  .aperture__room.is-entering {
    animation: room-enter 900ms var(--ease-out) both;
  }
}

@keyframes room-enter {
  from {
    opacity: 0;
    scale: 1.18;
  }
}

.room-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.room-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid rgb(255 255 255 / 0.32);
  border-radius: 999px;
  background: rgb(10 10 10 / 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font: 500 0.8125rem/1 var(--font-body);
  cursor: pointer;
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.room-tab:hover {
  border-color: #fff;
}

.room-tab[aria-selected='true'] {
  border-color: #fff;
  background: #fff;
  color: #0a0a0a;
}

.room-tab__n {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  opacity: 0.6;
}

.aperture__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.aperture__count {
  color: rgb(255 255 255 / 0.72);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* Doorways: a pill on the wall that takes you to the next room. */
.spot__door {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgb(255 255 255 / 0.6);
  border-radius: 999px;
  background: rgb(10 10 10 / 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font: 500 0.75rem/1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  translate: -50% -50%;
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

.spot__door:hover,
.spot__door:focus-visible {
  background: #fff;
  color: #0a0a0a;
}

/* The rooftop's note: always on the wall, like a printed card. */
.spot__note {
  display: grid;
  gap: 0.2rem;
  width: 12rem;
  padding: 0.75rem 0.9rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.35;
  translate: -50% -50%;
}

.spot__note .spot__medium {
  color: rgb(255 255 255 / 0.85);
}

@media (max-width: 600px) {
  .spot__note {
    display: none;
  }
}
