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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #dfe7f5;
  font-family: "Avenir Next", "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#view:active { cursor: grabbing; }

/* ---------- title ---------- */
#title {
  position: fixed;
  top: 26px;
  left: 32px;
  pointer-events: none;
  z-index: 5;
}
#title h1 {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 0.55em;
  color: #f2f6ff;
  text-shadow: 0 0 24px rgba(120, 170, 255, 0.45);
}
#title .sub {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.28em;
  color: rgba(200, 216, 245, 0.62);
}
#desc {
  margin-top: 14px;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: rgba(170, 195, 235, 0.85);
  transition: opacity 0.3s ease;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 18px;
  max-width: min(94vw, 720px);
  padding: 16px 26px 14px;
  border-radius: 18px;
  background: rgba(10, 15, 28, 0.55);
  border: 1px solid rgba(150, 180, 255, 0.14);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}

.divider {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, transparent, rgba(160, 190, 255, 0.25), transparent);
}

/* scale slider */
.scale-block { display: flex; flex-direction: column; gap: 8px; }

.scale-labels {
  display: flex;
  justify-content: space-between;
  width: 300px;
}
.scale-label {
  appearance: none;
  background: none;
  border: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(150, 172, 210, 0.5);
  cursor: pointer;
  transition: color 0.25s, text-shadow 0.25s;
  padding: 2px 0;
}
.scale-label:first-child { text-align: left; }
.scale-label:last-child { text-align: right; }
.scale-label.active {
  color: #cfe0ff;
  text-shadow: 0 0 14px rgba(120, 170, 255, 0.8);
}

.slider-row { position: relative; width: 300px; height: 22px; }

.ticks {
  position: absolute;
  top: 50%;
  left: 9px;
  right: 9px;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.ticks i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(170, 200, 255, 0.35);
}

#scale-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}
#scale-slider::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(90, 140, 255, 0.55), rgba(150, 110, 255, 0.45));
  box-shadow: 0 0 10px rgba(100, 150, 255, 0.35);
}
#scale-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ffffff, #a8c8ff 55%, #5f8fe8);
  box-shadow: 0 0 16px rgba(140, 180, 255, 0.95), 0 0 4px rgba(255, 255, 255, 0.9);
  border: 0;
  transition: transform 0.15s;
}
#scale-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
#scale-slider::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(90, 140, 255, 0.55), rgba(150, 110, 255, 0.45));
}
#scale-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 38% 32%, #ffffff, #a8c8ff 55%, #5f8fe8);
  box-shadow: 0 0 16px rgba(140, 180, 255, 0.95);
}

/* deform toggle */
.toggle {
  appearance: none;
  background: none;
  border: 0;
  font: inherit;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  padding: 4px 2px;
}
.toggle .pill {
  position: relative;
  width: 46px;
  height: 24px;
  border-radius: 13px;
  background: rgba(70, 85, 120, 0.45);
  border: 1px solid rgba(160, 190, 255, 0.2);
  transition: background 0.3s, box-shadow 0.3s;
}
.toggle .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(160deg, #e8eefc, #9db4dd);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.5, 1), background 0.3s;
}
.toggle[aria-pressed="true"] .pill {
  background: linear-gradient(90deg, rgba(90, 150, 255, 0.75), rgba(160, 110, 255, 0.7));
  box-shadow: 0 0 18px rgba(120, 160, 255, 0.55);
}
.toggle[aria-pressed="true"] .knob {
  transform: translateX(22px);
  background: #ffffff;
}
.toggle .t-label {
  font-size: 12.5px;
  letter-spacing: 0.22em;
  color: rgba(190, 208, 240, 0.85);
  transition: color 0.3s, text-shadow 0.3s;
  white-space: nowrap;
}
.toggle[aria-pressed="true"] .t-label {
  color: #e8f0ff;
  text-shadow: 0 0 12px rgba(140, 180, 255, 0.8);
}

/* fullscreen icon button */
.icon-btn {
  appearance: none;
  border: 1px solid rgba(160, 190, 255, 0.2);
  background: rgba(70, 85, 120, 0.4);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(200, 216, 245, 0.85);
  transition: background 0.25s, box-shadow 0.25s, color 0.25s;
}
.icon-btn:hover {
  background: rgba(95, 115, 160, 0.55);
  color: #fff;
  box-shadow: 0 0 14px rgba(120, 160, 255, 0.35);
}
.icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn .ic-compress { display: none; }
html.is-fs .icon-btn .ic-expand { display: none; }
html.is-fs .icon-btn .ic-compress { display: block; }

/* discreet link back to the site index */
#up {
  position: fixed;
  top: 28px;
  right: 30px;
  z-index: 6;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-decoration: none;
  color: rgba(170, 195, 235, 0.42);
  padding: 6px 4px 6px 8px;
  transition: color 0.25s, text-shadow 0.25s;
}
#up:hover {
  color: rgba(220, 233, 255, 0.95);
  text-shadow: 0 0 12px rgba(130, 170, 255, 0.7);
}

/* ---------- misc ---------- */
#credit {
  position: fixed;
  right: 14px;
  bottom: 10px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: rgba(140, 160, 200, 0.4);
  z-index: 5;
  pointer-events: none;
}

#fade {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 20;
}
#fade.on { opacity: 1; }

#loading {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease;
}
#loading.done { opacity: 0; pointer-events: none; }
.l-inner { text-align: center; }
.l-title {
  font-size: 30px;
  font-weight: 200;
  letter-spacing: 0.65em;
  margin-left: 0.65em;
  color: #eef3ff;
  text-shadow: 0 0 30px rgba(130, 175, 255, 0.7);
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}
.l-bar {
  width: 220px;
  height: 2px;
  margin: 26px auto 14px;
  background: rgba(120, 150, 210, 0.18);
  border-radius: 1px;
  overflow: hidden;
}
.l-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #6f9fff, #b48aff);
  box-shadow: 0 0 12px rgba(130, 165, 255, 0.9);
  transition: width 0.25s ease;
}
.l-note {
  font-size: 10.5px;
  letter-spacing: 0.3em;
  color: rgba(160, 180, 220, 0.55);
}

@media (max-width: 640px) {
  #hud { gap: 14px; padding: 12px 16px 10px; bottom: 16px; }
  .scale-labels, .slider-row { width: 220px; }
  #title { top: 16px; left: 18px; }
  #title h1 { font-size: 20px; }
}
