:root {
  color-scheme: dark;
  --bg: #020409;
  --panel: rgba(10, 16, 28, 0.66);
  --line: rgba(152, 193, 255, 0.18);
  --text: #eef4ff;
  --muted: rgba(222, 232, 255, 0.72);
  --accent: #ff9859;
  --cyan: #7ec6ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  font-family: "Aptos", "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(42, 57, 91, 0.24), transparent 38%),
    linear-gradient(180deg, #05070d 0%, #020409 40%, #05060a 100%);
  color: var(--text);
}

body {
  position: relative;
  user-select: none;
}

canvas,
.backdrop,
.hud {
  position: fixed;
  inset: 0;
}

#scene,
#objectLayer {
  width: 100%;
  height: 100%;
  display: block;
}

#scene {
  z-index: 1;
}

#objectLayer {
  z-index: 2;
  pointer-events: none;
}

body.launch-mode #scene {
  cursor: crosshair;
}

body:not(.launch-mode) #scene {
  cursor: grab;
}

body.camera-drag #scene {
  cursor: grabbing;
}

.backdrop {
  pointer-events: none;
  z-index: 0;
}

.backdrop__gradient,
.backdrop__mesh,
.backdrop__noise {
  position: absolute;
  inset: 0;
}

.backdrop__gradient {
  background:
    radial-gradient(circle at 18% 22%, rgba(91, 123, 255, 0.14), transparent 22%),
    radial-gradient(circle at 82% 20%, rgba(255, 137, 56, 0.12), transparent 18%),
    radial-gradient(circle at 50% 85%, rgba(0, 163, 255, 0.1), transparent 28%);
  filter: blur(18px);
}

.backdrop__mesh {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.8), transparent 82%);
  opacity: 0.6;
}

.backdrop__noise {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px),
    radial-gradient(circle at 45% 80%, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px);
  background-size: 120px 120px, 180px 180px, 240px 240px;
  opacity: 0.35;
}

.hud {
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(320px, 420px);
  gap: 24px;
  padding: 24px;
  align-items: stretch;
  pointer-events: none;
}

.hero,
.panel {
  pointer-events: auto;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(10, 14, 24, 0.58), rgba(5, 8, 15, 0.28));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  align-self: end;
  max-width: 700px;
  padding: clamp(22px, 3vw, 38px);
  background:
    radial-gradient(circle at top left, rgba(126, 198, 255, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 152, 89, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(7, 10, 18, 0.74), rgba(4, 6, 11, 0.46));
}

.eyebrow,
.panel__eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.hero h1,
.panel h2,
.launcher__title {
  margin: 0;
  font-family: "Aptos Display", "Segoe UI Variable Display", "Franklin Gothic Medium", sans-serif;
  letter-spacing: -0.04em;
}

.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  line-height: 0.95;
}

.panel h2 {
  font-size: 1.65rem;
}

.launcher__title {
  font-size: 1.25rem;
}

.lede,
.status,
.panel__hint {
  max-width: 58ch;
  line-height: 1.6;
  color: var(--muted);
}

.lede {
  margin: 16px 0 24px;
  font-size: 1.02rem;
}

.status {
  margin: 18px 0 0;
  font-size: 0.95rem;
}

.panel__hint {
  margin: 0;
  font-size: 0.9rem;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(238, 244, 255, 0.92);
  font-size: 0.9rem;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-self: stretch;
  max-height: calc(100vh - 48px);
  padding: 24px;
  overflow: auto;
  background: linear-gradient(180deg, rgba(10, 15, 25, 0.88), rgba(6, 10, 18, 0.72));
}

.panel__header,
.actions,
.launcher__header,
.launcher__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.controls,
.toggleGrid {
  display: grid;
  gap: 14px;
}

.controls--compact {
  grid-template-columns: 1fr;
}

.control,
.launcher,
.toggle {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.control__top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.95rem;
}

.control output {
  color: var(--cyan);
  font-family: "Cascadia Code", "Consolas", monospace;
}

input[type="range"] {
  width: 100%;
  appearance: none;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(126, 198, 255, 0.8), rgba(255, 152, 89, 0.9));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: #09111d;
  box-shadow: 0 0 0 6px rgba(255, 152, 89, 0.18);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: #09111d;
  box-shadow: 0 0 0 6px rgba(255, 152, 89, 0.18);
  cursor: pointer;
}

.chipRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.chip:hover {
  transform: translateY(-1px);
}

.chip.is-active {
  background: linear-gradient(90deg, rgba(126, 198, 255, 0.18), rgba(255, 152, 89, 0.22));
  border-color: rgba(255, 152, 89, 0.38);
  color: #fff5eb;
}

.toggle {
  position: relative;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle__track {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.toggle__track::after {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  margin: 4px;
  border-radius: 50%;
  background: #edf4ff;
  transition: transform 180ms ease;
}

.toggle__copy {
  display: grid;
  gap: 4px;
}

.toggle strong {
  font-size: 0.96rem;
}

.toggle small {
  color: var(--muted);
  line-height: 1.45;
}

.toggle input:checked + .toggle__track {
  background: linear-gradient(90deg, rgba(126, 198, 255, 0.92), rgba(255, 152, 89, 0.92));
  box-shadow: 0 0 24px rgba(255, 152, 89, 0.2);
}

.toggle input:checked + .toggle__track::after {
  transform: translateX(22px);
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(90deg, rgba(126, 198, 255, 0.94), rgba(255, 152, 89, 0.98));
  color: #04070d;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  box-shadow: 0 12px 30px rgba(255, 152, 89, 0.18);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(255, 152, 89, 0.24);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.button--ghost:hover {
  box-shadow: none;
}

.button--small {
  padding: 10px 14px;
  font-size: 0.88rem;
}

.button--active {
  box-shadow: 0 0 0 1px rgba(255, 152, 89, 0.35), 0 12px 30px rgba(255, 152, 89, 0.24);
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .hud {
    position: relative;
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .hero {
    max-width: none;
  }

  .panel {
    max-height: none;
    margin-bottom: 24px;
  }

  #scene,
  #objectLayer,
  .backdrop {
    position: absolute;
  }
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 2.75rem;
  }

  .panel__header,
  .actions,
  .launcher__header,
  .launcher__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chipRow {
    gap: 8px;
  }
}
