:root {
  color-scheme: dark;
  --bg: #080d15;
  --panel: #0e1621;
  --line: #243142;
  --muted: #9aaac0;
  --text: #e8eef6;
  --cyan: #88dbe9;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px/1.6 system-ui,
    sans-serif;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.13em;
}
header a {
  text-decoration: none;
  color: var(--text);
}
header a span {
  color: var(--muted);
  margin-left: 14px;
}
.badge {
  color: var(--cyan);
}
main {
  max-width: 1350px;
  padding: 28px;
  margin: auto;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 24px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--cyan);
  margin: 0 0 12px;
}
h1 {
  font:
    400 clamp(28px, 4vw, 48px) / 1.1 Georgia,
    serif;
  letter-spacing: -0.03em;
  margin: 0;
}
h2 {
  font-weight: 400;
  font-size: 23px;
  line-height: 1.25;
  margin: 8px 0 12px;
}
.intro > p,
.caption,
.hint,
.bottom p,
footer {
  color: var(--muted);
}
.intro > p {
  font-size: 12px;
  margin: 0;
}
.lab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.view {
  min-width: 0;
  padding: 24px;
  background: #070c14;
}
.view-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.view-heading h2 {
  font:
    32px Georgia,
    serif;
  margin: 5px 0 0;
}
#slice-label {
  font-size: 11px;
  color: var(--muted);
}
.canvas-wrap {
  position: relative;
  max-width: 620px;
  margin: 8px auto 0;
  aspect-ratio: 1;
}
#field {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}
.axis {
  position: absolute;
  color: #899aae;
  font: 10px monospace;
  pointer-events: none;
}
.vertical {
  top: 9px;
  left: 52%;
}
.horizontal {
  right: 7px;
  top: 52%;
}
#empty {
  position: absolute;
  top: 42%;
  left: 10%;
  right: 10%;
  text-align: center;
  color: var(--muted);
  background: #070c14cc;
  padding: 14px;
}
.legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  color: #c1cddc;
  flex-wrap: wrap;
}
.legend > span:first-child {
  width: 86px;
  height: 5px;
  border-radius: 5px;
}
.phase-gradient {
  background: linear-gradient(
    90deg,
    #f66f68,
    #a380d3,
    #50dbe8,
    #a3c97d,
    #f66f68
  );
}
.density-gradient {
  background: linear-gradient(90deg, #070c14, #77dcf4);
}
.readout {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font: 10px/1.5 monospace;
  color: var(--muted);
  margin: 14px 0;
}
.caption {
  font-size: 11px;
  max-width: 600px;
  margin: 14px auto 0;
}
#render-status {
  font-size: 10px;
  color: var(--muted);
  margin: 8px 0 0;
}
.controls {
  padding: 24px;
  border-left: 1px solid var(--line);
}
button,
select,
input {
  font: inherit;
  color: inherit;
}
button,
select {
  background: #101c2a;
  border: 1px solid #33435a;
  border-radius: 4px;
}
button {
  cursor: pointer;
  min-height: 40px;
}
button:hover {
  border-color: var(--cyan);
}
button[aria-pressed="true"] {
  border-color: var(--cyan);
  background: #15303b;
  color: #bdf2f4;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid #efbd80;
  outline-offset: 4px;
}
.presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.presets button {
  text-align: left;
  padding: 9px 12px;
  font-size: 17px;
}
.presets small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.quantum-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.quantum-numbers label {
  font-size: 10px;
  color: var(--muted);
}
select {
  display: block;
  min-height: 40px;
  padding: 6px;
  width: 100%;
  margin-top: 6px;
}
.hint {
  font-size: 10px;
  margin: 10px 0 0;
}
.divider {
  border-top: 1px solid var(--line);
  margin: 22px 0;
}
.segments {
  display: flex;
  gap: 6px;
}
.segments button {
  font-size: 11px;
  padding: 8px;
  flex: 1;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-top: 15px;
}
.row select {
  width: 135px;
  margin: 0;
}
.slider-label {
  display: flex;
  justify-content: space-between;
  margin: 18px 0 6px;
  font-size: 11px;
}
output {
  color: var(--cyan);
  font-family: monospace;
}
input[type="range"] {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: var(--cyan);
  cursor: pointer;
}
.reset {
  font-size: 11px;
  width: 100%;
  margin-top: 14px;
  background: transparent;
}
dl {
  font-size: 12px;
  margin: 0;
}
dl div {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  font-family: monospace;
}
.bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}
.bottom p {
  font-size: 12px;
  max-width: 410px;
}
.bottom .eyebrow {
  font-size: 10px;
  color: var(--cyan);
}
.radial {
  min-width: 0;
}
#radial {
  width: 100%;
  height: 150px;
  display: block;
}
.radial .readout {
  margin: 0;
}
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 10px;
  padding-top: 14px;
}
footer a {
  color: var(--cyan);
  white-space: nowrap;
}
@media (max-width: 760px) {
  header {
    padding: 16px;
  }
  header a span {
    display: none;
  }
  main {
    padding: 18px 12px;
  }
  .intro {
    display: block;
  }
  .intro > p {
    margin-top: 12px;
  }
  .lab {
    grid-template-columns: 1fr;
  }
  .view {
    padding: 18px 12px;
  }
  .controls {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px;
  }
  .bottom {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 26px 8px;
  }
  .bottom h2 {
    font-size: 22px;
  }
  .view-heading h2 {
    font-size: 26px;
  }
  #slice-label {
    font-size: 10px;
  }
  .quantum-numbers {
    margin-top: 14px;
  }
  .controls .divider {
    margin: 18px 0;
  }
  .readout {
    flex-wrap: wrap;
  }
  footer {
    align-items: flex-start;
    padding: 14px 8px;
  }
  .canvas-wrap {
    max-width: 460px;
  }
}
