* {
  box-sizing: border-box;
}
:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #10191e;
  color: #e7efed;
}
body {
  margin: 0;
}
main {
  max-width: 1260px;
  margin: auto;
  padding: 28px;
}
a {
  color: #9ce8d1;
}
nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
header {
  max-width: 850px;
  margin: 52px 0 28px;
}
h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.08;
  font-weight: 650;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 1.3rem;
}
p {
  line-height: 1.6;
  color: #bdcece;
}
.intro {
  font-size: 1.15rem;
}
.eyebrow {
  color: #91d4bc;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
}
.notice,
.controls,
.panels section {
  border: 1px solid #38504e;
  border-radius: 14px;
  padding: 24px;
}
.notice {
  border-left: 4px solid #e8bd75;
}
.controls {
  margin: 24px 0;
  background: #18272b;
}
.fields,
.panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
label {
  display: block;
}
output,
.channel span {
  float: right;
  color: #9ce8d1;
}
input {
  display: block;
  width: 100%;
  min-height: 44px;
  accent-color: #9ce8d1;
}
button {
  font: inherit;
  border: 1px solid #9ce8d1;
  border-radius: 8px;
  min-height: 44px;
  padding: 8px 18px;
  background: #233d3b;
  color: #fff;
  cursor: pointer;
  margin: 4px 8px 4px 0;
}
:focus-visible {
  outline: 3px solid #e8bd75;
  outline-offset: 4px;
}
#motion-status {
  display: inline-block;
  margin: 8px;
}
.panels section {
  background: #152126;
}
svg {
  width: 100%;
  height: auto;
}
svg line {
  stroke-width: 14;
  stroke-linecap: round;
}
.femur {
  stroke: #88afc5;
}
.tibia {
  stroke: #9ce8d1;
}
svg circle {
  fill: #e8bd75;
}
svg text {
  fill: #bdcece;
  font-size: 14px;
}
dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.channel {
  margin: 22px 0;
}
meter {
  display: block;
  width: 100%;
  height: 18px;
}
.badge {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #e8bd75;
  border-radius: 6px;
  color: #f3d5a3;
  font-family: monospace;
}
footer {
  margin: 44px 0;
  max-width: 900px;
}
@media (max-width: 850px) {
  .panels,
  .fields {
    grid-template-columns: 1fr;
  }
  main {
    padding: 18px;
  }
  header {
    margin-top: 36px;
  }
  .panels section,
  .controls {
    padding: 20px;
  }
  svg {
    max-height: 250px;
  }
}

.control-baseline {
  display: flex;
  align-items: center;
  gap: 12px;
}
.control-baseline input {
  width: 20px;
  flex: 0 0 20px;
}

.scene-section {
  margin: 32px 0;
  border: 1px solid #38504e;
  border-radius: 18px;
  overflow: hidden;
  background: #152126;
}
.scene-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 26px;
}
.scene-heading h2 {
  margin: 4px 0;
}
.scene-heading .eyebrow {
  margin: 0;
}
select {
  display: block;
  width: 100%;
  font: inherit;
  padding: 10px;
  min-height: 44px;
  color: #e7efed;
  background: #1c3034;
  border: 1px solid #6d9290;
  border-radius: 7px;
}
.mode-picker {
  min-width: 160px;
}
.mode-picker select {
  margin-top: 5px;
}
.scene-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  border-top: 1px solid #38504e;
  border-bottom: 1px solid #38504e;
}
.scene-stage {
  position: relative;
  min-height: 460px;
  background: #0d161d;
  overflow: hidden;
}
#body-scene {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 460px;
}
#body-scene[hidden],
#scene-fallback[hidden] {
  display: none;
}
.scene-overlay {
  position: absolute;
  inset: 20px 24px auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.7rem;
  color: #d5e5e6;
  letter-spacing: 0.1em;
  pointer-events: none;
  text-shadow: 0 1px 4px #000;
}
#scene-angle {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}
.scene-fallback {
  padding: 35px 20px 15px;
}
.scene-fallback svg {
  max-height: 360px;
}
.scene-fallback p {
  text-align: center;
  font-size: 0.85rem;
}
.floor-guide {
  fill: none;
  stroke: #38504e;
  stroke-width: 2;
}
.appearance-controls {
  padding: 22px;
  background: #1a2b30;
  border-left: 1px solid #38504e;
}
.appearance-controls label {
  margin-bottom: 12px;
  font-size: 0.85rem;
}
.appearance-controls .eyebrow {
  line-height: 1.5;
  font-size: 0.65rem;
  margin-top: 0;
}
.appearance-controls select {
  margin-top: 8px;
}
.appearance-controls button {
  width: 100%;
  font-size: 0.85rem;
  margin-top: 18px;
}
#scene-status,
.scene-legend,
.scene-caption {
  margin: 16px 26px;
  font-size: 0.85rem;
}
#scene-status {
  color: #9ce8d1;
}
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ce8d1;
  margin-right: 8px;
}
@media (max-width: 850px) {
  .scene-layout {
    grid-template-columns: 1fr;
  }
  .scene-stage,
  #body-scene {
    min-height: 330px;
  }
  .scene-heading {
    align-items: start;
    padding: 18px;
    gap: 12px;
  }
  .scene-heading h2 {
    font-size: 1.1rem;
  }
  .mode-picker {
    min-width: 120px;
    font-size: 0.8rem;
  }
  .appearance-controls {
    border-left: 0;
    border-top: 1px solid #38504e;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    padding: 18px;
  }
  .appearance-controls .eyebrow {
    grid-column: 1 / -1;
  }
  .appearance-controls label {
    min-width: 0;
  }
  .appearance-controls button {
    margin: 22px 0 0;
    align-self: start;
  }
  #scene-status,
  .scene-legend,
  .scene-caption {
    margin: 16px 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
