:root {
  color-scheme: dark;
  --ivory: #fff4e7;
  --muted: #dfcfcb;
  --accent: #efbc95;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: #554e6b;
  color: var(--ivory);
  font:
    14px "DM Sans",
    sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}
a,
button {
  -webkit-tap-highlight-color: transparent;
}
a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 8px;
}
#world,
.shade,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#world {
  z-index: -3;
  background: linear-gradient(#444c75, #e99870);
}
#world canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.shade {
  z-index: -2;
  background:
    linear-gradient(90deg, #1d25384d, transparent 65%),
    linear-gradient(0deg, #152c4560, transparent 25%);
}
.grain {
  z-index: 4;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.5' filter='url(%23n)'/%3E%3C/svg%3E");
}
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 4.3%;
  z-index: 8;
}
.wordmark {
  font-size: 23px;
  letter-spacing: -1px;
  font-weight: 500;
}
.wordmark span {
  margin-left: 8px;
  color: var(--accent);
}
nav {
  display: flex;
  gap: 36px;
  font-size: 12px;
}
nav button,
nav a {
  text-decoration: underline;
  text-decoration-color: #efbc9566;
  text-underline-offset: 6px;
  transition: text-decoration-color 0.2s ease;
}
nav button:hover,
nav a:hover,
nav button:focus-visible,
nav a:focus-visible {
  text-decoration-color: var(--accent);
}
main {
  height: 650vh;
}
.chapter {
  height: 130vh;
  position: relative;
}
.hero-content,
.story,
.closing {
  position: fixed;
  left: 8%;
  top: 23%;
  width: 460px;
  max-width: 40vw;
  visibility: hidden;
  opacity: 0;
  will-change: opacity, transform;
  z-index: 2;
}
.hero-content {
  top: 23%;
  width: 600px;
  max-width: 70vw;
  visibility: visible;
  opacity: 1;
}
.story,
.closing {
  top: 50%;
}
.story.right {
  left: auto;
  right: 8%;
  max-width: 360px;
  top: 50%;
}
.closing {
  left: 8%;
  width: 550px;
}
.eyebrow {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 3px;
  display: flex;
  gap: 15px;
  align-items: center;
  color: #ffe0c6;
}
.small-line {
  flex-shrink: 0;
  width: 30px;
  height: 1px;
  background: var(--accent);
}
h1,
h2 {
  font-family: "Italiana", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.05em;
}
h1 {
  font-size: clamp(94px, 11vw, 174px);
  line-height: 0.86;
  margin: 30px 0;
}
h1 em {
  font-style: normal;
  color: #ffe0be;
}
h2 {
  font-size: clamp(48px, 5vw, 76px);
  line-height: 1.03;
  margin: 25px 0;
}
p {
  line-height: 1.85;
  color: #fff0e5;
  font-size: 14px;
}
.hero p {
  margin: 30px 0 24px;
}
.story p {
  max-width: 420px;
}
.begin {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 25px;
}
.begin span {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid #fff5;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.scene-caption {
  position: fixed;
  right: 6%;
  top: 70%;
  z-index: 2;
}
.scene-caption > span {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--accent);
}
.scene-caption p {
  font:
    italic 22px/1.4 Georgia,
    serif;
  color: #ffe4cb;
  margin: 8px 0 0;
}
.handwritten {
  display: block;
  margin-top: 25px;
  font:
    italic 22px Georgia,
    serif;
  color: var(--accent);
}
.text-link,
.email {
  display: inline-block;
  border-bottom: 1px solid #fff7;
  padding: 12px 0;
  font-size: 13px;
  margin-top: 10px;
}
.text-link span,
.email span {
  margin-left: 28px;
}
.closing p {
  margin: 20px 0;
}
.closing .email {
  font-size: 16px;
}
#back-top {
  display: flex;
  width: fit-content;
  max-width: 100%;
  text-align: left;
  margin: 24px 0 0;
  padding: 0;
  font-size: 11px;
  color: var(--muted);
}
.next-chapter {
  display: flex;
  width: max-content;
  margin-top: 28px;
}
.hud {
  position: fixed;
  bottom: 0;
  width: 100%;
  padding: 25px 4.3%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 8;
  font-size: 9px;
  letter-spacing: 1.5px;
}
.location {
  display: flex;
  gap: 13px;
  align-items: center;
}
.location small {
  display: block;
  font-size: 7px;
  letter-spacing: 1.8px;
  margin-top: 7px;
  color: var(--muted);
}
.location-dot {
  width: 6px;
  height: 6px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 5px #efbc9510;
}
.journey-progress {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 14px;
  align-items: center;
}
.track {
  width: 130px;
  height: 1px;
  background: #ffffff30;
}
.track i {
  display: block;
  height: 1px;
  background: var(--accent);
  width: 0;
}
.hud-controls {
  display: flex;
  gap: 24px;
  align-items: center;
}
.hud-controls button {
  font-size: 11px;
}
.hud-controls span {
  margin-left: 8px;
}
dialog {
  position: fixed;
  max-width: 560px;
  width: calc(100% - 36px);
  padding: 54px;
  color: var(--ivory);
  background: #222d3bec;
  border: 1px solid #ffffff25;
  box-shadow: 0 30px 100px #0007;
  backdrop-filter: blur(25px);
}
dialog::backdrop {
  background: #12202c99;
  backdrop-filter: blur(7px);
}
dialog h2 {
  font-size: 45px;
}
dialog p {
  font-size: 14px;
}
.close {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 27px;
}
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ed9579 0%, #a86f79 53%, #172d43 100%);
  z-index: 20;
  transition:
    opacity 1s,
    visibility 1s;
}
#loading.done {
  opacity: 0;
  visibility: hidden;
}
.loading-mark {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  box-shadow: 0 12px 34px #172d4340;
}
#loading p {
  font-size: 10px;
  letter-spacing: 2px;
  margin: 20px 0 30px;
}
.loading-line {
  width: 120px;
  height: 1px;
  background: #fff3;
}
.loading-line:after {
  content: "";
  display: block;
  width: 50%;
  height: 1px;
  background: var(--accent);
  animation: load 1.3s infinite;
}
@keyframes load {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(200%);
  }
}
.no-webgl main {
  height: auto;
}
.no-webgl .chapter {
  height: auto;
  padding: 110px 8%;
}
.no-webgl .hero-content,
.no-webgl .story,
.no-webgl .closing {
  position: static;
  visibility: visible;
  opacity: 1;
  max-width: 600px;
}
.no-webgl .scene-caption {
  display: none;
}
@media (max-width: 650px) {
  header {
    padding: 25px 6%;
  }
  .wordmark {
    font-size: 21px;
  }
  nav {
    gap: 18px;
  }
  nav button {
    font-size: 0;
  }
  nav button:after {
    content: "About";
    font-size: 11px;
  }
  nav button span {
    display: none;
  }
  nav a {
    font-size: 11px;
  }
  .hero-content,
  .story,
  .story.right,
  .closing {
    left: 8%;
    right: 8%;
    max-width: 84vw;
    width: auto;
    top: 50%;
  }
  .hero-content {
    top: 26%;
  }
  h1 {
    font-size: 105px;
  }
  h2 {
    font-size: 53px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 2px;
  }
  .hero p,
  .story p {
    font-size: 13px;
  }
  .scene-caption {
    display: none;
  }
  .hud {
    padding: 23px 6%;
  }
  .journey-progress {
    display: none;
  }
  .hud-controls {
    gap: 17px;
  }
  .hud-controls span {
    display: none;
  }
  .location {
    font-size: 8px;
  }
  .location small {
    font-size: 6px;
  }
  dialog {
    padding: 40px 28px;
  }
  .closing h2 {
    font-size: 56px;
  }
}
@media (max-height: 700px) and (min-width: 651px) {
  .hero-content {
    top: 20%;
  }
  h1 {
    font-size: 110px;
  }
  .hero p {
    margin: 20px 0;
  }
  .story,
  .closing {
    top: 50%;
  }
  h2 {
    font-size: 58px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .loading-line:after {
    animation: none;
  }
}

/* Keep the name on one line across screen sizes. */
.hero h1 {
  font-size: clamp(68px, 10.5vw, 160px);
}
@media (max-width: 650px) {
  .hero h1 {
    font-size: clamp(60px, 18vw, 108px);
  }
}

#sound-toggle[aria-pressed="true"] {
  color: var(--accent);
}
#play[hidden],
#sound-toggle[hidden] {
  display: none;
}
#play.start-journey {
  padding: 12px 17px;
  border: 1px solid var(--accent);
  background: #1b293666;
  font-size: 12px;
  letter-spacing: 0;
}
#play.start-journey:hover {
  background: #1b2936b3;
}
@media (max-width: 650px) {
  #play.start-journey span {
    display: inline;
    font-size: 10px;
  }
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.about-action {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid #ffffff40;
  border-radius: 2px;
  font-size: 12px;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.about-action:hover,
.about-action:focus-visible {
  border-color: var(--accent);
  background: #efbc9514;
  color: #ffe0c6;
}
@media (max-width: 650px) {
  #background h2 {
    font-size: 48px;
  }
  #building .story.right {
    top: 50%;
  }
  #building h2 {
    font-size: 43px;
    margin: 15px 0;
  }
  #building .story p {
    font-size: 12px;
    line-height: 1.55;
    margin: 10px 0 12px;
  }
}

@media (max-height: 760px) and (min-width: 651px) {
  #building h2 {
    font-size: clamp(44px, 4.2vw, 62px);
    margin: 14px 0;
  }
  #building .story p {
    font-size: 13px;
    line-height: 1.6;
    margin: 10px 0 12px;
  }
  #building .text-link {
    padding: 8px 0;
  }
}

/* Readable content is the default if JavaScript or WebGL is unavailable. */
.no-webgl #loading,
.no-webgl .hud,
.no-webgl #about-button {
  display: none;
}
.no-webgl .hero-content,
.no-webgl .story,
.no-webgl .closing {
  transform: none !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.no-webgl .chapter {
  scroll-margin-top: 70px;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 30;
  padding: 12px 18px;
  background: #222d3b;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: translateY(0);
}
@media print {
  header,
  .hud,
  #world,
  .shade,
  .grain,
  #loading,
  .scene-caption,
  .begin,
  dialog,
  .skip-link {
    display: none !important;
  }
  body {
    background: white;
    color: black;
  }
  main,
  .chapter {
    height: auto;
  }
  .chapter {
    break-inside: avoid;
    margin: 24px 0;
  }
  .hero-content,
  .story,
  .story.right,
  .closing {
    position: static;
    max-width: none;
    width: auto;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }
  p,
  .eyebrow {
    color: black;
  }
}

/* Keep the progress track centered while placing replay beside it. */
#restart-journey {
  position: absolute;
  right: calc(100% + 10px);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  border-radius: 50%;
  transition:
    color 0.2s,
    background 0.2s;
}
#restart-journey:hover {
  color: var(--ivory);
  background: #ffffff12;
}
#restart-journey[hidden] {
  display: none;
}

.journey-caption {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#restart-fade {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: linear-gradient(180deg, #8e707d 0%, #be8b77 55%, #8e878f 100%);
  opacity: 0;
  pointer-events: none;
}
#restart-fade.active {
  pointer-events: auto;
}
@media print {
  #restart-fade {
    display: none;
  }
}

/* Land the travel chapter at 66% of the route, before cresting the ridge. */
#perspective {
  scroll-margin-top: 27vh;
}
.no-webgl #perspective {
  scroll-margin-top: 70px;
}

/* One brief invitation after the loading screen's one-second fade. */
@media (prefers-reduced-motion: no-preference) {
  #play.start-journey.start-cue {
    transform-origin: center;
    animation: journey-invitation 3.2s ease-in-out 1.5s 1;
  }
}
@keyframes journey-invitation {
  0%,
  100% {
    transform: scale(1);
    background-color: var(--cue-rest, #1b293666);
    box-shadow:
      0 0 0 0 #efbc9500,
      0 0 0 #efbc9500;
  }
  50% {
    transform: scale(1.025);
    background-color: #80634d88;
    box-shadow:
      0 0 0 2px #efbc9515,
      0 0 9px #efbc9540;
  }
}

/* Optional summit exploration. The page remains at the summit beneath it. */
#explore-toggle {
  position: fixed;
  right: 4.3%;
  bottom: 82px;
  z-index: 9;
  padding: 12px 17px;
  border: 1px solid #efbc9577;
  background: #1b2936b3;
  font-size: 12px;
}
#explore-toggle span {
  margin-left: 14px;
}
#explore-toggle[hidden],
#explore-ui[hidden],
.no-webgl #explore-toggle {
  display: none;
}
#explore-ui {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
#explore-look {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}
#explore-look:active {
  cursor: grabbing;
}
#explore-look:focus-visible {
  outline: 1px solid #efbc9566;
  outline-offset: -5px;
}
.explore-hint {
  position: absolute;
  top: 105px;
  left: 6%;
  right: 6%;
  text-align: center;
  text-shadow: 0 1px 12px #172638;
}
.explore-hint strong {
  display: block;
  font:
    30px "Italiana",
    serif;
  margin-bottom: 9px;
}
.explore-hint span {
  font-size: 11px;
  color: var(--muted);
}
.explore-hint .explore-touch {
  display: none;
}
#explore-exit {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 18px;
  background: #1b2936dc;
  border: 1px solid #efbc9577;
  white-space: nowrap;
  font-size: 12px;
  pointer-events: auto;
}
#explore-exit:disabled {
  opacity: 0.7;
}
#explore-stick {
  position: absolute;
  bottom: 95px;
  left: 6%;
  width: 106px;
  height: 106px;
  display: grid;
  place-items: center;
  border: 1px solid #efbc9588;
  border-radius: 50%;
  background: #1b293655;
  pointer-events: auto;
  touch-action: none;
}
#explore-stick span {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #efbc95aa;
  background: #efbc9544;
  pointer-events: none;
}
.explore-altitude {
  position: absolute;
  right: 6%;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.explore-altitude button {
  width: 44px;
  height: 44px;
  border: 1px solid #efbc9577;
  border-radius: 50%;
  background: #1b293688;
  font-size: 23px;
  pointer-events: auto;
  touch-action: none;
}
.exploring .hero-content,
.exploring .story,
.exploring .closing,
.exploring .scene-caption,
.exploring .location,
.exploring .journey-progress {
  visibility: hidden !important;
  pointer-events: none;
}
.exploring .hud {
  pointer-events: none;
}
.exploring #sound-toggle {
  pointer-events: auto;
}
@media (pointer: coarse) {
  .explore-hint .explore-desktop {
    display: none;
  }
  .explore-hint .explore-touch {
    display: block;
  }
}
@media (max-width: 650px) {
  #explore-toggle {
    right: 6%;
    bottom: 82px;
  }
  .explore-hint {
    top: 100px;
  }
  .explore-hint strong {
    font-size: 26px;
  }
  .explore-hint span {
    font-size: 10px;
  }
}
@media print {
  #explore-toggle,
  #explore-ui {
    display: none !important;
  }
}

#explore-stick::after {
  content: "MOVE";
  position: absolute;
  bottom: -21px;
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--muted);
}
@media (max-width: 650px) {
  .explore-hint .explore-desktop { display: none; }
  .explore-hint .explore-touch { display: block; }
}

.explore-keys { display: none; }
@media (hover: hover) and (pointer: fine) {
  .explore-keys {
    position: absolute;
    inset: 22px 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    pointer-events: none;
  }
  .explore-keys kbd, .explore-altitude button::after {
    display: grid;
    place-items: center;
    border: 1px solid #efbc9566;
    border-radius: 4px;
    background: #1b2936b3;
    font: 10px 'DM Sans', sans-serif;
    color: var(--ivory);
  }
  .explore-keys kbd:first-child { grid-column: 2; }
  .explore-keys kbd:nth-child(2) { grid-column: 1; grid-row: 2; }
  .explore-keys kbd:nth-child(3) { grid-column: 2; grid-row: 2; }
  .explore-keys kbd:nth-child(4) { grid-column: 3; grid-row: 2; }
  #explore-stick {
    border: 0;
    background: none;
    pointer-events: none;
  }
  #explore-stick > span, #explore-stick::after { display: none; }
  .explore-altitude button { position: relative; }
  .explore-altitude button::after { position: absolute; right: 54px; top: 10px; width: 22px; height: 22px; pointer-events: none; }
  #explore-up::after { content: 'E'; }
  #explore-down::after { content: 'Q'; }
}

@media (prefers-reduced-motion: no-preference) {
  #explore-toggle:not([hidden]) {
    --cue-rest: #1b2936b3;
    transform-origin: center;
    animation: journey-invitation 3.2s ease-in-out .5s 1;
  }
}
