:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #f4ebe4;
  background: #211317;
}

* { box-sizing: border-box; }

body { margin: 0; }

.skip-link {
  position: fixed;
  z-index: 3;
  top: 1rem;
  left: 1rem;
  padding: .8rem 1rem;
  background: #e0eeaf;
  color: #1d2914;
  transform: translateY(calc(-100% - 1.5rem));
  border-radius: 3px;
}

.skip-link:focus { transform: none; }

.stage {
  position: relative;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 44%, #464b33 0%, #2b2f22 46%, #1a1e16 100%);
}

.stage::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: #171014;
  opacity: var(--fade, 0);
}

.poster,
#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.poster {
  object-fit: contain;
  object-position: center bottom;
}

#world { display: block; }

.model-ready .poster { visibility: hidden; }

.arrival {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 3rem clamp(1.5rem, 7vw, 3rem);
  background: #211317;
}

.intro {
  width: min(100%, 30rem);
  margin-inline: auto;
}

.label {
  margin: 0 0 .5rem;
  color: #cbb4b6;
  font-size: .9rem;
  font-weight: 600;
}

h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(5.4rem, 16vw, 9rem);
  font-weight: 400;
  letter-spacing: -.065em;
  line-height: .94;
}

.intro > p:not(.label) {
  max-width: 32ch;
  margin: 1.15rem 0 1.5rem;
  color: #ead9d8;
  font-size: 1.08rem;
  line-height: 1.65;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
}

.join {
  display: inline-block;
  padding: .8rem 1.1rem;
  border-radius: 3px;
  background: #e0eeaf;
  color: #212b16;
  font-weight: 650;
  text-decoration: none;
}

.join:hover { background: #eff8ce; }

.replay {
  padding-block: .65rem;
  color: #dec9c7;
  text-decoration-thickness: 1px;
  text-underline-offset: .24em;
}

.replay:hover { color: #fff1e6; }

a:focus-visible {
  outline: 2px solid #eff8ce;
  outline-offset: 4px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .scroll-scene .stage {
    position: sticky;
    top: 0;
  }

  .scroll-scene .arrival {
    margin-top: 114svh;
    background: linear-gradient(90deg, #090f1ddd, #090f1d80 42%, transparent 67%);
  }

  .scroll-scene.model-ready .intro {
    width: min(100%, 31rem);
    margin-inline: clamp(0rem, 5vw, 6rem) auto;
  }

  .scroll-scene.model-ready .arrival:not(:focus-within) h1 {
    translate: var(--title-shift, 0px) 0;
  }

  .scroll-scene:not(.model-ready) .arrival { background: #211317; }
}

@media (prefers-reduced-motion: no-preference) and (max-aspect-ratio: 4/5) {
  .scroll-scene.model-ready .arrival {
    align-items: end;
    padding-bottom: clamp(3.5rem, 10svh, 6rem);
    background: linear-gradient(0deg, #090f1df7, #090f1d5c 38%, transparent 65%);
  }

  .scroll-scene.model-ready .intro { margin-inline: 0 auto; }
}

.tooth-keys {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.tooth-keys button {
  position: absolute;
  width: 2rem;
  height: 2rem;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.tooth-keys button:focus-visible {
  outline: 2px solid #eff8ce;
  background: #eff8ce33;
}

.tooth-hint {
  position: absolute;
  z-index: 2;
  inset: auto 1rem max(1rem, env(safe-area-inset-bottom));
  color: #f4ebe4;
  text-align: center;
  font-size: .875rem;
  pointer-events: none;
}

.tooth-hint > span {
  display: inline-block;
  padding: .5rem .7rem;
  border-radius: 4px;
  background: #181516ed;
}

.tooth-status:empty { display: none; }
