/* The background of the sunset sky with the sun that follows the pointer: the hero of a mountain hut. The WebGL canvas
   fills the stage and draws the sky with simple scattering, the clouds lit from below, the sun low on the horizon and
   a far ridge in the haze. The words sit in the upper sky and take a warm halo from the sun (--warm from the script);
   the dial at the bottom shows where the sun is on the horizon. Without WebGL a CSS gradient of the same sunset stays. */
:root {
  --zenith: #1f3a6e;        /* the deep blue overhead */
  --sunlight: #ffb36b;      /* the colour of the low sun, the light on the clouds */
  --rose: #e98a92;          /* the pink the light takes on the underside of the clouds */
  --cloud: #4a5878;         /* the clouds where the light does not reach */
  --land: #151a2c;          /* the ridge and the ground in shadow */
  --ink: #fff7ef;           /* the heading */
  --muted: rgba(255, 247, 239, 0.74); /* the small words */
  --line: rgba(255, 247, 239, 0.24);  /* thin lines */
  --pill: #fff6ec;          /* the Book a bed pill */
  --pill-ink: #2a1f2b;      /* the words on the pill */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

body {
  background: var(--land);
  color: var(--ink);
  font-family: 'Inter Tight Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 320px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
  background: var(--zenith);
  --warm: 0.6;
  --sx: 50%;
}

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

.fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
  background:
    radial-gradient(40% 18% at var(--sx) 76%, color-mix(in srgb, var(--sunlight) 80%, transparent), transparent 70%),
    linear-gradient(180deg, var(--zenith) 0%, color-mix(in srgb, var(--zenith) 55%, var(--rose)) 46%, var(--rose) 64%, var(--sunlight) 76%, var(--land) 78%, var(--land) 100%);
}

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

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

/* ---------------------------------------------------------------- the line at the top */
.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, 'SOFT' 60;
  letter-spacing: -0.01em;
}

.brand__mark {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--sunlight);
  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 {
  position: relative;
  margin-left: 6px;
  padding: 0;
  color: var(--pill-ink);
}

.pill__face {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--pill);
  font-weight: 560;
  font-variation-settings: 'wght' 560;
  /* the pill catches the low sun on its lower edge */
  box-shadow:
    inset 0 -1px 0 color-mix(in srgb, var(--sunlight) 70%, transparent),
    0 1px 0 rgba(255, 255, 255, 0.25),
    0 8px 22px -8px color-mix(in srgb, var(--sunlight) calc(var(--warm) * 70%), transparent),
    0 2px 6px rgba(20, 14, 30, 0.25);
  will-change: transform;
}

@media (hover: hover) {
  .nav__link--wide:hover {
    color: var(--ink);
    background: rgba(255, 247, 239, 0.08);
  }
}

/* ---------------------------------------------------------------- the heading */
.hero {
  align-self: start;
  justify-self: center;
  text-align: center;
  padding: clamp(28px, 11vh, 120px) 20px 0;
  max-width: 960px;
}

.title {
  margin: 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-weight: 380;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 0;
  font-size: clamp(32px, min(9vw, 11vh), 104px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  /* a warm halo that follows the sun */
  text-shadow:
    0 0 calc(18px + var(--warm) * 26px) color-mix(in srgb, var(--sunlight) calc(var(--warm) * 34%), transparent),
    0 1px 1px rgba(20, 14, 30, 0.18);
}

.title__line {
  display: inline-block;
}

.title em {
  font-style: italic;
  font-weight: 340;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
}

.lede {
  margin: clamp(10px, 2.4vh, 20px) auto 0;
  max-width: 34ch;
  font-size: clamp(13px, min(1.6vw, 2.2vh), 16px);
  line-height: 1.45;
  color: var(--muted);
  text-wrap: balance;
}

/* ---------------------------------------------------------------- the dial of the sun on the horizon */
.dial {
  justify-self: center;
  width: min(300px, 70vw);
  padding: 0 0 clamp(14px, 4.4vh, 40px);
  text-align: center;
}

.dial__track {
  position: relative;
  height: 14px;
}

.dial__ticks {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 5px;
  background:
    linear-gradient(var(--line), var(--line)) 0 100% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 10%) 0 100% / 100% 4px no-repeat;
  -webkit-mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.dial__sun {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 22px;
  height: 12px;
  margin-left: -11px;
  will-change: transform;
}

.dial__sun svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
}

.dial__disc {
  stroke: var(--sunlight);
  stroke-width: 1.4;
}

.dial__line {
  stroke: var(--ink);
  stroke-width: 1;
  opacity: 0.6;
}

.dial__read {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  margin: 9px 0 0;
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dial__phase {
  color: var(--ink);
  font-weight: 540;
  font-variation-settings: 'wght' 540;
}

.dial__time,
.dial__bearing {
  display: inline-block;
}

.hint {
  position: absolute;
  right: clamp(16px, 4vw, 44px);
  bottom: clamp(14px, 4.4vh, 40px);
  margin: 0;
  font-size: 11px;
  color: rgba(255, 247, 239, 0.5);
}

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

@media (max-width: 520px) {
  .nav__link--wide {
    display: none;
  }
  .dial__read {
    gap: 8px;
    font-size: 11px;
  }
}

@media (max-height: 460px) {
  .hero {
    padding-top: clamp(16px, 7vh, 40px);
  }
  .lede {
    max-width: 30ch;
  }
}
