:root {
  color-scheme: dark;
  font:
    16px/1.45 system-ui,
    sans-serif;
  background: #0c2027;
  color: #fff8e9;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
a,
input {
  font: inherit;
}
button,
a {
  color: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #ffda92;
  outline-offset: 4px;
}
button {
  border: 1px solid #ffffff60;
  border-radius: 0.25rem;
  background: #0b222be8;
  padding: 0.65rem 1rem;
}
a {
  text-underline-offset: 0.24em;
}
.journey {
  height: 450svh;
}
.screen {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #183947;
}
.screen canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    #06182177,
    transparent 17%,
    transparent 80%,
    #05141c90
  );
  z-index: -1;
}
header {
  position: absolute;
  inset: 0 0 auto;
  padding: clamp(1rem, 3.5vw, 3.5rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-shadow: 0 1px 9px #031521;
}
header a {
  text-decoration: none;
}
.mark {
  font-weight: 800;
  font-size: 0.84rem;
  letter-spacing: 0.28em;
}
.back {
  font-size: 0.9rem;
}
.opening {
  position: absolute;
  left: 6vw;
  top: 31%;
  max-width: 35vw;
  text-shadow: 0 2px 24px #0b1c2b;
  transition: opacity 0.2s;
}
.opening h1,
.credits h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.96;
  margin: 0;
}
.opening h1 {
  font-size: clamp(2.8rem, 5.8vw, 7rem);
}
.opening p {
  max-width: 26em;
  margin: 0.75rem 0 0;
}
.opening button {
  margin-top: clamp(0.75rem, 2.4svh, 1.5rem);
  min-height: 44px;
  background: #f8eacb;
  color: #13232c;
  text-shadow: none;
  border-color: #f8eacb;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#status:not(:empty), .unavailable, #friend {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  max-width: min(23rem, 65vw);
  padding: .7rem 1rem;
  background: #102b32;
  border: 1px solid #b6ccc4;
  border-radius: .5rem;
  color: #fff7e7;
}
#friend { bottom: 4.5rem; }
.credits {
  max-width: 65rem;
  margin: auto;
  padding: clamp(3rem, 8vw, 7rem) 5vw;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 7vw;
  align-items: center;
}
.credits h2 {
  font-size: clamp(2rem, 4vw, 4rem);
}
.credits p {
  color: #d9e4db;
}
.credits label {
  font-size: 0.88rem;
}
.credits input {
  max-width: 22rem;
}
.credits button {
  margin-top: 0.7rem;
}
.credits a {
  font-weight: 650;
}
@media (max-aspect-ratio: 9/10) {
  .opening {
    top: max(4.5rem, 10svh);
    left: 6vw;
    max-width: 88vw;
  }
  .opening h1 {
    font-size: clamp(2.2rem, 8.2vw, 4rem);
  }
  .opening p {
    font-size: 0.9rem;
    max-width: 22em;
    margin: 0.65rem 0;
  }
  .opening button {
    padding: 0.52rem 0.8rem;
  }
  .credits {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .screen::after {
    background: linear-gradient(
      #04142190,
      transparent 36%,
      transparent 78%,
      #05141c70
    );
  }
}
@media (max-height: 490px) and (min-aspect-ratio: 1/1) {
  .opening {
    top: 20%;
    max-width: 40%;
  }
  .opening h1 {
    font-size: 2.3rem;
  }
  .opening p {
    margin: 0.4rem 0;
    font-size: 0.82rem;
  }
  .credits {
    padding: 2rem;
  }
  .opening button {
    padding: 0.4rem 0.7rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.screen.unavailable-scene {
  background: #183947 url(./waterline.png) center/cover;
}
.screen.unavailable-scene .opening {
  background: #081b21d9;
  padding: 1rem;
}

.transport {
  --edge: max(.8rem, env(safe-area-inset-right));
  position: absolute;
  right: var(--edge);
  bottom: max(.8rem, env(safe-area-inset-bottom));
  z-index: 2;
  color: #fff8ea;
}
.transport [hidden], .transport[hidden] { display: none; }
#controls-handle, #flight-pane {
  background: linear-gradient(135deg, #23434be8, #092028ef 75%);
  border: 1px solid #b8d1cc85;
  box-shadow: inset 0 1px 0 #e0f7ee38, 0 4px 16px #03171b66;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
#controls-handle {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 2rem;
  padding: 0 .85rem;
  font-size: .83rem;
  font-weight: 600;
}
.dial {
  display: inline-block;
  position: relative;
  width: 1rem;
  height: 1rem;
  border: 1px solid #c9e1df;
  border-radius: 50%;
  background: linear-gradient(140deg, #9ed0cc44, transparent 65%);
}
.dial::before {
  content: "";
  position: absolute;
  width: .32rem;
  height: .32rem;
  top: .08rem;
  right: .05rem;
  border-radius: 50%;
  background: #ffdf9d;
  box-shadow: 0 0 5px #ffdc8f;
}
#controls-handle kbd { font: 500 .72rem system-ui; color: #d6e5e3; border-left: 1px solid #b2c9c45c; padding-left: .5rem; }
#flight-pane {
  position: absolute;
  right: 0;
  bottom: 100%;
  width: min(16.5rem, calc(100vw - 2 * var(--edge)));
  max-height: calc(100svh - 5.5rem - env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  padding: .4rem .65rem;
  border-radius: 1.1rem 1.1rem .4rem 1.1rem;
  transform-origin: bottom right;
}
#flight-pane button {
  background: transparent;
  color: inherit;
  border: 0;
  padding: .25rem .35rem;
  min-height: 44px;
  font-size: .82rem;
  line-height: 1.2;
}
#flight-pane button:hover, #flight-pane button:focus-visible { background: #c4e3df22; }
#flight-pane :focus-visible { outline-offset: -2px; }
#flight-pane input[type=range] { display: block; width: 100%; height: 44px; margin: 0; accent-color: #f5ce8d; }
.cue, .actions, #flight-tools { display: grid; align-items: center; }
.cue { grid-template-columns: 1fr auto; font-size: .85rem; font-weight: 650; }
#pin-pane { color: #dae9e4; min-width: 44px; }
#pin-pane[aria-pressed=true] { color: #ffdfa0; text-decoration: underline; }
.actions { grid-template-columns: 1fr 1.25fr .7fr; border-top: 1px solid #b6d4cc42; }
#travel { font-weight: 650; }
#flight-tools { grid-template-columns: 1fr 1fr; border-top: 1px solid #b6d4cc42; }
#more::after { content: "⌄"; margin-left: .25rem; }
#more[aria-expanded=true]::after { content: "⌃"; }
#direct-panel, #share-panel { padding: .4rem; font-size: .85rem; }
#direct-panel label, #share-panel label { display: block; font-weight: 600; }
#view-url { width: 100%; padding: .5rem; color: #13252a; background: #fff7e7; border-radius: .25rem; }
#share-panel .option { display: flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 400; }
@media (hover:none), (pointer:coarse) { #controls-handle kbd { display: none; } }
@media (prefers-reduced-motion:no-preference) {
  #flight-pane:not([hidden]) { animation: glass-unfurl .17s ease-out; }
  #controls-handle[aria-expanded=false] .dial::before { animation: harbor-glint 5s ease-in-out infinite; }
  @keyframes glass-unfurl { from { opacity: 0; transform: translateY(5px) scale(.97); } }
  @keyframes harbor-glint { 50% { box-shadow: 0 0 7px 1px #ffe1a4; } }
}
@media (prefers-contrast:more), (prefers-reduced-transparency:reduce) {
  #controls-handle, #flight-pane { background: #0c242b; border-color: #e6f4ed; backdrop-filter: none; }
}
@media (forced-colors:active) {
  #controls-handle, #flight-pane, #flight-pane button { border: 1px solid ButtonText; }
  .dial::before { background: ButtonText; }
}
