@font-face {
  font-family: Plex;
  src: url(/assets/plex.ttf) format("truetype");
  font-display: swap;
  font-weight: 600;
}
:root {
  color-scheme: light;
  --paper: #f8f7f2;
  --panel: #fffefa;
  --ink: #15253a;
  --soft: #526273;
  --rule: #c7cbd0;
  --tint: #e9ecec;
  --accent: #a64020;
  --navy: #142438;
  --code: #fffefa;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #131e2b;
  --panel: #1c2a3a;
  --ink: #f6f4ea;
  --soft: #c9d4dd;
  --rule: #495a69;
  --tint: #26374a;
  --accent: #ffa783;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    16px/1.5 Arial,
    sans-serif;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
select {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 7px 10px;
  font: inherit;
  cursor: pointer;
}
button:hover,
a:hover {
  color: var(--accent);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #e97445;
  outline-offset: 3px;
}
header {
  background: var(--navy);
  color: #fffefa;
  border-bottom: 3px solid #ae472b;
}
header nav,
main,
footer {
  width: min(1320px, calc(100% - clamp(28px, 8vw, 108px)));
  margin: auto;
}
header nav {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 38px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font:
    600 27px/1 Plex,
    Arial;
  letter-spacing: -1.5px;
  text-decoration: none;
}
.brand img {
  width: 30px;
  height: 30px;
}
.navlinks {
  display: flex;
  gap: 21px;
}
.navlinks a {
  font-size: 14px;
  text-decoration: none;
  padding: 10px 0;
}
.navlinks a:hover,
.brand:hover {
  color: #ffc2a4;
}
#theme {
  margin-left: auto;
  background: transparent;
  color: #fff;
  border: 1px solid #697786;
  font-size: 19px;
  min-width: 38px;
}
.crumb {
  font:
    13px ui-monospace,
    monospace;
  margin: 23px 0 12px;
  color: var(--soft);
}
.crumb a {
  text-decoration: none;
}
.crumb a:hover {
  text-decoration: underline;
}
h1 {
  margin: 0;
  font:
    500 clamp(34px, 3.5vw, 51px)/1.06 Georgia,
    serif;
  letter-spacing: -0.045em;
}
.lead {
  font-size: 17px;
  color: var(--soft);
  margin: 9px 0 22px;
  max-width: 75ch;
}
.tooltabs {
  display: flex;
  background: var(--navy);
  color: #d2dce4;
  border: 1px solid #263b51;
  padding: 0 4px;
  flex-wrap: wrap;
}
.tooltabs a {
  font:
    600 14px Plex,
    Arial;
  padding: 12px 15px 10px;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.tooltabs a:hover {
  color: #fff;
  background: #21364a;
}
.tooltabs [aria-current] {
  color: #fff;
  border-bottom-color: #ed8055;
  background: #2e4154;
}
.controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 15px;
  border: 1px solid var(--rule);
  border-bottom: 0;
  background: var(--tint);
}
.controls label {
  font:
    12px/1.5 ui-monospace,
    monospace;
  color: var(--soft);
  display: grid;
  gap: 2px;
}
.controls select,
.controls button {
  font:
    14px Arial,
    sans-serif;
  min-height: 37px;
}
.controls .action {
  background: #ac4322;
  color: white;
  border-color: #ac4322;
  margin-left: auto;
  font-weight: 600;
}
.action:hover,
#execute:hover {
  background: #893319;
}
.bench {
  display: grid;
  grid-template-columns: minmax(0, var(--split, 47%)) minmax(0, 1fr);
  border: 1px solid var(--rule);
  background: var(--panel);
}
.bench section {
  min-width: 0;
}
.bench section + section {
  border-left: 1px solid var(--rule);
}
.panel {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}
.panel h2 {
  font:
    600 14px/1.45 Plex,
    Arial;
  margin: 0;
}
.codeicon {
  font:
    13px ui-monospace,
    monospace;
  color: var(--accent);
  margin-right: 5px;
}
.panel button {
  font:
    12px/1.4 ui-monospace,
    monospace;
  padding: 5px 8px;
}
.panel button + button {
  margin-left: 5px;
}
.workspace-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
#editor,
.cm-editor,
#out {
  height: clamp(350px, 45vh, 550px);
}
#editor {
  color: #19283a;
  background: var(--code);
  color-scheme: light;
}
.cm-content,
.cm-gutter {
  font:
    14px/1.65 ui-monospace,
    monospace;
}
.cm-scroller {
  overflow: auto;
}
.cm-editor .cm-gutters {
  background: #edf0f1;
  color: #536477;
  border-color: #d4dbe0;
}
#out {
  overflow: auto;
  padding: 18px;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  background-color: #f6f6ef;
  background-image: radial-gradient(#c7cdd0 0.8px, transparent 1px);
  background-size: 14px 14px;
  color: #21354a;
}
#out img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}
#out pre {
  margin: 0;
  align-self: flex-start;
  width: 100%;
  font:
    14px/1.6 ui-monospace,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#status {
  margin: 0 0 7px;
  padding: 6px 12px;
  min-height: 29px;
  font:
    12px/1.5 ui-monospace,
    monospace;
  color: #e0e7ec;
  background: #26394d;
  overflow-wrap: anywhere;
}
.diagram-source {
  margin: 10px 0 18px;
  font-size: 14px;
}
.diagram-source summary {
  cursor: pointer;
  width: fit-content;
}
.diagram-source pre {
  max-height: 280px;
  background: var(--panel);
  padding: 14px;
  overflow: auto;
}
.runtime {
  border: 1px solid var(--rule);
  margin: 15px 0;
  background: var(--panel);
}
.runtime .panel {
  background: var(--tint);
}
#execute {
  color: white;
  background: #ac4322;
  border-color: #ac4322;
}
.runtime pre {
  font:
    14px/1.6 ui-monospace,
    monospace;
  padding: 14px;
  margin: 0;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  background: #18293b;
  color: #e8eef2;
}
.runtime p {
  font-size: 14px;
  margin: 0;
  padding: 10px 14px;
  color: var(--soft);
}
.note {
  border-top: 1px solid var(--rule);
  margin: 22px 0 0;
  padding: 15px 0;
}
.note h2 {
  font:
    500 25px/1.25 Georgia,
    serif;
  margin: 13px 0 6px;
}
.note p {
  max-width: 76ch;
  color: var(--soft);
  margin: 6px 0;
}
.split-control {
  display: flex;
  align-items: center;
  gap: 12px;
  font:
    13px ui-monospace,
    monospace;
}
.split-control input {
  accent-color: #a84726;
}
.bench:fullscreen {
  background: var(--panel);
  height: 100vh;
}
.bench:fullscreen #editor,
.bench:fullscreen .cm-editor,
.bench:fullscreen #out {
  height: calc(100vh - 45px);
}
.toolgrid {
  margin-top: 25px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}
.toolcard {
  display: block;
  padding: 20px 0 22px;
  text-decoration: none;
  border-top: 1px solid var(--rule);
  position: relative;
}
.toolcard strong {
  font:
    500 28px/1.12 Georgia,
    serif;
  display: block;
  letter-spacing: -0.025em;
}
.toolcard p {
  margin: 8px 0 0;
  color: var(--soft);
  max-width: 56ch;
}
.toolcard span {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font:
    12px ui-monospace,
    monospace;
}
.toolcard:hover strong {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.toolcard:first-child {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.65fr);
  column-gap: 22px;
  background: var(--navy);
  color: #fbf7ee;
  padding: 23px 28px;
  margin-bottom: 18px;
}
.toolcard:first-child strong {
  font-size: 37px;
}
.toolcard:first-child p {
  color: #c8d6df;
}
.toolcard:first-child .try {
  color: #ffc1a4;
  text-decoration: underline;
  align-self: end;
  margin: 15px 0 0;
}
.toolcard:first-child img {
  grid-column: 2;
  grid-row: 1/4;
  width: 100%;
  height: 100%;
  max-height: 140px;
  align-self: center;
  background-color: #e8ece7;
  background-image: radial-gradient(#bec9c8 0.85px, transparent 1px);
  background-size: 12px 12px;
}
footer {
  border-top: 1px solid var(--rule);
  padding: 18px 0;
  margin-top: 35px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--soft);
  font-size: 14px;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 8px;
  top: 6px;
  background: var(--panel);
  padding: 8px;
  z-index: 10;
}
.render-frame {
  position: fixed;
  left: -3000px;
  top: 0;
  width: 900px;
  height: 700px;
  border: 0;
  pointer-events: none;
}
@media (max-width: 760px) {
  header nav {
    gap: 16px;
    flex-wrap: wrap;
    padding: 9px 0;
  }
  .navlinks {
    gap: 14px;
  }
  .brand {
    font-size: 23px;
  }
  .brand img {
    width: 25px;
    height: 25px;
  }
  .tooltabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0;
  }
  .tooltabs a {
    padding: 9px 8px;
    font-size: 13px;
  }
  .controls {
    gap: 8px;
    padding: 10px;
  }
  .controls .action {
    margin-left: 0;
  }
  .bench {
    grid-template-columns: 1fr;
  }
  .bench section + section {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
  #editor,
  .cm-editor {
    height: 295px;
  }
  #out {
    height: 305px;
  }
  .split-control {
    display: none;
  }
  .toolgrid {
    grid-template-columns: 1fr;
  }
  .toolcard:first-child {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .toolcard:first-child img {
    grid-column: 1;
    grid-row: auto;
    margin-top: 16px;
    height: 115px;
  }
  .crumb {
    margin-top: 16px;
  }
  .toolcard:first-child strong {
    font-size: 31px;
  }
}
@media (max-width: 540px) {
  .navlinks {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .navlinks a {
    padding: 6px 0;
  }
  .tooltabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .controls button,
  .controls select {
    min-height: 42px;
  }
  .toolcard {
    padding: 17px 0;
  }
  .panel {
    padding: 7px;
  }
  .lead {
    font-size: 16px;
    margin-bottom: 16px;
  }
}
.switch-tool {
  display: none;
}
@media (max-width: 540px) {
  .tooltabs.has-switch {
    display: block;
    padding: 6px 10px;
  }
  .tooltabs.has-switch > a {
    display: none;
  }
  .switch-tool {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font:
      13px ui-monospace,
      monospace;
  }
  .switch-tool select {
    min-height: 40px;
    background: #21364a;
    color: #fff;
    border-color: #66778a;
  }
}
