* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}
main {
  max-width: 1280px;
  margin: auto;
  padding: 28px 40px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 18px;
}
header > div {
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  font-family: var(--display);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -1.5px;
  text-decoration: none;
  color: inherit;
}
.brand span {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
}
.tag,
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
}
.tag {
  border: 1px solid var(--ink);
  padding: 6px 9px;
}
button,
select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid #a2afa9;
  border-radius: 5px;
  padding: 10px 13px;
  min-height: 42px;
}
button {
  cursor: pointer;
  font-weight: 700;
}
button:hover {
  background: #e3e9df;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #cb653e;
  outline-offset: 3px;
}
.intro {
  padding: 28px 0;
}
.eyebrow {
  color: var(--accent);
  margin: 0 0 14px;
}
h1 {
  font: 700 clamp(32px, 4vw, 50px) / 1.1 var(--display);
  letter-spacing: -1.7px;
  margin: 0 0 12px;
}
.intro > p:last-child {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 22px;
}
.experiment {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--surface);
  background-image:
    linear-gradient(#a5b5aa19 1px, transparent 1px),
    linear-gradient(90deg, #a5b5aa19 1px, transparent 1px);
  background-size: 22px 22px;
}
.stage-top,
.diagram-footer,
.transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
}
.stage-top label,
.diagram-footer label {
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.stage-top select {
  font-size: 13px;
  max-width: 195px;
}
.live {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: bold;
  text-align: right;
}
svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 500px;
}
.diagram-footer {
  padding-top: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
.diagram-footer select {
  padding: 6px 10px;
}
.force-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding: 5px 12px 12px;
  font-size: 12px;
  font-weight: bold;
}
.transport {
  justify-content: flex-start;
  border-top: 1px solid var(--line);
}
.transport #time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
  min-width: 100px;
}
.primary:hover {
  background: #275364;
}
.readouts {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface2);
}
.readouts > div {
  padding: 18px 12px;
  border-right: 1px solid var(--line);
}
.readouts small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.readouts strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.card {
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 9px;
  background: var(--surface);
  margin-bottom: 16px;
}
.slider {
  display: block;
  margin: 22px 0;
}
.slider > span {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  font-size: 13px;
  margin-bottom: 12px;
}
.slider output {
  font-weight: bold;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  min-height: 22px;
  margin: 0;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.hint {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 0;
}
.prediction {
  background: var(--surface2);
}
.prediction label {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}
.prediction select {
  width: 100%;
  font-size: 13px;
  margin: 15px 0 10px;
  background: #fafcf7;
}
.prediction button {
  width: 100%;
}
#answer {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 0;
}
.why {
  margin-top: 26px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.why summary {
  cursor: pointer;
  font-weight: 700;
}
.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.why h2 {
  font-size: 18px;
}
.why p {
  font-size: 14px;
  line-height: 1.7;
}
.sources a {
  color: var(--accent);
}
footer {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 26px 0;
}
[hidden] {
  display: none !important;
}
@media (max-width: 800px) {
  main {
    padding: 20px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }
  .card {
    padding: 18px;
  }
  .why-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  main {
    padding: 16px 10px;
  }
  header > div {
    gap: 8px;
  }
  .intro {
    padding: 24px 6px;
  }
  h1 {
    letter-spacing: -1px;
  }
  .workspace {
    gap: 15px;
  }
  aside {
    display: block;
  }
  .stage-top,
  .diagram-footer,
  .transport {
    padding: 13px 10px;
  }
  .stage-top label {
    gap: 5px;
  }
  .stage-top select {
    max-width: 165px;
  }
  .live {
    font-size: 9px;
  }
  .diagram-footer {
    align-items: flex-start;
  }
  .diagram-footer label {
    flex-shrink: 0;
    font-size: 10px;
  }
  .readouts strong {
    font-size: 16px;
  }
  .readouts > div {
    padding: 16px 8px;
  }
  .force-key {
    gap: 9px;
    font-size: 11px;
  }
  svg text {
    font-weight: 600;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
@media (max-width: 480px) {
  svg {
    max-height: none;
  }
  .stage-top select {
    max-width: 176px;
  }
}

body {
  background: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--chem);
  text-underline-offset: 3px;
  font-size: 14px;
}
.primary {
  background: var(--chem);
  border-color: var(--chem);
}
.primary:hover {
  background: var(--deep);
}
.eyebrow {
  font-family: var(--sans);
  letter-spacing: 0;
  color: var(--muted);
}
button,
select,
input[type="range"],
summary {
  min-height: 44px;
}
.check {
  min-height: 44px;
}
button:disabled {
  cursor: default;
  opacity: 0.6;
}
#equationImage {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: none;
}
#scene {
  max-height: none;
}
.readouts > div {
  min-width: 0;
}
.readouts strong {
  overflow-wrap: anywhere;
}
.why summary {
  display: flex;
  align-items: center;
}
.why p {
  max-width: 72ch;
}
.experiment,
.card {
  border-radius: 6px;
}
footer {
  font: 13px/1.6 var(--sans);
  letter-spacing: 0;
}
.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sources a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
svg text {
  font-family: var(--sans);
}
@media (max-width: 599px) {
  main {
    padding: 16px;
  }
  .stage-top {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .stage-top label {
    display: grid;
    grid-template-columns: 1fr;
    min-width: 0;
    flex: 1;
  }
  .stage-top select {
    max-width: 100%;
    width: 100%;
    font-size: 14px;
  }
  .live {
    max-width: 90px;
    line-height: 1.5;
    padding-top: 6px;
  }
  .readouts {
    grid-template-columns: 1fr;
  }
  .readouts > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px;
  }
  .readouts small {
    margin: 0;
    font-size: 13px;
  }
  .readouts strong {
    font-size: 18px;
  }
  .diagram-footer {
    flex-wrap: wrap;
  }
  .diagram-footer label {
    font-size: 13px;
  }
  .force-key {
    font-size: 13px;
  }
  .slider > span {
    font-size: 14px;
  }
  .hint {
    font-size: 13px;
  }
  .intro h1 {
    font-size: 36px;
  }
}
