:root {
  --ink: #000;
  --paper: #e9e3d5;
  --dim: rgba(233, 227, 213, 0.42);
  --faint: rgba(233, 227, 213, 0.22);
  --type: "Special Elite", "Courier New", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  height: 100dvh;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--type);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  outline: none;
  transition: opacity 0.2s linear;
}

#scene {
  cursor: grab;
}

#scene.is-pointer {
  cursor: pointer;
}

#scene.is-dragging {
  cursor: grabbing;
}

.loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--ink);
  transition: opacity 0.8s ease;
  z-index: 2;
}

.loader.is-done {
  opacity: 0;
  pointer-events: none;
}

.loader-mark {
  width: clamp(56px, 7vw, 84px);
  fill: none;
  stroke: var(--paper);
  stroke-width: 16;
  opacity: 0.85;
  animation: flicker 1.6s steps(2, jump-none) infinite;
}

@keyframes flicker {
  50% { opacity: 0.35; }
}

.hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding:
    0
    calc(clamp(16px, 3vw, 36px) + env(safe-area-inset-right))
    calc(clamp(14px, 2.6vw, 28px) + env(safe-area-inset-bottom))
    calc(clamp(16px, 3vw, 36px) + env(safe-area-inset-left));
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--dim);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
  z-index: 1;
}

.hud.is-on {
  opacity: 1;
}

.hud-hint {
  color: var(--faint);
}

.hud-where {
  display: flex;
  gap: 1.4em;
  text-transform: lowercase;
}

.hud-link {
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid var(--faint);
  pointer-events: auto;
  visibility: hidden;
}

.hud-link.is-on {
  visibility: visible;
}

.hud-link:hover,
.hud-link:focus-visible {
  color: var(--paper);
  border-color: var(--paper);
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  .hud {
    flex-wrap: wrap;
    row-gap: 6px;
    font-size: 13px;
    letter-spacing: 0.06em;
  }

  .hud-hint {
    flex-basis: 100%;
    order: 3;
    font-size: 11px;
  }

  .hud-link {
    padding: 12px 0 4px;
  }
}

@media (pointer: coarse) {
  .hud {
    color: rgba(233, 227, 213, 0.6);
    padding-top: 28px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 30%, rgba(0, 0, 0, 0));
  }

  .hud-hint {
    color: var(--dim);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-mark {
    animation: none;
  }
}
