:root {
  color-scheme: dark;
  --night: 0;
  --px: 0;
  --py: 0;
  --journey: 0;
}
* {
  box-sizing: border-box;
}
html {
  background: #172c35;
  scrollbar-width: none;
}
html::-webkit-scrollbar {
  display: none;
}
body {
  margin: 0;
}
main {
  height: 190svh;
}
.scene {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #172c35;
  touch-action: pan-y;
}
.world {
  position: absolute;
  width: max(106vw, 188svh);
  height: max(59.66vw, 106svh);
  left: 50%;
  top: 50%;
  transform: translate(
      calc(-50% + var(--px) * -1px),
      calc(-50% + var(--py) * -0.5px + var(--journey) * -4px)
    )
    scale(calc(1 + var(--journey) * 0.012));
  will-change: transform;
}
.landscape,
.night,
.cliffs,
.stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.landscape {
  background: url('assets/iceland.webp') center / cover;
}
.depth-surface {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}
.layer {
  filter: saturate(0.76) brightness(calc(1 - var(--night) * 0.4));
}
.night {
  background: #061a30;
  mix-blend-mode: multiply;
  opacity: calc(var(--night) * 0.35);
}
.word-layer {
  position: absolute;
  inset: 0;
  transform: translate(
    calc(var(--px) * -2px),
    calc(var(--py) * -1px + var(--journey) * -8px)
  );
  will-change: transform;
  pointer-events: none;
}
h1,
.reflection {
  position: absolute;
  width: 100%;
  text-align: center;
  font:
    400 clamp(150px, 27vw, 440px)/0.78 'Iowan Old Style',
    'Baskerville',
    'Palatino Linotype',
    serif;
  letter-spacing: -0.065em;
  padding-right: 0.065em;
  margin: 0;
  color: #f1eee4;
}
h1 {
  top: 32%;
  opacity: 0.92;
  text-shadow: 0 4px 55px #e4f2ee1a;
  animation: emerge 3.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.reflection {
  top: 59%;
  transform: translateX(calc(var(--water-phase, 0) * 1px))
    scaleY(calc(-0.48 + var(--water-phase, 0) * 0.002));
  transform-origin: center;
  color: #c9dad8;
  opacity: 0.23;
  filter: url('#water-reflection') blur(1px);
  mask-image: linear-gradient(to top, #000, transparent 85%);
  animation: emerge-reflection 4s ease both;
}
.foreground {
  pointer-events: none;
}
.cliffs {
  clip-path: url('#land-occlusion');
}
button {
  position: absolute;
  bottom: max(30px, env(safe-area-inset-bottom));
  padding: 10px;
  width: 44px;
  height: 44px;
  color: #e7eeeb;
  border: 1px solid #e7eeeb30;
  background: #11273125;
  border-radius: 50%;
  backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 0.65;
  transition:
    opacity 0.3s,
    border-color 0.3s,
    transform 0.5s;
}
button:hover,
button:focus-visible {
  opacity: 1;
  border-color: #e7eeeb;
}
button:focus-visible {
  outline: 2px solid #e7eeeb;
  outline-offset: 5px;
}
button svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1;
}
.light-control {
  right: max(32px, env(safe-area-inset-right));
}
.light-control[aria-pressed='true'] {
  transform: rotate(90deg);
}
.motion-control {
  left: max(32px, env(safe-area-inset-left));
}
.play-icon {
  display: none;
}
.paused .play-icon {
  display: block;
}
.paused h1 {
  animation: none;
  opacity: 0.92;
}
.paused .pause-icon {
  display: none;
}
.scroll-mark {
  position: absolute;
  bottom: 42px;
  left: 50%;
  height: 36px;
  width: 1px;
  background: #e7eeeb20;
  opacity: calc(1 - var(--journey) * 3);
  pointer-events: none;
}
.scroll-mark span {
  display: block;
  width: 1px;
  height: 12px;
  background: #e7eeeb90;
  animation: descend 3s ease-in-out infinite;
}
.cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  border: 1px solid #edf3ea40;
  border-radius: 50%;
  margin: -17px;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.6s,
    width 0.5s,
    height 0.5s;
}
.cursor span {
  position: absolute;
  width: 3px;
  height: 3px;
  top: calc(50% - 1.5px);
  left: calc(50% - 1.5px);
  border-radius: 50%;
  background: #edf3ea90;
}
.scene.pointer-inside .cursor {
  opacity: 0.7;
}
.definitions {
  position: absolute;
  width: 0;
  height: 0;
}
.paused *,
.reduced * {
  animation-play-state: paused !important;
}
@media (max-width: 600px) {
  h1,
  .reflection {
    font-size: clamp(130px, 37vw, 220px);
  }
  h1 {
    top: 38%;
  }
  .reflection {
    top: 57%;
  }
  .light-control {
    right: 20px;
  }
  .motion-control {
    left: 20px;
  }
  .cursor {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  main {
    height: 100svh;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
  }
  .scroll-mark {
    display: none;
  }
  .world,
  .word-layer {
    will-change: auto;
  }
}
