@import url("/fonts/source-han-serif-sc/fonts.css");

:root {
  color-scheme: dark;
  font-family: "Source Han Serif SC", serif;
  background: #020308;
  color: #f4f4ef;
  font-synthesis: none;
  --panel: rgba(8, 11, 18, 0.72);
  --border: rgba(255, 255, 255, 0.13);
  --muted: rgba(244, 244, 239, 0.56);
  --warm: #ffd33d;
  --cyan: #79d7e4;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(22, 31, 53, 0.42), transparent 38%),
    #020308;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.vignette {
  background: radial-gradient(circle at center, transparent 45%, rgba(0, 0, 0, 0.62) 112%);
}

.hero,
.control-panel,
.telemetry,
.hint-bar,
.body-labels {
  position: fixed;
  z-index: 4;
}

.hero {
  top: 32px;
  left: 40px;
  max-width: min(560px, calc(100vw - 80px));
}

.experience-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.experience-nav a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  transition: color 0.2s ease;
}

.experience-nav a:hover {
  color: var(--warm);
}

.eyebrow,
.panel-kicker,
.telemetry-head span {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.56);
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warm);
  box-shadow: 0 0 16px var(--warm);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.4;
    transform: scale(0.75);
  }
}

.hero h1 {
  margin: 0;
  font-family: "Source Han Serif SC", serif;
  font-size: clamp(34px, 4vw, 64px);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 1;
}

.hero p {
  max-width: 520px;
  margin: 15px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-family: "Source Han Serif SC", serif;
  font-size: 13px;
  line-height: 1.8;
}

.control-panel {
  left: 40px;
  bottom: 50px;
  width: 330px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px) saturate(120%);
  transition: width 0.3s ease, padding 0.3s ease;
}

.control-panel.collapsed {
  width: 208px;
  padding-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-head h2 {
  margin: 4px 0 0;
  font-family: "Source Han Serif SC", serif;
  font-size: 19px;
  font-weight: 500;
}

.icon-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.panel-content {
  display: grid;
  gap: 14px;
  max-height: min(700px, calc(100vh - 150px));
  margin-top: 18px;
  opacity: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 3px;
  transition: max-height 0.32s ease, opacity 0.22s ease, margin 0.32s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.panel-content::-webkit-scrollbar {
  width: 4px;
}

.panel-content::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.collapsed .panel-content {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.preset {
  min-width: 0;
  min-height: 98px;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.preset:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
}

.preset.active {
  border-color: rgba(255, 211, 61, 0.5);
  background: rgba(255, 211, 61, 0.08);
}

.preset span,
.preset strong,
.preset small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset span {
  margin-bottom: 13px;
  color: var(--warm);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.preset strong {
  font-family: "Source Han Serif SC", serif;
  font-size: 12px;
  font-weight: 500;
}

.preset small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.38);
  font-family: "Source Han Serif SC", serif;
  font-size: 9px;
}

.preset-description {
  min-height: 38px;
  margin: -2px 0 0;
  padding: 9px 11px;
  border-left: 2px solid rgba(255, 211, 61, 0.42);
  background: rgba(255, 211, 61, 0.035);
  color: rgba(255, 255, 255, 0.48);
  font-family: "Source Han Serif SC", serif;
  font-size: 9px;
  line-height: 1.65;
}

.control-row {
  padding-top: 2px;
}

.range-row > div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  font-family: "Source Han Serif SC", serif;
  font-size: 11px;
  color: var(--muted);
}

.range-row input {
  width: 100%;
  height: 2px;
  appearance: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.range-row input::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  appearance: none;
  border: 3px solid #111722;
  border-radius: 50%;
  background: var(--warm);
  box-shadow: 0 0 0 1px rgba(255, 211, 61, 0.5);
}

.switch-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.switch-row label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.58);
  font-family: "Source Han Serif SC", serif;
  font-size: 10px;
  cursor: pointer;
}

.switch-row input {
  position: absolute;
  opacity: 0;
}

.switch {
  position: relative;
  width: 26px;
  height: 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  transition: transform 0.2s ease, background 0.2s ease;
}

input:checked + .switch {
  background: rgba(255, 211, 61, 0.34);
}

input:checked + .switch::after {
  background: var(--warm);
  transform: translateX(11px);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 8px;
}

.primary-action,
.secondary-action {
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
}

.primary-action {
  border: 1px solid rgba(255, 211, 61, 0.72);
  background: var(--warm);
  color: #14130c;
  font-family: "Source Han Serif SC", serif;
  font-weight: 600;
}

.secondary-action {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-family: "Source Han Serif SC", serif;
}

.formula {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border-left: 2px solid rgba(121, 215, 228, 0.65);
  background: rgba(121, 215, 228, 0.045);
}

.formula span,
.formula small {
  color: rgba(255, 255, 255, 0.4);
  font-size: 9px;
}

.formula strong {
  color: #b9edf2;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.telemetry {
  right: 40px;
  top: 34px;
  width: 310px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(7, 10, 16, 0.58);
  backdrop-filter: blur(16px);
}

.telemetry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.telemetry-head strong {
  color: var(--warm);
  font-family: "Source Han Serif SC", serif;
  font-size: 11px;
  font-weight: 500;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 13px;
}

.metric {
  min-width: 0;
}

.metric span,
.metric strong,
.metric small {
  display: block;
}

.metric span,
.metric small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.36);
  font-family: "Source Han Serif SC", serif;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric strong {
  margin: 5px 0 3px;
  font-size: 16px;
  font-weight: 500;
}

.body-labels {
  inset: 0;
  pointer-events: none;
}

.body-label {
  position: absolute;
  min-width: 94px;
  transform: translate(14px, -50%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.body-label.visible {
  opacity: 1;
}

.body-label::before {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(100% + 7px);
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.52));
}

.body-label strong,
.body-label span {
  display: block;
}

.body-label strong {
  font-family: "Source Han Serif SC", serif;
  font-size: 10px;
  font-weight: 500;
}

.body-label span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.hint-bar {
  right: 40px;
  bottom: 28px;
  display: flex;
  gap: 22px;
  color: rgba(255, 255, 255, 0.32);
  font-family: "Source Han Serif SC", serif;
  font-size: 9px;
  letter-spacing: 0.04em;
}

@media (max-width: 900px) {
  .hero {
    top: 24px;
    left: 22px;
  }

  .experience-nav {
    margin-bottom: 14px;
  }

  .hero p {
    display: none;
  }

  .telemetry {
    top: auto;
    right: 18px;
    bottom: 20px;
    width: 286px;
  }

  .control-panel {
    left: 18px;
    bottom: 20px;
  }

  .hint-bar {
    display: none;
  }
}

@media (max-width: 680px) {
  .hero {
    max-width: calc(100vw - 44px);
  }

  .hero h1 {
    font-size: 34px;
  }

  .control-panel {
    right: 18px;
    width: auto;
    max-width: none;
    padding: 16px;
  }

  .control-panel:not(.collapsed) + .telemetry,
  .telemetry {
    display: none;
  }

  .preset {
    min-height: 82px;
  }

  .preset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .preset small {
    display: none;
  }

  .preset-description {
    min-height: 0;
    font-size: 8px;
  }

  .panel-content {
    max-height: calc(100vh - 145px);
  }

  .body-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
