/* The house: a fixed stage you walk through one room at a time. Without
   JavaScript the rooms simply stack, each over its own photograph. */

.house-page {
  background: #120e0b;
}

/* ---------- Without JavaScript: a sequence of rooms ---------- */

.house-stage {
  color: var(--on-dark);
}

.house-media,
.house-scrim,
.house-hud,
.plan {
  display: none;
}

.room {
  position: relative;
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 1rem;
  min-height: 92svh;
  padding: 7rem var(--gutter) 3.5rem;
  background:
    linear-gradient(to top, rgb(12 9 6 / 0.92) 0%, rgb(12 9 6 / 0.5) 45%, rgb(12 9 6 / 0.12) 75%),
    var(--img) center / cover no-repeat;
  text-shadow: var(--tshadow), 0 2px 24px rgb(12 9 6 / 0.55);
}

/* ---------- With JavaScript: the stage ---------- */

.house-live,
.house-live body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.house-live .house-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.house-live .house-media,
.house-live .house-scrim,
.house-live .house-hud,
.house-live .plan {
  display: block;
}

.house-media {
  position: absolute;
  inset: 0;
  background: #120e0b;
}

.house-video,
.house-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.house-video,
.house-canvas {
  z-index: 1;
  display: none;
}

.house-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.is-film .house-video,
.is-frames .house-canvas {
  display: block;
}

/* once the walk is in, the stills step aside */
.is-ready .house-still {
  display: none;
}

.house-poster img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.house-poster.is-gone {
  display: none;
}

/* words wait for the brand fonts, so nothing jumps as they arrive */
.house-live.fonts-pending .room,
.house-live.fonts-pending .house-hud,
.house-live.fonts-pending .plan {
  visibility: hidden;
}

.house-still {
  z-index: 2;
}

.house-still + .house-still {
  z-index: 3;
}

.house-scrim {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 100% at 0% 100%, rgb(12 9 6 / 0.92), rgb(12 9 6 / 0.62) 45%, transparent 78%),
    linear-gradient(to top, rgb(12 9 6 / 0.6), transparent 40%),
    linear-gradient(to bottom, rgb(12 9 6 / 0.5), transparent 22%);
}

/* ---------- The rooms' words ---------- */

.house-live .room {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(6.5rem, 15vh, 9rem);
  z-index: 6;
  min-height: 0;
  width: min(38rem, calc(100% - 2 * var(--gutter)));
  padding: 0;
  background: none;
  isolation: isolate;
  visibility: hidden;
}

.house-live .room::before {
  content: '';
  position: absolute;
  inset: -35% -30% -30% -50%;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(12 9 6 / 0.7), rgb(12 9 6 / 0.45) 55%, transparent);
  pointer-events: none;
  opacity: var(--glow, 0);
}

/* the walk itself sets each line's place and light, frame by frame */
.house-live .room > :not(.gallery-copy):not(.gallery-wall),
.house-live .gallery-copy > *,
.house-live .room-gallery .frame {
  opacity: 0;
  will-change: opacity, transform;
}

/* the first room ships already on, so its words show before the script runs */
.house-live .room-approach.is-on {
  --glow: 1;
  visibility: visible;
}

.house-live .room-approach.is-on > * {
  opacity: 1;
}

.room h1,
.room h2 {
  max-width: 15ch;
  font-size: clamp(1.6rem, min(1.4rem + 3.4vw, 7.4vh), 4.6rem);
  font-weight: 300;
  font-stretch: 116%;
  line-height: 1.04;
  text-wrap: balance;
}

.room > p:not(.room-label) {
  text-wrap: pretty;
}

.house-live .room-approach {
  width: min(54rem, calc(100% - 2 * var(--gutter)));
}

.room-approach h1 {
  max-width: 21ch;
  font-size: clamp(1.6rem, min(1.2rem + 3.2vw, 7vh), 4.2rem);
}

.room-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-hover);
}

.room-label::before {
  content: '';
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath d='M3 77 77 3' stroke='black' stroke-width='3'/%3E%3Cpath d='M14 12V60H66M42 12V60M62 12V60M42 36H62' fill='none' stroke='black' stroke-width='7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath d='M3 77 77 3' stroke='black' stroke-width='3'/%3E%3Cpath d='M14 12V60H66M42 12V60M62 12V60M42 36H62' fill='none' stroke='black' stroke-width='7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.room-label span {
  color: var(--on-dark);
}

.room-label span::before {
  content: '/ ';
  color: var(--accent);
}

.room > p:not(.room-label) {
  max-width: 38ch;
  font-size: var(--step-1);
  line-height: 1.4;
}

.room-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--on-dark-soft);
}

.room-points li + li::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 0.7rem 0.15rem;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--accent);
}

.room .door {
  min-width: 17rem;
  margin-top: 0.25rem;
  border-color: rgb(227 178 106 / 0.6);
  background: rgb(18 14 11 / 0.45);
  color: var(--on-dark);
}

.room .door:hover {
  border-color: var(--accent);
  background: rgb(18 14 11 / 0.7);
}

.room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.room-actions .door {
  min-width: 0;
  margin: 0;
}

/* The grand hall: the house directory, every discipline one click away. */
.room-directory {
  display: grid;
  width: min(100%, 30rem);
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgb(227 178 106 / 0.35);
}

.room-directory a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgb(227 178 106 / 0.35);
  color: var(--on-dark);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 300;
  font-stretch: 115%;
  transition: color 0.3s var(--ease-out), padding 0.3s var(--ease-out);
}

.room-directory a span {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-stretch: 100%;
  color: var(--on-dark-soft);
}

.room-directory {
  background: rgb(12 9 6 / 0.35);
}

.room-directory a {
  padding-inline: 0.75rem;
}

.room-directory a:hover {
  padding-left: 0.5rem;
  color: var(--accent-hover);
}

/* ---------- The gallery: the whole collection hung at once, salon style ---------- */

.room-figures {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 0 clamp(1.25rem, 3vw, 2.5rem);
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--on-dark);
}

.room-figures strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.9rem, 1.3rem + 1.8vw, 3rem);
  font-weight: 200;
  font-stretch: 125%;
  line-height: 1.1;
}

.gallery-copy {
  display: grid;
  justify-items: start;
  gap: 1rem;
}

.room-gallery h2 {
  font-size: clamp(2.2rem, 1.2rem + 2.6vw, 3.6rem);
}

/* in the gallery the wall is the point: the floor plan steps aside */
.plan {
  transition: opacity 0.4s var(--ease-out);
}

.house-stage[data-room='gallery'] .plan {
  opacity: 0;
  pointer-events: none;
}

.house-live .room-gallery {
  right: var(--gutter);
  width: auto;
  display: grid;
  grid-template-columns: minmax(0, 30rem) minmax(0, 1fr);
  align-items: end;
  gap: clamp(2rem, 4vw, 4rem);
}

.gallery-wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(4.4rem, auto);
  grid-auto-flow: dense;
  gap: 0.6rem;
  margin: 0 0 0 auto;
  padding: 0;
  width: min(100%, 44rem);
  list-style: none;
  text-shadow: none;
}

.frame {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgb(227 178 106 / 0.55);
  outline: 1px solid rgb(227 178 106 / 0.18);
  outline-offset: 4px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgb(240 200 135 / 0.22), transparent 70%),
    rgb(12 9 6 / 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.frame.wide {
  grid-column: span 2;
}

.frame.tall {
  grid-row: span 2;
}

.frame-no {
  margin-bottom: auto;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--accent);
}

.frame-name {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 300;
  font-stretch: 112%;
  line-height: 1.15;
  color: var(--on-dark);
}

.frame.wide .frame-name {
  font-size: 1.25rem;
}

.frame.tall .frame-name {
  font-size: 1.6rem;
}

.frame-sector {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--on-dark-soft);
}

/* the empty hook on the wall: the next name is the visitor's */
.frame-open {
  padding: 0;
  border-style: dashed;
  background: rgb(12 9 6 / 0.4);
}

.frame-open a {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  color: inherit;
  text-decoration: none;
}

.frame-open .frame-sector {
  color: var(--accent-hover);
}

.frame-open:hover {
  border-style: solid;
  background: rgb(227 178 106 / 0.16);
}


/* ---------- The lever: the house's own handle ---------- */

.lever {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  margin-top: 0.5rem;
  text-shadow: var(--tshadow);
}

.lever-handle {
  flex: none;
  width: 104px;
  height: 160px;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(0 8px 18px rgb(0 0 0 / 0.55));
}

.lever-handle:active {
  cursor: grabbing;
}

.lever-handle svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.lever-arm {
  transform-box: view-box;
  transform-origin: 26px 62px;
  transform: rotate(calc(var(--pull, 0) * 48deg));
}

.lever:not(.is-touched) .lever-arm {
  animation: nudge 3.2s var(--ease-in-out) 1.2s infinite;
}

@keyframes nudge {
  0%, 62%, 100% { transform: rotate(0deg); }
  72% { transform: rotate(20deg); }
  84% { transform: rotate(0deg); }
}

.lever-text {
  display: grid;
  gap: 0.5rem;
}

.lever-text strong {
  font-family: var(--display);
  font-size: var(--step-1);
  font-weight: 300;
  font-stretch: 112%;
}

.lever-text span {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--on-dark-soft);
}

.lever-gauge {
  display: block;
  width: 12rem;
  height: 1px;
  background: rgb(227 178 106 / 0.3);
}

.lever-gauge::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--pull, 0));
}

/* Without the film, the photograph of the doors swings open. */
.house-doors {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  perspective: 1600px;
  pointer-events: none;
}

.house-doors.is-active {
  display: block;
}

.house-doors span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  backface-visibility: hidden;
}

.house-doors span:first-child {
  left: 0;
  transform-origin: left center;
  transform: rotateY(calc(var(--pull, 0) * -42deg));
}

.house-doors span:last-child {
  right: 0;
  transform-origin: right center;
  transform: rotateY(calc(var(--pull, 0) * 42deg));
}

.house-doors img {
  position: absolute;
  top: 0;
  width: 200%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.house-doors span:first-child img {
  left: 0;
}

.house-doors span:last-child img {
  right: 0;
}

.doors-through .house-doors span {
  opacity: 0;
  transition: transform 1.1s var(--ease-in-out), opacity 1.1s var(--ease-in-out);
}

.doors-through .house-doors span:first-child {
  transform: rotateY(-100deg);
}

.doors-through .house-doors span:last-child {
  transform: rotateY(100deg);
}

.doors-through .house-still {
  animation: walk-in 1.1s var(--ease-in-out) both;
}

@keyframes walk-in {
  from { transform: scale(0.94); }
  to { transform: none; }
}

/* ---------- The way on: where you are, and where the next step goes ---------- */

.house-hud {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(1.5rem, 4vh, 2.5rem);
  z-index: 7;
}

.house-hud-row {
  display: flex;
  align-items: center;
}

.house-count {
  min-width: 4.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--on-dark-soft);
  text-shadow: var(--tshadow);
}

.house-next {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 44px;
  padding: 0 1.1rem 0 0;
  border: 0;
  border-left: 1px solid rgb(227 178 106 / 0.45);
  background: none;
  color: var(--on-dark);
  font-family: var(--display);
  font-size: 0.9375rem;
  font-stretch: 108%;
  text-align: left;
  text-shadow: var(--tshadow);
  cursor: pointer;
}

.house-next-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  margin-left: 1rem;
  border: 1px solid rgb(227 178 106 / 0.7);
  border-radius: 50%;
  transition: background-color 0.3s var(--ease-out);
}

.house-next-mark::after {
  content: '';
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(45deg);
  animation: beckon 2.4s var(--ease-in-out) infinite;
}

@keyframes beckon {
  0%, 100% { transform: translateY(0) rotate(45deg); }
  50% { transform: translateY(4px) rotate(45deg); }
}

.house-next:hover .house-next-mark {
  background: rgb(227 178 106 / 0.18);
}

.house-next-hint {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--on-dark-soft);
}

.house-count {
  color: var(--on-dark);
}

/* Skip the tour: straight to the five disciplines. */
.room-skip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.room-skip .door {
  min-width: 0;
  margin: 0;
}

/* The majlis: not ready to apply? A letter instead. */
.room-letter {
  display: grid;
  gap: 0.5rem;
  width: min(100%, 26rem);
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgb(227 178 106 / 0.35);
}

.room-letter > span {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--on-dark-soft);
}

/* ---------- Speak with the house: always one click away ---------- */

.house-speak {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 40px;
  margin-left: 1rem;
  padding: 0 1rem;
  border: 1px solid rgb(227 178 106 / 0.6);
  border-radius: 2px;
  background: rgb(12 9 6 / 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--on-dark);
  font-family: var(--display);
  font-size: 0.875rem;
  font-stretch: 108%;
  text-decoration: none;
  transition: background-color 0.3s var(--ease-out);
}

.house-speak:hover {
  background: rgb(227 178 106 / 0.2);
}

.house-speak-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7ed49b;
  box-shadow: 0 0 0 3px rgb(126 212 155 / 0.2);
}

.plan-caption {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
}

/* ---------- The floor plan ---------- */

.plan {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(1.5rem, 4vh, 2.5rem);
  z-index: 7;
}

.plan-inner {
  display: grid;
  gap: 0.75rem;
  justify-items: end;
  padding: 0.85rem;
  border: 1px solid rgb(227 178 106 / 0.2);
  background: rgb(12 9 6 / 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.plan svg {
  width: 132px;
  height: auto;
}

.plan-wall {
  fill: rgb(12 9 6 / 0.45);
  stroke: rgb(227 178 106 / 0.55);
  stroke-width: 1;
}

.plan-room {
  fill: transparent;
  stroke: rgb(227 178 106 / 0.45);
  stroke-width: 0.8;
  transition: fill 0.4s var(--ease-out);
}

.house-stage[data-room='approach'] [data-plan-room='approach'],
.house-stage[data-room='door'] [data-plan-room='door'],
.house-stage[data-room='hall'] [data-plan-room='hall'],
.house-stage[data-room='library'] [data-plan-room='library'],
.house-stage[data-room='conservatory'] [data-plan-room='conservatory'],
.house-stage[data-room='boardroom'] [data-plan-room='boardroom'],
.house-stage[data-room='study'] [data-plan-room='study'],
.house-stage[data-room='kitchen'] [data-plan-room='kitchen'],
.house-stage[data-room='gallery'] [data-plan-room='gallery'],
.house-stage[data-room='majlis'] [data-plan-room='majlis'] {
  fill: rgb(227 178 106 / 0.7);
}

.plan-list {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 0.2rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-list a {
  font-family: var(--display);
  font-size: 0.75rem;
  color: var(--on-dark-soft);
  text-decoration: none;
  text-shadow: var(--tshadow);
}

.plan-list a[aria-current='true'] {
  color: var(--accent);
}

.plan-list a:hover {
  color: var(--on-dark);
}

/* ---------- The footer: one step past the majlis ---------- */

.house-live .site-footer {
  position: fixed;
  inset: auto 0 0;
  z-index: 40;
  max-height: 100svh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(100%);
}

.site-footer:focus {
  outline: none;
}

/* ---------- Smaller screens ---------- */

@media (max-width: 1100px) {
  .plan-list {
    display: none;
  }
}

@media (max-width: 900px) {
  .house-live .plan {
    display: none;
  }
}

@media (max-width: 720px) {
  .house-live .room {
    bottom: 5.25rem;
  }

  .room h1,
  .room h2 {
    font-size: clamp(2rem, 1rem + 5.4vw, 2.6rem);
  }

  .room-approach h1 {
    font-size: clamp(1.9rem, 0.9rem + 5vw, 2.4rem);
  }

  .room > p:not(.room-label) {
    font-size: 1.0625rem;
  }

  .room-letter {
    display: none;
  }

  .room-figures {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .room-figures {
    font-size: 0.8125rem;
  }

  .room-figures strong {
    font-size: 1.3rem;
  }

  .lever-handle {
    width: 84px;
    height: 130px;
  }

  .lever-gauge {
    width: 8rem;
  }

  .house-next-hint,
  .house-count {
    display: none;
  }

  .house-next {
    border-left: 0;
  }

  .house-next-mark {
    margin-left: 0;
  }

  .house-speak {
    flex: none;
    margin-left: auto;
    padding: 0 0.8rem;
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  .house-next {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    padding-right: 0.5rem;
  }

  .house-next > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .house-hud {
    right: var(--gutter);
  }

  .house-live .room-gallery {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .gallery-copy {
    gap: 0.6rem;
  }

  .gallery-copy .room-figures,
  .gallery-copy .door {
    display: none;
  }

  .gallery-wall {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(3rem, auto);
    gap: 0.4rem;
    margin: 0;
  }

  .frame,
  .frame.wide,
  .frame.tall {
    grid-column: auto;
    grid-row: auto;
    padding: 0.45rem 0.5rem;
    outline: 0;
  }

  .frame-no {
    display: none;
  }

  .frame-open a {
    padding: 0.45rem 0.5rem;
  }

  .frame-name,
  .frame.wide .frame-name,
  .frame.tall .frame-name {
    font-size: 0.8125rem;
    line-height: 1.2;
  }

  /* on a phone the names carry the wall; sectors wait for the collection page */
  .frame-sector {
    display: none;
  }

  .frame-open .frame-sector {
    display: block;
    font-size: 0.75rem;
  }

  .room-directory a {
    padding: 0.55rem 0;
    font-size: 1rem;
  }
}

@media (max-height: 760px) and (min-width: 721px) {
  .house-live .room {
    bottom: 5.5rem;
  }

  .room h1,
  .room h2 {
    font-size: clamp(2.2rem, 1rem + 3vw, 3.6rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .house-live .room > * {
    transform: none;
  }
}

/* ---------- Short screens: laptops, small phones, phones held sideways ---------- */

@media (max-height: 760px) {
  .house-live .room {
    gap: 0.75rem;
  }

  .room > p:not(.room-label) {
    font-size: 1.0625rem;
  }

  .room-directory a {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
  }

  .lever-handle {
    width: 76px;
    height: 116px;
  }

  .gallery-wall {
    grid-auto-rows: minmax(3.1rem, auto);
    gap: 0.45rem;
  }

  .frame.tall .frame-name {
    font-size: 1.3rem;
  }

  .room-figures strong {
    font-size: clamp(1.4rem, 4.5vh, 2.4rem);
  }
}

@media (max-height: 700px) {
  .site-header {
    padding-block: 0.7rem;
  }

  .house-live .room {
    bottom: 4.5rem;
  }

  .room-points,
  .room-letter {
    display: none;
  }

  .house-hud {
    bottom: 0.9rem;
  }

  .gallery-wall {
    grid-auto-rows: minmax(2.6rem, auto);
    gap: 0.35rem;
  }

  .frame {
    padding: 0.4rem 0.6rem;
  }

  .frame-no {
    display: none;
  }
}

/* small phones: the open frame on the wall is the call to action */
@media (max-height: 700px) and (max-width: 720px) {
  .room-gallery .room-label,
  .gallery-copy .room-actions {
    display: none;
  }

  .gallery-wall {
    grid-auto-rows: minmax(2.3rem, auto);
  }
}

/* a phone held sideways: the essentials only, side by side */
@media (max-height: 520px) {
  .house-live .room {
    bottom: 3.75rem;
    width: min(32rem, 60vw);
    gap: 0.5rem;
  }

  .room h1,
  .room h2 {
    max-width: 24ch;
    font-size: clamp(1.4rem, 7.5vh, 2rem);
  }

  .room-label {
    font-size: 0.6875rem;
  }

  .room > p:not(.room-label) {
    font-size: 0.9375rem;
    line-height: 1.35;
  }

  .room .door,
  .room .btn {
    min-height: 40px;
    padding-block: 0.4rem;
  }

  .room-skip,
  .room-figures,
  .lever-text span,
  .house-next-hint,
  .plan {
    display: none !important;
  }

  .room-directory {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 36rem);
  }

  .room-directory a {
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
  }

  .room-directory a span {
    display: none;
  }

  .lever-handle {
    width: 52px;
    height: 80px;
  }

  .house-live .room-gallery {
    width: auto;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
    gap: 1rem;
  }

  .gallery-copy .door {
    display: none;
  }

  .gallery-wall {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(2.2rem, auto);
  }

  .frame,
  .frame.wide,
  .frame.tall {
    grid-column: auto;
    grid-row: auto;
    outline: 0;
  }

  .frame-name,
  .frame.wide .frame-name,
  .frame.tall .frame-name {
    font-size: 0.75rem;
  }

  .frame-sector {
    display: none;
  }
}

/* phones last, so their gallery sizing wins over the short-screen rules above */
@media (max-width: 720px) {
  .room-gallery h2 {
    font-size: clamp(1.5rem, min(7vw, 5vh), 2.2rem);
    max-width: none;
  }

  .gallery-wall {
    grid-auto-rows: minmax(2.4rem, auto);
    gap: 0.35rem;
  }

  .frame-name,
  .frame.wide .frame-name,
  .frame.tall .frame-name {
    font-size: 0.75rem;
    line-height: 1.2;
  }

  .frame-open .frame-sector {
    font-size: 0.6875rem;
    white-space: nowrap;
  }

  .frame-open .frame-name {
    white-space: nowrap;
  }
}

/* ---------- Phones: room for the thumb, clear of the iPhone's edges ---------- */

.house-next-short {
  display: none;
}

@media (max-width: 720px) {
  .house-live .room {
    bottom: calc(5.75rem + env(safe-area-inset-bottom));
  }

  .house-hud {
    bottom: calc(1rem + env(safe-area-inset-bottom));
  }

  .house-next-label {
    display: none;
  }

  .house-next-short {
    display: block;
    font-size: 0.875rem;
    color: var(--on-dark-soft);
  }

  .house-next {
    flex: none;
    gap: 0.6rem;
  }

  .house-next-mark {
    width: 40px;
    height: 40px;
  }

  .house-speak {
    min-height: 40px;
    font-size: 0.875rem;
  }

  /* the skip is a quiet link, not a second big button */
  .room-skip .door {
    min-height: 40px;
    padding: 0.45rem 0.9rem;
    font-size: 0.9375rem;
    gap: 0.75rem;
  }

  .room-directory a {
    padding: 0.5rem 0;
    font-size: 1rem;
  }

  .room-hall h2,
  .room-approach h1 {
    font-size: clamp(1.9rem, min(8.6vw, 5.2vh), 2.5rem);
  }
}

/* a room's two actions: the conversation first, the room's own page second */
.room-actions .btn,
.room-actions .door {
  min-height: 52px;
}

@media (max-width: 720px) {
  .room-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    gap: 0.5rem;
  }

  .room-actions .btn,
  .room-actions .door {
    width: 100%;
    min-height: 46px;
    justify-content: space-between;
  }
}

/* phones: the room's capabilities as a tidy two-column list, each with its gold point */
@media (max-width: 720px) {
  .room-points {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, auto));
    justify-content: start;
    gap: 0.35rem 1.4rem;
  }

  .room-points li::before,
  .room-points li + li::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 0.55rem 0.15rem 0;
    border-radius: 50%;
    vertical-align: middle;
    background: var(--accent);
  }
}

/* the two actions in a room stand at the same height */
.room-actions .door {
  padding-block: 0.7rem;
}

.room-actions .btn,
.room-actions .door {
  height: 52px;
}

@media (max-width: 720px) {
  .room-actions .btn,
  .room-actions .door {
    height: 48px;
    min-height: 48px;
  }
}
