/* The room card that opens like shutters into its gallery. A warm stone page, the card of the Sea Suite in the middle
   (a real photo, the hotel, the name, the rating, three facts and the price). The gallery is a sheet of its own over
   the stage: the script moves it from the photo's box to the whole stage and back, while its louvres (one slice of
   the same photo each) turn on their axis and uncover the swipeable photos underneath. */
:root {
  --page: #ece6dc;            /* the page */
  --page-deep: #ddd4c6;       /* the page's shadowed corner */
  --card: #fbf8f3;            /* the card */
  --ink: #1f1b16;             /* the words */
  --muted: #7d7365;           /* the small words */
  --line: rgba(31, 27, 22, 0.1); /* the thin lines */
  --accent: #b5582e;          /* terracotta: the star, the price and the lit line */
  --night: #14110e;           /* the gallery behind the photos */
  --slat: #2a231c;            /* the back of the louvres while they turn */
  --radius: 20px;             /* the corners of the card */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(120% 90% at 18% 0%, #f4efe7 0%, transparent 60%),
    radial-gradient(90% 80% at 100% 100%, var(--page-deep) 0%, transparent 70%),
    var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* a whisper of grain over the page */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .4 0 0 0 0 .33 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  padding: 12px;
}

/* ------------------------------------------------------------------ the card */
.room {
  --w: min(680px, 92vw, calc((100vh - 150px) * 1.45));
  width: var(--w);
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(6px, 1.4vmin, 9px);
  box-shadow:
    0 0 0 1px rgba(31, 27, 22, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(31, 27, 22, 0.06),
    0 8px 18px -6px rgba(31, 27, 22, 0.12),
    0 34px 60px -24px rgba(60, 40, 20, 0.28);
}

.room__media {
  position: relative;
  display: block;
  width: 100%;
  height: min(calc(var(--w) * 0.6), 56vh);
  padding: 0;
  border: 0;
  border-radius: calc(var(--radius) - 7px);
  overflow: hidden;
  cursor: zoom-in;
  background: var(--night);
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.room__media:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.room__frame {
  position: absolute;
  inset: 0;
  display: block;
}

.room__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.room__img--next {
  opacity: 0;
}

/* the light the window throws across the glass of the photo */
.room__media::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 30%, transparent 70%, rgba(20, 15, 10, 0.18));
}

.room__chip {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 9px;
  border-radius: 99px;
  font-size: clamp(10px, 1.7vmin, 12px);
  font-weight: 560;
  letter-spacing: 0.01em;
  color: #fff;
  background: rgba(24, 19, 14, 0.38);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 6px 16px -6px rgba(0, 0, 0, 0.4);
}

.room__chip svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  opacity: 0.9;
}

.room__chip-sep {
  width: 1px;
  height: 10px;
  background: rgba(255, 255, 255, 0.4);
}

.room__info {
  padding: clamp(10px, 2.2vmin, 16px) clamp(8px, 1.8vmin, 12px) clamp(4px, 1vmin, 7px);
  display: grid;
  gap: clamp(8px, 1.8vmin, 14px);
}

.room__top,
.room__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.room__top {
  align-items: flex-start;
}

.room__hotel {
  margin: 0 0 3px;
  font-size: clamp(10px, 1.7vmin, 12px);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.room__name {
  margin: 0;
  font-size: clamp(18px, 3.6vmin, 26px);
  font-weight: 640;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  line-height: 1;
}

.room__rate {
  margin: 2px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: clamp(11px, 1.9vmin, 13px);
  font-weight: 600;
}

.room__rate svg {
  width: 13px;
  height: 13px;
  fill: var(--accent);
}

.room__facts {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.room__facts li {
  padding: 4px 9px;
  border-radius: 99px;
  font-size: clamp(10px, 1.6vmin, 11.5px);
  font-weight: 520;
  white-space: nowrap;
  color: #4d4439;
  background: rgba(31, 27, 22, 0.045);
  box-shadow: inset 0 0 0 1px var(--line);
}

.room__price {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.room__price strong {
  font-size: clamp(16px, 3vmin, 21px);
  font-weight: 660;
  letter-spacing: -0.02em;
}

.room__price span {
  font-size: clamp(10px, 1.6vmin, 12px);
  color: var(--muted);
}

/* ------------------------------------------------------------------ the sheet */
.sheet {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 5;
  visibility: hidden;
  overflow: hidden;
  border-radius: 13px;
  background: var(--night);
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 30px 80px -30px rgba(30, 18, 8, 0.6),
    0 10px 24px -10px rgba(30, 18, 8, 0.35);
  touch-action: pan-y;
}

.sheet__view {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
}

.sheet__view.is-dragging {
  cursor: grabbing;
}

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

.sheet__slide {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.sheet__slide img {
  position: absolute;
  top: 0;
  left: -8%;
  width: 116%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* the shade at the top and the bottom so the words read on any photo */
.sheet__view::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(12, 9, 6, 0.5) 0%, transparent 22%),
    linear-gradient(0deg, rgba(12, 9, 6, 0.62) 0%, rgba(12, 9, 6, 0.2) 26%, transparent 42%);
  opacity: var(--shade, 1);
}

/* the louvres: each one is a slice of the whole photo (its picture is as wide as the sheet and moved back by its
   place), so side by side they make the photo; they turn around their own vertical axis */
.sheet__shutters {
  position: absolute;
  inset: 0;
  display: flex;
  perspective: 900px;
  pointer-events: none;
  z-index: 2;
}

.slat {
  position: relative;
  flex: 1 1 0;
  height: 100%;
  transform-style: preserve-3d;
}

.slat__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--slat);
  backface-visibility: hidden;
}

.slat__pic {
  position: absolute;
  top: 0;
  height: 100%;
  background-size: cover;
  background-position: center;
}

/* the darkening as the louvre turns away from the light, and the thin lit edge on its side */
.slat__shade {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(90deg, rgba(10, 7, 4, 0.1), rgba(10, 7, 4, 0.75));
}

.slat__edge {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  opacity: 0;
  background: linear-gradient(180deg, rgba(255, 236, 214, 0.2), rgba(255, 236, 214, 0.75) 45%, rgba(255, 236, 214, 0.2));
}

.sheet__head,
.sheet__foot {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  padding: clamp(12px, 3vmin, 24px);
}

.sheet__head {
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.sheet__hotel {
  margin: 0 0 2px;
  font-size: clamp(10px, 1.7vmin, 12px);
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.72);
}

.sheet__room {
  margin: 0;
  font-size: clamp(14px, 2.6vmin, 18px);
  font-weight: 620;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}

.sheet__close,
.sheet__arrow {
  display: grid;
  place-items: center;
  width: clamp(32px, 5.2vmin, 40px);
  height: clamp(32px, 5.2vmin, 40px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 20px -10px rgba(0, 0, 0, 0.6);
  transition: background-color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.sheet__close svg,
.sheet__arrow svg {
  width: 44%;
  height: 44%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .sheet__close:hover,
  .sheet__arrow:hover {
    background: rgba(255, 255, 255, 0.24);
  }
}

.sheet__close:focus-visible,
.sheet__arrow:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.sheet__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.sheet__foot {
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  row-gap: clamp(10px, 2vmin, 16px);
}

.sheet__label {
  margin: 0;
  height: 1.05em;
  overflow: hidden;
  font-size: clamp(22px, 5.2vmin, 40px);
  font-weight: 640;
  font-stretch: 116%;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.sheet__label-roll {
  display: block;
}

.sheet__note {
  margin: 4px 0 0;
  font-size: clamp(10px, 1.8vmin, 13px);
  color: rgba(255, 255, 255, 0.75);
}

.sheet__nav {
  display: flex;
  gap: 8px;
}

.sheet__lines {
  grid-column: 1 / -1;
  display: flex;
  gap: 5px;
}

.sheet__line {
  position: relative;
  flex: 1 1 0;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.22);
}

.sheet__line i {
  position: absolute;
  inset: 0;
  background: #fff;
  transform-origin: 0 50%;
  transform: scaleX(0);
}
