:root {
  color-scheme: dark;
  --gutter: clamp(18px, 4vw, 48px);
  background: #030609;
  color: #f0f1ed;
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
a, button, canvas { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 1px solid #e4edf0; outline-offset: 4px; }

main { position: fixed; inset: 0; height: 100%; height: 100dvh; }
#orbitalCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
}
#orbitalCanvas:active { cursor: grabbing; }
#orbitalCanvas[data-holding] { cursor: crosshair; }
#orbitalCanvas:focus-visible { outline: 1px solid #e4edf0; outline-offset: -4px; }
.message {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  margin: 0;
  padding: 3rem;
  text-align: center;
  font-size: 14px;
  color: #a1aeb6;
  pointer-events: none;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.site-header, .site-controls {
  position: fixed;
  left: max(var(--gutter), env(safe-area-inset-left));
  right: max(var(--gutter), env(safe-area-inset-right));
  isolation: isolate;
  pointer-events: none;
}
.site-header > a, .site-controls > :is(a, button) { pointer-events: auto; }
.site-header::before, .site-controls::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: calc(-1 * max(var(--gutter), env(safe-area-inset-left)));
  right: calc(-1 * max(var(--gutter), env(safe-area-inset-right)));
}
.site-header {
  top: calc(14px + env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-header::before {
  top: calc(-14px - env(safe-area-inset-top));
  height: calc(96px + env(safe-area-inset-top));
  background: linear-gradient(#030609ed, transparent);
}
.lab-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  font-size: clamp(30px, 5vw, 34px);
  line-height: 1;
  letter-spacing: -.045em;
}
.lab-back span { font-size: 25px; letter-spacing: 0; }
.study-title { display: grid; justify-items: end; gap: 4px; text-align: right; }
.study-number { color: #9ba9b3; font: 10px/1.15 ui-monospace, SFMono-Regular, monospace; letter-spacing: .12em; }
.study-title h1 { margin: 0; font-size: clamp(19px, 4vw, 24px); font-weight: 400; line-height: 1; letter-spacing: -.045em; }

.site-controls {
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 6px;
  align-items: end;
}
.site-controls::before {
  bottom: calc(-12px - env(safe-area-inset-bottom));
  height: calc(115px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, #030609df);
}
#sound { display: grid; place-items: center; width: 48px; height: 48px; padding: 4px; border-radius: 50%; }
.sound-bars { position: relative; display: grid; grid-template-columns: repeat(5, 2px); place-content: center; gap: 2px; width: 100%; height: 100%; border: 1px solid; border-radius: 50%; }
#sound .sound-bars i { height: 9px; transform: scaleY(.55); }
#sound[data-playing="true"] .sound-bars i { height: 13px; }
.warp-next { display: grid; place-items: center; min-height: 48px; font-size: 22px; letter-spacing: -.05em; }
#hint {
  align-self: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 13px;
  margin: 0;
  color: #aab9c5;
  text-align: center;
  font-size: 12px;
  line-height: 1.3;
  transition: opacity .5s ease;
}
#hint > span { white-space: nowrap; }
#hint[data-dismissed] { opacity: 0; }
.touch-copy { display: none; }
@media (pointer: coarse) {
  .touch-copy { display: inline; }
  .mouse-copy { display: none; }
}
@media (max-width: 500px) {
  #hint { display: grid; grid-template-columns: repeat(2, max-content); gap: 5px 13px; font-size: 11px; }
}
@media (max-height: 440px) {
  .site-header { top: calc(3px + env(safe-area-inset-top)); }
  .site-controls { bottom: calc(3px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  #hint { transition: none; }
}

/* Keep mobile chrome off the paint path while the globe is moving. */
@media (pointer: coarse) {
  .site-controls .silk-word,
  .site-controls .silk-word::before,
  .site-controls .silk-word::after {
    animation: none;
    background-position: 55% 85%, 40% 15%, 45% 70%;
  }
  .site-controls .sound-bars::before,
  .site-controls #sound .sound-bars i {
    animation: none;
    background-position: 55% 85%;
  }
}
@media (pointer: coarse) and (prefers-reduced-motion: no-preference) {
  .site-controls #sound[data-playing="true"] .sound-bars i {
    animation-name: control-silk-level;
    animation-duration: 2.7s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
  }
  .site-controls #sound[data-playing="true"] .sound-bars i:nth-child(even) {
    animation-delay: -.9s;
    animation-duration: 2.1s;
  }
}
