:root {
  /* the four pages: background, ink and the three tones of their waves (light, middle, deep) */
  --stay-bg: #0c2730;
  --stay-ink: #e6efe9;
  --stay-w1: #a9d0c7;
  --stay-w2: #5b9598;
  --stay-w3: #23555e;
  --rooms-bg: #efe6d7;
  --rooms-ink: #1f1a14;
  --rooms-w1: #e3cdaa;
  --rooms-w2: #c49f70;
  --rooms-w3: #8f6c47;
  --baths-bg: #2a1a17;
  --baths-ink: #f2d8c7;
  --baths-w1: #ecb99e;
  --baths-w2: #ba735b;
  --baths-w3: #7b4134;
  --table-bg: #17241a;
  --table-ink: #e3e9c6;
  --table-w1: #cdd79f;
  --table-w2: #8a9b5b;
  --table-w3: #4a5a34;
  /* the page on show (the script moves them) */
  --bg: var(--stay-bg);
  --ink: var(--stay-ink);
  --display: 'Fraunces Variable', 'Fraunces', Georgia, serif;
  --ui: 'Mona Sans Variable', system-ui, sans-serif;
  --expo: cubic-bezier(.19, 1, .22, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--stay-bg);
  overflow: hidden;
}

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
}
.stage.is-moving { cursor: wait; }

/* a soft light from the top, like the sky over the water, and a darker floor: the background never looks flat */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(110% 70% at 70% -14%, color-mix(in srgb, var(--ink) 14%, transparent), transparent 62%),
    radial-gradient(90% 60% at 0% 112%, rgba(0, 0, 0, .2), transparent 70%);
}

/* ---- the tide line in the corner ---- */
.tide {
  position: absolute;
  z-index: 0;
  right: clamp(14px, 4vw, 56px);
  top: clamp(64px, 15vh, 140px);
  width: min(34vw, 40vh, 320px);
  height: auto;
  overflow: visible;
  pointer-events: none;
  fill: none;
  stroke: var(--ink);
}
.tide__base { stroke-width: 1; opacity: .16; stroke-dasharray: 2 5; }
.tide__line { stroke-width: 1.2; opacity: .5; stroke-linecap: round; }
.tide__mark { stroke-width: 1; opacity: .35; }
.tide__label {
  position: absolute;
  z-index: 0;
  right: clamp(14px, 4vw, 56px);
  top: calc(clamp(64px, 15vh, 140px) + min(34vw, 40vh, 320px) * .375 + 8px);
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 11px;
  font-weight: 500;
  font-variation-settings: 'wdth' 108;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .62;
}
.tide__label b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

/* ---- the top bar ---- */
.top {
  position: absolute;
  z-index: 3;
  top: clamp(10px, 2.4vh, 24px);
  left: clamp(12px, 3vw, 40px);
  right: clamp(12px, 3vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
}
.brand__mark {
  width: clamp(24px, 3.4vh, 30px);
  height: clamp(24px, 3.4vh, 30px);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  overflow: visible;
}
.brand__sun { transition: transform .7s var(--expo); transform-origin: 14px 15px; }
@media (hover: hover) {
  .brand:hover .brand__sun { transform: translateY(-1.5px); }
}
.brand__name {
  font-family: var(--display);
  font-weight: 420;
  font-variation-settings: 'opsz' 72, 'SOFT' 100;
  font-size: 21px;
  letter-spacing: -.01em;
  line-height: 1;
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ink) 15%, transparent),
    inset 0 1px 0 color-mix(in srgb, white 14%, transparent),
    0 10px 30px -12px rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}
.nav.is-locked { pointer-events: none; }
.nav.is-locked .nav__item:not(.is-here) { opacity: .55; }

.nav__item {
  position: relative;
  z-index: 2;
  display: block;
  padding: 0 clamp(10px, 1.3vw, 18px);
  height: clamp(30px, 4.6vh, 38px);
  line-height: clamp(30px, 4.6vh, 38px);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(12px, 1.8vh, 14px);
  font-weight: 540;
  font-variation-settings: 'wdth' 100;
  white-space: nowrap;
  transition: color .45s var(--expo), opacity .3s ease, font-variation-settings .45s var(--expo);
  -webkit-tap-highlight-color: transparent;
}
.nav__item.is-here { color: var(--bg); }
.nav__item:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 2px; }

.nav__pill,
.nav__hover {
  position: absolute;
  z-index: 1;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  width: 60px;
  border-radius: 999px;
  pointer-events: none;
}
.nav__pill {
  background: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45),
    inset 0 -1px 0 rgba(0, 0, 0, .12),
    0 6px 16px -6px color-mix(in srgb, var(--ink) 50%, transparent);
  overflow: hidden;
}
.nav__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .5) 48%, transparent 62%);
  transform: translateX(-120%);
}
.nav__hover {
  background: color-mix(in srgb, var(--ink) 13%, transparent);
  opacity: 0;
}

.book {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: clamp(32px, 4.8vh, 40px);
  padding: 0 14px 0 18px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 38%, transparent);
  transition: background-color .4s var(--expo), color .4s var(--expo), transform .5s var(--expo);
}
.book svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .45s var(--expo);
}
.book:active { transform: scale(.96); }
@media (hover: hover) {
  .book:hover { background: var(--ink); color: var(--bg); }
  .book:hover svg { transform: translateX(3px); }
  .nav__item:not(.is-here):hover { font-variation-settings: 'wdth' 112; }
}

/* ---- the pages ---- */
.pages {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 clamp(16px, 4vw, 56px) clamp(14px, 5vh, 52px);
}
.page[hidden] { display: none; }

.eyebrow {
  margin: 0 0 clamp(6px, 1.4vh, 14px);
  font-size: clamp(11px, 1.7vh, 13px);
  font-weight: 500;
  font-variation-settings: 'wdth' 110;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .74;
}

.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 340;
  font-size: min(13.5vw, 19vh);
  line-height: .9;
  letter-spacing: -.035em;
  font-variation-settings: 'opsz' 144, 'SOFT' 50, 'WONK' 0;
}
/* every line is a window: the words rise into it from below, like a swimmer coming up */
.title .line {
  display: block;
  overflow: hidden;
  padding: 0 .06em .12em 0;
  margin-bottom: -.12em;
  white-space: nowrap;
}
.title .w {
  display: inline-block;
  will-change: transform;
  font-variation-settings: 'opsz' 144, 'SOFT' 50, 'wght' var(--wg, 340);
}
.title i {
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
}

.foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(12px, 3vw, 40px);
  margin-top: clamp(10px, 3vh, 34px);
  padding-top: clamp(10px, 2.4vh, 22px);
  position: relative;
}
/* the thin rule above the foot draws itself from the left on every new page, like the line the water leaves */
.foot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: color-mix(in srgb, var(--ink) 24%, transparent);
  transform: scaleX(var(--line, 1));
  transform-origin: 0 50%;
}

.text {
  margin: 0;
  max-width: 36ch;
  font-size: clamp(12px, 2vh, 16px);
  line-height: 1.45;
  font-weight: 420;
  opacity: .84;
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  padding: clamp(8px, 1.6vh, 14px) clamp(12px, 2vh, 18px);
  border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--ink) 12%, transparent), color-mix(in srgb, var(--ink) 4%, transparent));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ink) 17%, transparent),
    inset 0 1px 0 color-mix(in srgb, white 16%, transparent),
    0 24px 40px -24px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform .6s var(--expo), box-shadow .6s var(--expo);
}
@media (hover: hover) {
  .card:hover {
    transform: translateY(-2px);
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--ink) 26%, transparent),
      inset 0 1px 0 color-mix(in srgb, white 22%, transparent),
      0 30px 44px -24px rgba(0, 0, 0, .55);
  }
}
.card__col { display: flex; flex-direction: column; gap: 3px; }
.card__col--end { align-items: flex-end; }
.card__big {
  font-family: var(--display);
  font-weight: 380;
  font-variation-settings: 'opsz' 72;
  font-size: clamp(22px, 4.4vh, 34px);
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.card__big small {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 12px;
  margin-left: 4px;
  letter-spacing: 0;
  opacity: .7;
}
.card__mid {
  font-family: var(--display);
  font-weight: 420;
  font-style: italic;
  font-variation-settings: 'opsz' 48, 'SOFT' 100;
  font-size: clamp(17px, 3vh, 22px);
  line-height: 1.05;
}
.card__small {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .02em;
  opacity: .7;
  white-space: nowrap;
}
.card__tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--bg);
  background: var(--ink);
  white-space: nowrap;
}
.card__cut {
  align-self: stretch;
  width: 0;
  border-left: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
}

/* ---- the three waves ---- */
.sea {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}
.wave { visibility: hidden; }
/* a soft shadow around each body, so the waves lie one over the other like layers of water and not flat paper */
.wave__body { filter: drop-shadow(0 0 18px rgba(0, 0, 0, .2)); }
.wave__crest {
  fill: none;
  stroke: rgba(255, 255, 255, .5);
  stroke-width: 1.3;
  stroke-linecap: round;
}
.wave__foam {
  fill: none;
  stroke: rgba(255, 255, 255, .16);
  stroke-width: 1;
  stroke-dasharray: 1 7;
  stroke-linecap: round;
}

/* ---- grain over everything, waves included ---- */
.grain {
  position: absolute;
  inset: -50%;
  z-index: 9;
  pointer-events: none;
  opacity: .12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.4 -.2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

.ghost {
  position: absolute;
  z-index: 10;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  opacity: 0;
  pointer-events: none;
  fill: #fff;
  stroke: #111;
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .35));
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* small screens: the Book button goes, then the name, the tide line and the text */
@media (max-width: 720px) {
  .book { display: none; }
}
@media (max-width: 560px) {
  .brand__name { display: none; }
  .foot { flex-direction: column; align-items: flex-start; }
  .text { max-width: none; }
  .nav { padding: 3px; }
  .nav__pill, .nav__hover { top: 3px; height: calc(100% - 6px); }
  .nav__item { padding: 0 min(10px, 2.4vw); font-size: min(12.5px, 3.3vw); }
  .top { gap: 8px; }
  .tide { width: min(40vw, 150px); }
  .tide__label { top: calc(clamp(64px, 15vh, 140px) + min(40vw, 150px) * .375 + 6px); }
}
@media (max-height: 460px) and (max-width: 560px) {
  .text { display: none; }
  .foot { margin-top: 10px; }
}
@media (max-height: 360px) {
  .tide, .tide__label { display: none; }
}
