/* The rooms gallery of Marenna, a made-up resort: a large photo frame with the four rooms stacked inside it, a glass
   card of the room that never moves, and a strip of thumbnails under the frame. The door (a thin line of warm light
   with its spill) sweeps across the frame when the room changes; the grain and the lit edge sit over every photo. */
:root {
  --page: #f2eee8;          /* the warm paper around the gallery */
  --ink: #1d1b18;           /* the words */
  --muted: #6f6a62;         /* the small words */
  --accent: #e0893f;        /* the warm light of the door, the ring and the timer */
  --glass: rgba(252, 250, 247, 0.74); /* the card */
  --button: #1d1b18;        /* the Check dates button */
  --button-ink: #f7f4ef;    /* its words */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background:
    radial-gradient(120% 80% at 50% 0%, #f8f5f0 0%, transparent 60%),
    var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vh, 32px) 16px;
  overflow: hidden;
}

.gal {
  width: min(100%, 800px);
  display: grid;
  gap: clamp(10px, 2.2vh, 18px);
  opacity: 0;
}

/* ---- the frame ---- */
.frame {
  position: relative;
  height: clamp(220px, 62vh, 500px);
  border-radius: clamp(16px, 2.4vw, 24px);
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.frame__shadow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    0 1px 1px rgba(40, 28, 16, 0.06),
    0 6px 14px -4px rgba(40, 28, 16, 0.14),
    0 26px 50px -18px rgba(40, 28, 16, 0.32),
    0 60px 90px -40px rgba(40, 28, 16, 0.3);
  z-index: -1;
}

.frame__photos {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: #2a2420;
}

.ph {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
}

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

.ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
}

/* a soft shade at the bottom so the card reads as glass on the photo, not a sticker */
.frame__photos::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 14, 8, 0.28) 0%, rgba(20, 14, 8, 0) 22%),
    linear-gradient(0deg, rgba(20, 14, 8, 0.34) 0%, rgba(20, 14, 8, 0) 46%);
  pointer-events: none;
  z-index: 5;
}

.frame__grain {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: var(--grain, none);
  background-size: 160px 160px;
  mix-blend-mode: overlay;
  opacity: 0.09;
  z-index: 6;
}

/* the lit 1px edge of the frame, brighter on top */
.frame__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 7;
}

/* ---- the door: a line of warm light and the light that spills ahead of it ---- */
.door {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
}

.door__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: linear-gradient(180deg, rgba(255, 236, 205, 0) 0%, #fff3df 18%, #fffaf2 50%, #fff3df 82%, rgba(255, 236, 205, 0) 100%);
  box-shadow:
    0 0 6px 1px rgba(255, 214, 160, 0.9),
    0 0 24px 4px color-mix(in srgb, var(--accent) 60%, transparent);
}

.door__spill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: clamp(80px, 18vw, 180px);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 44%, transparent) 0%, rgba(255, 200, 140, 0.12) 45%, transparent 100%);
  mix-blend-mode: screen;
  transform-origin: 0 50%;
}

/* ---- the top row: the brand tag and the arrows ---- */
.frame__top {
  position: absolute;
  top: clamp(10px, 2vh, 16px);
  left: clamp(10px, 2vh, 16px);
  right: clamp(10px, 2vh, 16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 8;
}

.tag {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  color: #fffaf3;
  font-size: 12.5px;
  font-weight: 560;
  font-stretch: 108%;
  letter-spacing: 0.01em;
  background: rgba(30, 22, 14, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}

.tag__mark {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.arrows {
  display: flex;
  gap: 6px;
}

.arrow {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  width: 34px;
  height: 34px;
  -webkit-tap-highlight-color: transparent;
}

.arrow__face {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  color: #fffaf3;
  background: rgba(30, 22, 14, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.arrow svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrow:focus-visible,
.thumb:focus-visible,
.room__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 999px;
}

/* ---- the card that stays ---- */
.room {
  position: absolute;
  left: clamp(10px, 2vh, 18px);
  bottom: clamp(10px, 2vh, 18px);
  width: min(312px, calc(100% - 2 * clamp(10px, 2vh, 18px)));
  padding: clamp(11px, 1.9vh, 16px) clamp(13px, 2vh, 18px) clamp(11px, 1.9vh, 16px);
  border-radius: clamp(13px, 1.8vw, 18px);
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(30, 20, 10, 0.08),
    0 10px 24px -8px rgba(30, 20, 10, 0.26),
    0 28px 48px -24px rgba(30, 20, 10, 0.34);
  overflow: hidden;
  z-index: 8;
}

.room__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(160px circle at var(--mx, 80%) var(--my, 0%), rgba(255, 255, 255, 0.7), transparent 70%);
  opacity: 0.55;
}

.room__sheen {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 46%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.0) 20%, rgba(255, 248, 236, 0.75) 50%, rgba(255, 255, 255, 0) 80%, transparent 100%);
  pointer-events: none;
  opacity: 0;
}

.room > *:not(.room__sheen):not(.room__glow) {
  position: relative;
}

.room__eyebrow {
  margin: 0 0 2px;
  font-size: 10.5px;
  font-weight: 620;
  font-stretch: 112%;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.room__where {
  font-weight: 460;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--muted) 70%, transparent);
  margin-left: 4px;
}

.room__name {
  margin: 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-variation-settings: 'opsz' 72;
  font-weight: 420;
  font-size: clamp(21px, 1.4vw + 14px, 28px);
  line-height: 1.26;
  letter-spacing: -0.015em;
  height: 1.26em;
  position: relative;
  overflow: hidden;
}

.line {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
}

.ch {
  display: inline-block;
  white-space: pre;
  will-change: transform;
}

.room__specs {
  list-style: none;
  margin: clamp(5px, 1vh, 8px) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(9px, 1.4vw, 14px);
  font-size: 12.5px;
  font-weight: 500;
  color: #3d3933;
}

.room__specs li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.room__specs .unit {
  margin-left: -2px;
}

.room__specs .col {
  width: 0.58em;
}

.room__specs svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.swap {
  position: relative;
  display: inline-block;
  height: 1.3em;
  line-height: 1.3em;
  overflow: hidden;
  vertical-align: middle;
  transition: none;
}

/* rolling digits: each column is a window 1em tall with a strip of 0..9 inside */
.num {
  display: inline-flex;
  height: 1.3em;
  line-height: 1.3em;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.col {
  position: relative;
  display: block;
  height: 1.3em;
  overflow: hidden;
  width: 0.62em;
  text-align: center;
}

.strip {
  display: block;
  will-change: transform;
}

.strip > span {
  display: block;
  height: 1.3em;
}

.room__rule {
  display: block;
  height: 1px;
  margin: clamp(8px, 1.5vh, 12px) 0 clamp(8px, 1.4vh, 11px);
  background: linear-gradient(90deg, rgba(29, 27, 24, 0.14), rgba(29, 27, 24, 0.04));
}

.room__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.room__price {
  margin: 0;
  display: inline-flex;
  align-items: flex-end;
  font-weight: 640;
  font-stretch: 96%;
  font-size: clamp(22px, 1.2vw + 15px, 27px);
  letter-spacing: -0.02em;
  line-height: 1;
}

.room__cur {
  font-size: 0.66em;
  font-weight: 560;
  margin-right: 1px;
  align-self: flex-start;
  margin-top: 0.12em;
}

.num--big {
  height: 1.12em;
  line-height: 1.12em;
  align-self: center;
}

.num--big .col,
.num--big .strip > span {
  height: 1.12em;
}

.num--big .col {
  width: 0.6em;
}

.room__per {
  font-size: 12px;
  font-weight: 480;
  font-stretch: 100%;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 5px;
  margin-bottom: 0.18em;
}

.room__btn {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.room__btn-face {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-ink);
  font-size: 12.5px;
  font-weight: 580;
  font-stretch: 104%;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 6px 14px -6px rgba(0, 0, 0, 0.45);
  transition: font-stretch 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.25s ease;
}

/* ---- the thumbnails under the frame ---- */
.thumbs {
  position: relative;
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 12px);
}

.thumb {
  appearance: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  width: clamp(54px, 9vh, 72px);
  height: clamp(36px, 6vh, 48px);
  border-radius: 10px;
  overflow: hidden;
  background: #d9d2c8;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 2px rgba(40, 28, 16, 0.12), 0 4px 10px -4px rgba(40, 28, 16, 0.2);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.6) brightness(0.92);
  opacity: 0.62;
  transition: opacity 0.4s ease, filter 0.4s ease;
  -webkit-user-drag: none;
}

.thumb.is-on img {
  opacity: 1;
  filter: none;
}

.thumb__time {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
}

.thumbs__ring {
  position: absolute;
  top: -3px;
  left: 0;
  height: calc(100% + 6px);
  width: 0;
  border-radius: 13px;
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
  pointer-events: none;
}

@media (hover: hover) {
  .arrow:hover .arrow__face {
    background: rgba(30, 22, 14, 0.46);
    border-color: rgba(255, 255, 255, 0.4);
  }

  .thumb:hover img {
    opacity: 0.92;
    filter: saturate(0.9);
  }

  .room__btn:hover .room__btn-face {
    font-stretch: 116%;
    background: #2c2924;
  }
}

@media (max-width: 420px) {
  .room__where {
    display: none;
  }

  .room__specs {
    font-size: 11.5px;
    gap: 8px;
  }

  .room__btn-face {
    height: 30px;
    padding: 0 11px;
    font-size: 11.5px;
  }

  .arrow {
    width: 30px;
    height: 30px;
  }

  .tag {
    height: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .room__btn-face,
  .thumb img {
    transition: opacity 0.3s ease;
  }
}

/* a short window (the phone preview box): the eyebrow goes, so more of the room shows above the card */
@media (max-height: 460px) {
  .room__eyebrow {
    display: none;
  }
}
