/* The background of the lighthouse beam turning through the sea fog: the hero of a small hotel on the cliff, at
   night. The WebGL canvas fills the stage and draws the beam of a lighthouse just out of frame on the right, the fog
   in drifting layers, the dark water that mirrors the beam, the drizzle caught against the light and a fine grain.
   The words sit low on the left, over the dark water, so the beam has the sky to itself; the title catches the light
   each time the beam passes (--lit from the script). Without WebGL a CSS gradient of the same night remains. */
:root {
  --night: #070b12;         /* the sky at the top */
  --haze: #1a2532;          /* the fog-lit sky near the horizon */
  --fog: #6f8194;           /* the fog where the beam does not reach it */
  --beam: #fff1d2;          /* the light of the lamp, a warm white */
  --amber: #ffc27a;         /* the warm edge of the beam, the one accent */
  --sea: #04070c;           /* the water closest to us */
  --ink: #f4f1ea;           /* the heading */
  --muted: rgba(232, 236, 240, 0.7); /* the small words */
  --line: rgba(230, 238, 246, 0.16); /* thin edges */
  --button: #f6efe2;        /* the button, the colour of the lamp */
  --button-ink: #10161f;    /* the words on the button */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

body {
  background: var(--night);
  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 {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 320px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
  background: var(--night);
  --lit: 0;
}

.sea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}

/* the night without WebGL: a fixed beam across the fog and the dark water */
.fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
  background:
    linear-gradient(172deg, transparent 22%, color-mix(in srgb, var(--beam) 18%, transparent) 30%, transparent 40%),
    radial-gradient(40% 30% at 100% 44%, color-mix(in srgb, var(--beam) 34%, transparent), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--haze) 50%, color-mix(in srgb, var(--haze) 60%, var(--sea)) 56%, var(--sea) 100%);
}

.no-gl .fallback {
  display: block;
}

.bar,
.hero,
.hint {
  position: relative;
  z-index: 2;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(12px, 3vh, 22px) clamp(16px, 4vw, 44px) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: 19px;
  font-weight: 460;
  font-variation-settings: 'opsz' 30;
  letter-spacing: -0.005em;
}

.brand__mark {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s, background-color 0.3s;
}

.nav__link--pill {
  color: var(--ink);
  background: rgba(230, 238, 246, 0.08);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

@media (hover: hover) {
  .nav__link:hover {
    color: var(--ink);
  }
  .nav__link--pill:hover {
    background: rgba(230, 238, 246, 0.16);
  }
}

/* the words sit low on the left, over the dark water, so the beam has the sky above them to itself */
.hero {
  align-self: end;
  justify-self: start;
  width: min(100%, 700px);
  padding: 0 clamp(16px, 5vw, 64px) clamp(4px, 2vh, 18px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  background: rgba(12, 18, 26, 0.42);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 22px -12px rgba(0, 0, 0, 0.7);
  transition: color 0.3s;
}

.chip__new {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0.02em;
  color: var(--button-ink);
  background: linear-gradient(180deg, #ffe0b8, var(--amber));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.chip__arrow {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .chip:hover {
    color: var(--ink);
  }
  .chip:hover .chip__arrow {
    transform: translateX(2px);
  }
}

/* the heading: Fraunces at a large optical size; each time the beam passes over it it catches a little warm light */
.title {
  margin: clamp(10px, 2.2vh, 18px) 0 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: clamp(26px, min(8.6vw, 7.4vh, 74px), 74px);
  line-height: 1.02;
  font-weight: 330;
  font-variation-settings: 'opsz' 96;
  letter-spacing: -0.028em;
  color: color-mix(in srgb, var(--ink) calc(100% - var(--lit) * 30%), var(--beam));
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35), 0 2px 18px rgba(4, 7, 12, 0.45), 0 0 calc(14px + var(--lit) * 26px) rgba(255, 214, 160, calc(var(--lit) * 0.3));
}

.title__line {
  display: block;
}

.title__line:last-child {
  font-style: italic;
  font-weight: 300;
}

.lede {
  margin: clamp(8px, 1.8vh, 14px) 0 0;
  max-width: 44ch;
  font-size: clamp(12.5px, min(3.4vw, 2.1vh), 15.5px);
  line-height: 1.5;
  color: var(--muted);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.actions {
  margin-top: clamp(12px, 3vh, 24px);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  position: relative;
  height: clamp(40px, 7vh, 50px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--button-ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* the face: the colour of the lamp, a lit top edge and a warm glow underneath that grows as the beam passes */
.btn__face {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 100%;
  padding: 0 clamp(16px, 4.4vw, 22px);
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, #fffaf1, var(--button) 55%, color-mix(in srgb, var(--button) 86%, var(--amber)));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(90, 60, 30, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 14px 32px -12px rgba(255, 190, 120, calc(0.14 + var(--lit) * 0.34));
}

/* a soft band of lamp light that slides across the face when it is pressed */
.btn__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 200, 130, 0.6) 48%, transparent 66%);
  transform: translateX(-110%);
  pointer-events: none;
}

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

.btn__words {
  position: relative;
  font-size: 14.5px;
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
  white-space: nowrap;
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .btn:hover .btn__words {
    font-variation-settings: 'wdth' 110;
  }
}

.btn__icon {
  position: relative;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.ghost {
  height: clamp(40px, 7vh, 50px);
  display: inline-flex;
  align-items: center;
  padding: 0 clamp(14px, 4vw, 20px);
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 540;
  color: var(--ink);
  text-decoration: none;
  background: rgba(12, 18, 26, 0.4);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s, box-shadow 0.3s;
}

@media (hover: hover) {
  .ghost:hover {
    background: rgba(24, 34, 46, 0.55);
    box-shadow: inset 0 0 0 1px rgba(230, 238, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  }
}

/* the note: two thin rays from a point, which open a little when the room is held */
.note {
  margin: clamp(8px, 2vh, 14px) 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}

.note__beam {
  width: 22px;
  height: 12px;
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.2;
  stroke-linecap: round;
  overflow: visible;
}

.note__ray {
  transform-origin: 11px 6px;
  transform-box: view-box;
}

.hint {
  margin: 0;
  padding: 0 clamp(16px, 5vw, 64px) clamp(10px, 3vh, 22px);
  text-align: left;
  font-size: 11.5px;
  color: rgba(232, 236, 240, 0.42);
  letter-spacing: 0.01em;
}

@media (max-height: 540px) {
  .hint {
    display: none;
  }
}

@media (max-height: 450px) {
  .note {
    display: none;
  }
  .hero {
    padding-bottom: 14px;
  }
}

@media (max-width: 520px) {
  .nav__link--wide {
    display: none;
  }
  .lede {
    max-width: 34ch;
  }
  .actions {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .btn__face,
  .ghost {
    padding: 0 14px;
  }
  .btn__words,
  .ghost {
    font-size: 13px;
  }
}

[data-in],
.title__line {
  opacity: 0;
}
