@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");
.controls section > * {
  min-width: 0;
}
.button-row button {
  min-width: 0;
  flex: 1;
}
.controls select {
  min-width: 0;
  max-width: 100%;
}
#elementPicker:not([hidden]) {
  position: fixed;
  z-index: 20;
  left: 50%;
  top: 20vh;
  transform: translateX(-50%);
  width: min(850px, 96vw);
  padding: 18px;
  grid-template-columns: repeat(18, minmax(0, 1fr));
  background: #152633;
  border: 1px solid #6b8a96;
  border-radius: 12px;
  box-shadow: 0 18px 80px #000b;
}
#elementPicker:not([hidden]) button {
  font-size: clamp(8px, 1.1vw, 13px);
  min-height: 26px;
}
:root {
  color-scheme: dark;
  --bg: #0c151d;
  --panel: #111f2a;
  --line: #2b3b46;
  --muted: #a0b2bc;
  --ink: #e8f0f3;
  --mint: #91e4ca;
  --orange: #f1b482;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px "DM Sans",
    sans-serif;
}
button,
select,
input {
  font: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button,
select {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #1b2a36;
  color: var(--ink);
  padding: 10px 12px;
}
button {
  cursor: pointer;
}
button:hover {
  background: #2a4150;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
a {
  color: var(--mint);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.masthead {
  height: 82px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
}
.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  color: var(--ink);
  font:
    700 18px Manrope,
    sans-serif;
}
.brand:hover {
  text-decoration: none;
}
.brand-icon {
  font-size: 40px;
  color: var(--mint);
}
.brand small {
  display: block;
  font: 9px "DM Sans";
  letter-spacing: 1.7px;
  color: var(--muted);
  margin-top: 5px;
}
.header-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 12px;
}
.header-links button {
  font-size: 12px;
}
main {
  max-width: 1480px;
  margin: auto;
  padding: 35px 4vw;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 60px;
  margin: 12px 0 36px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--mint);
}
h1 {
  font:
    600 clamp(30px, 3.5vw, 49px) / 1.15 Manrope,
    sans-serif;
  letter-spacing: -1.8px;
  margin: 15px 0;
}
h1 em {
  font-style: normal;
  color: var(--mint);
}
p {
  color: var(--muted);
  line-height: 1.65;
}
h2 {
  font:
    600 21px Manrope,
    sans-serif;
  letter-spacing: -0.5px;
  margin: 10px 0 15px;
}
.specimen {
  width: 310px;
  border-left: 1px solid var(--line);
  padding-left: 30px;
}
.specimen h2 {
  font-size: 28px;
  margin: 9px 0;
}
.specimen p {
  font-size: 12px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 12px;
  margin: 0 5px 5px 0;
}
.chip i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.stages button {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #101c26;
  display: flex;
  text-align: left;
  gap: 13px;
  align-items: center;
  padding: 20px;
}
.stages button:last-child {
  border: 0;
}
.stages button > span {
  color: #718995;
  font: 500 21px Manrope;
}
.stages strong {
  display: block;
  font-size: 13px;
}
.stages small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.stages button[aria-current="step"] {
  background: #213c3d;
  box-shadow: inset 0 -3px var(--mint);
}
.stages button[aria-current="step"] > span {
  color: var(--mint);
}
.workbench {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  background: var(--panel);
}
.controls {
  padding: 26px 22px;
  border-right: 1px solid var(--line);
}
label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin: 17px 0;
}
label select {
  display: block;
  width: 100%;
  margin-top: 8px;
  color: var(--ink);
  font-size: 12px;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
}
.check input {
  accent-color: var(--mint);
}
.hint,
details p {
  font-size: 12px;
}
.primary {
  background: var(--mint);
  color: #102c29;
  border-color: var(--mint);
  font-weight: 700;
}
.primary:hover {
  background: #b4f5df;
}
.controls button {
  width: 100%;
  margin: 5px 0;
}
.secondary {
  background: transparent;
}
.button-row {
  display: flex;
  gap: 8px;
}
details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--ink);
}
input[type="file"] {
  max-width: 100%;
  font-size: 11px;
  margin-top: 12px;
}
.scene-area {
  min-width: 0;
}
.scene-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px 0;
}
.scene-heading h2 {
  margin-bottom: 0;
}
.scene-heading label {
  margin: 0;
}
#viewport {
  position: relative;
  height: 470px;
  background: radial-gradient(ellipse at 50% 45%, #1e3340 0%, #111f2a 70%);
  overflow: hidden;
}
#scene {
  display: block;
  width: 100%;
  height: 100%;
}
.scene-key {
  position: absolute;
  bottom: 16px;
  left: 22px;
  right: 22px;
  display: flex;
  gap: 20px;
  font-size: 10px;
  color: var(--muted);
  pointer-events: none;
}
.scene-key span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.scene-key span:last-child {
  margin-left: auto;
}
.scene-key i {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: #b4c6d1;
}
.scene-key i.new {
  background: var(--orange);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  padding: 18px 25px;
  gap: 12px;
}
.metrics span {
  display: block;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
}
.metrics strong {
  display: block;
  font: 500 25px Manrope;
  margin-top: 5px;
}
.progress {
  height: 2px;
  background: var(--line);
}
#progressBar {
  width: 0;
  height: 100%;
  background: var(--mint);
  transition: width 0.2s;
}
#status {
  font-size: 12px;
  padding: 0 24px;
  min-height: 20px;
}
.lower {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 45px;
  margin: 32px 0;
}
.lower article {
  border-top: 1px solid var(--line);
  padding-top: 23px;
}
.lower p {
  font-size: 13px;
}
#events {
  padding: 0;
  list-style: none;
  max-height: 205px;
  overflow: auto;
}
#events li {
  padding: 7px 0;
  border-bottom: 1px solid #21313b;
  font: 12px/1.5 "DM Sans";
  color: var(--muted);
}
#events .accept {
  color: var(--mint);
}
#events .backtrack {
  color: var(--orange);
}
#curve {
  width: 100%;
  height: 100px;
  border-bottom: 1px solid var(--line);
  margin-top: 14px;
}
.mini-ledger {
  font: 12px/1.8 "DM Sans";
  color: var(--mint);
  margin: 12px 0;
}
#gallery {
  position: absolute;
  inset: 10px 18px 40px;
  overflow: auto;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: var(--panel);
}
#gallery:not([hidden]) {
  display: grid;
}
.cluster-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  min-height: 205px;
  background: #152633;
  position: relative;
}
.cluster-card canvas {
  width: 100%;
  height: 145px;
  display: block;
}
.cluster-card h3 {
  font-size: 12px;
  margin: 4px 12px;
}
.cluster-card p {
  font-size: 10px;
  margin: 3px 12px 10px;
}
.cluster-card .tag {
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: 9px;
  color: var(--mint);
}
dialog {
  max-width: 730px;
  max-height: 85vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid #49606c;
  border-radius: 15px;
  padding: 32px;
  color: var(--ink);
}
dialog::backdrop {
  background: #000a;
  backdrop-filter: blur(6px);
}
dialog h2 {
  font-size: 30px;
}
dialog dt {
  margin-top: 20px;
  font-weight: 700;
  color: var(--mint);
}
dialog dd {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.6;
}
.dialog-close {
  float: right;
}
#elementPicker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  padding: 8px 0;
}
#elementPicker[hidden] {
  display: none;
}
#elementPicker button {
  padding: 5px 1px;
  font-size: 11px;
  margin: 0;
}
#elementPicker button[aria-pressed="true"] {
  border-color: var(--mint);
  background: #284c47;
}
.element-solid {
  color: #a6b9cf;
}
.element-gas {
  color: #eabfa4;
}
.element-liquid {
  color: #8ccded;
}
@media (max-width: 1000px) {
  .header-links a {
    display: none;
  }
  .intro {
    gap: 20px;
  }
  .workbench {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .stages button {
    padding: 15px 10px;
    gap: 8px;
  }
  .stages small {
    font-size: 10px;
  }
}
@media (max-width: 700px) {
  main {
    padding: 20px 14px;
  }
  .masthead {
    height: 72px;
    padding: 0 16px;
  }
  .header-links button {
    max-width: 115px;
  }
  .brand {
    font-size: 14px;
  }
  .brand small {
    font-size: 7px;
  }
  .intro {
    align-items: start;
  }
  .specimen {
    width: 35%;
    padding-left: 14px;
  }
  .intro p {
    font-size: 12px;
  }
  h1 {
    font-size: 30px;
  }
  .stages button {
    display: block;
  }
  .stages button > span {
    font-size: 13px;
  }
  .stages strong {
    font-size: 11px;
    margin-top: 6px;
  }
  .stages small {
    display: none;
  }
  .workbench {
    display: flex;
    flex-direction: column;
  }
  .controls {
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 20px;
  }
  .controls section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 15px;
  }
  .controls section[hidden] {
    display: none;
  }
  .controls h2,
  .controls .eyebrow,
  .controls .hint,
  .controls details,
  .controls .mini-ledger {
    grid-column: 1/-1;
  }
  #viewport {
    height: 380px;
  }
  .scene-heading {
    padding: 18px;
  }
  .metrics {
    padding: 15px;
  }
  .metrics strong {
    font-size: 22px;
  }
  .metrics span {
    font-size: 8px;
  }
  .lower {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .scene-key {
    font-size: 9px;
    gap: 10px;
  }
  .scene-key span:last-child {
    display: none;
  }
  #curve {
    grid-column: 1/-1;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
