:root {
  color-scheme: dark;
  background: #000;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: #000;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
}

.page {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 430px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 48%, rgba(8, 56, 126, .11), transparent 38%),
    #000;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.development-text {
  position: absolute;
  left: 50%;
  top: calc(50% + clamp(108px, 12vw, 145px));
  transform: translate(-50%, -52px);
  z-index: 4;
  color: #737e8e;
  font-size: clamp(11px, 1.35vw, 16px);
  font-weight: 700;
  letter-spacing: clamp(.22em, .42vw, .42em);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 14px rgba(74, 143, 238, .08);
}

.development-text.show {
  animation: developmentDrop .9s cubic-bezier(.2,.82,.22,1.16) forwards;
}

.sound-button {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 6;
  min-width: 44px;
  min-height: 44px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  color: #b7c1cf;
  background: rgba(4, 7, 12, .64);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}

.sound-button[aria-pressed="true"] {
  color: #e1efff;
  border-color: rgba(43, 132, 255, .48);
}

.sound-button:focus-visible {
  outline: 2px solid #4f9dff;
  outline-offset: 3px;
}

.sound-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

.sound-hint {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 5;
  color: rgba(166, 178, 194, .68);
  font-size: 11px;
  white-space: nowrap;
  transition: opacity .3s ease;
  pointer-events: none;
}

.sound-hint.hide { opacity: 0; }

.fallback[hidden] { display: none; }

.fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  place-content: center;
  text-align: center;
}

.fallback-logo {
  color: #1478ff;
  font-size: clamp(68px, 15vw, 140px);
  font-weight: 900;
  letter-spacing: -.06em;
}

.fallback-sub {
  margin-top: 20px;
  color: #737e8e;
  font-size: clamp(11px, 1.35vw, 16px);
  font-weight: 700;
  letter-spacing: .34em;
}

@keyframes developmentDrop {
  0% {
    opacity: 0;
    transform: translate(-50%, -52px);
    filter: blur(5px);
  }
  65% {
    opacity: 1;
    transform: translate(-50%, 5px);
    filter: blur(0);
  }
  82% { transform: translate(-50%, -2px); }
  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 700px) {
  .page {
    min-height: 360px;
    height: 100vh;
    height: 100dvh;
  }

  .development-text {
    top: calc(50% + 82px);
    max-width: calc(100vw - 28px);
    font-size: clamp(10px, 3vw, 13px);
    letter-spacing: .20em;
    text-align: center;
  }

  .sound-button {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    min-width: 42px;
    min-height: 42px;
    padding: 0 11px;
  }

  .sound-label { display: none; }

  .sound-hint {
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 28px);
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .development-text {
    top: calc(50% + 72px);
    font-size: 10px;
    letter-spacing: .17em;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .development-text {
    top: calc(50% + 64px);
    font-size: 10px;
    letter-spacing: .18em;
  }

  .sound-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .development-text.show {
    animation: none;
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
