:root {
  color-scheme: dark;
  --ink: #f6f1df;
  --muted: rgba(246, 241, 223, 0.72);
  --panel: rgba(8, 11, 24, 0.36);
  --line: rgba(255, 255, 255, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #020309;
  scroll-behavior: smooth;
}

body {
  min-height: 600vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    linear-gradient(180deg, rgba(2, 3, 9, 0.14), rgba(2, 3, 9, 0.2)),
    url("./public/images/space-night.png") center / cover fixed;
}

button {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 600vh;
}

#world-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
}

.hud {
  position: fixed;
  z-index: 4;
  left: clamp(16px, 3vw, 44px);
  right: clamp(16px, 3vw, 44px);
  bottom: clamp(16px, 3vw, 34px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
}

.progress-track {
  width: min(240px, 38vw);
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: 0 0 24px rgba(94, 214, 255, 0.28);
}

#scroll-progress {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #8df7ff, #ffdc7f, #ff9aa7);
}

.character-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(540px, 60vw);
  pointer-events: auto;
}

.character-option {
  min-width: 68px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  backdrop-filter: blur(14px);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.character-option:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.45);
}

.character-option.is-active {
  color: #07111d;
  border-color: rgba(255, 255, 255, 0.75);
  background: #f9df91;
}

.copy-block {
  position: fixed;
  z-index: 3;
  left: clamp(22px, 7vw, 120px);
  max-width: min(560px, 76vw);
  pointer-events: none;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}

.copy-block--top {
  top: clamp(42px, 12vh, 130px);
}

.copy-block--bottom {
  right: clamp(22px, 7vw, 120px);
  left: auto;
  bottom: clamp(96px, 17vh, 190px);
  max-width: min(470px, 72vw);
  text-align: right;
  opacity: calc(var(--end-progress, 0) * 1);
  transform: translateY(calc((1 - var(--end-progress, 0)) * 24px));
}

.eyebrow {
  margin: 0 0 9px;
  color: #92efff;
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h3,
h5,
p {
  margin: 0;
}

h3 {
  max-width: 18ch;
  font-size: clamp(1.7rem, 3vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h5 {
  font-size: clamp(1.05rem, 2vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.copy-block p:not(.eyebrow) {
  margin-top: 18px;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.35vw, 1.18rem);
  line-height: 1.72;
}

@media (max-width: 720px) {
  body,
  .page-shell {
    min-height: 600svh;
  }

  .hud {
    align-items: stretch;
    flex-direction: column;
  }

  .progress-track,
  .character-picker {
    width: 100%;
    max-width: none;
  }

  .character-picker {
    justify-content: flex-start;
  }

  .character-option {
    min-width: 0;
    flex: 1 1 84px;
  }

  .copy-block {
    left: 18px;
    right: 18px;
    max-width: none;
  }

  .copy-block--bottom {
    bottom: 148px;
    text-align: left;
  }
}
