* {
  box-sizing: border-box;
}
svg {
  flex-shrink: 0;
  vertical-align: middle;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: default;
  opacity: 0.38;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
button {
  border: 0;
}
h1,
h2,
p {
  margin: 0;
}
button,
select,
input {
  border-radius: 0;
}
button,
.chip,
a {
  min-height: 44px;
}
button {
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.2s;
}
button:active:not(:disabled) {
  transform: translateY(2px);
}
[hidden] {
  display: none !important;
}
.shell {
  padding: 0 3.5vw 24px;
  max-width: 2100px;
  margin: auto;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  min-height: 76px;
  font-size: 10px;
}
.nav a {
  display: flex;
  align-items: center;
}
.nav span,
.eyebrow {
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.12em;
}
.nav span {
  color: var(--muted);
}
.heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 40px 0 34px;
}
.heading h1 {
  font-size: clamp(70px, 11vw, 175px);
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.085em;
}
.heading h1 sup {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0;
  vertical-align: top;
  margin: 12px 0 0 18px;
}
.intro {
  max-width: 290px;
}
.intro > .eyebrow {
  color: var(--muted);
  display: block;
  margin-bottom: 16px;
}
.intro p {
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -0.03em;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  border: 1px solid var(--line);
}
.viewport {
  position: relative;
  overflow: hidden;
  min-width: 0;
  height: auto;
  min-height: clamp(500px, 61vw, 750px);
  background: var(--stage);
  isolation: isolate;
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 0 100%);
}
.viewport:fullscreen {
  height: 100vh;
  width: 100vw;
}
.viewport canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline-offset: -5px;
  touch-action: none;
  cursor: crosshair;
}
.stage-top,
.stage-bottom {
  position: absolute;
  left: 25px;
  right: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  pointer-events: none;
  color: var(--stage-ink);
  z-index: 1;
  font-size: 9px;
}
.stage-top {
  top: 23px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.stage-bottom {
  bottom: 20px;
}
.stage-bottom p {
  max-width: 290px;
  font-size: 11px;
  line-height: 1.5;
}
.stage-bottom button {
  pointer-events: auto;
  min-width: 44px;
  background: transparent;
  border: 1px solid currentColor;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-right: 8px;
}
.stage-top > span:last-child {
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}
.controls {
  padding: 26px 24px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 25px;
  min-width: 0;
}
.control-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
.control-title > span:last-child {
  font-size: 22px;
  color: var(--accent);
}
fieldset {
  padding: 0;
  margin: 0;
  border: 0;
  min-width: 0;
}
legend,
.control-label {
  font-size: 10px;
  display: block;
  padding: 0;
  margin-bottom: 14px;
}
legend span,
.control-label > span {
  color: var(--muted);
  margin-right: 12px;
  font-size: 8px;
}
.options {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.options button {
  font-size: 10px;
  background: transparent;
  border: 1px solid var(--line);
  padding: 11px 12px;
  flex: 1;
  white-space: nowrap;
}
.options button[aria-pressed='true'] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.options button:hover:not([aria-pressed='true']) {
  border-color: var(--ink);
}
.sliders {
  display: grid;
  gap: 22px;
}
.sliders label > span {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  margin-bottom: 13px;
}
.sliders output {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
input[type='range'] {
  display: block;
  width: 100%;
  accent-color: var(--accent);
  height: 20px;
  cursor: pointer;
}
input[type='text'] {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
  background: none;
  color: var(--ink);
  font-size: 16px;
  outline-offset: 5px;
}
.micro {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  margin-top: 10px;
}
.actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
}
.actions button,
.actions a {
  padding: 15px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  min-height: 46px;
  background: transparent;
  border: 1px solid var(--line);
  text-align: left;
}
.actions .primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.actions button:hover:not(:disabled),
.actions a:hover {
  border-color: var(--ink);
}
.status-row {
  display: flex;
  gap: 30px;
  justify-content: space-between;
  padding: 18px 0 25px;
  border-bottom: 1px solid var(--line);
  min-height: 69px;
}
.status-row p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  max-width: 600px;
}
.status-row > span {
  font-size: 9px;
  white-space: nowrap;
  align-self: flex-start;
  border: 1px solid var(--line);
  padding: 5px 8px;
}
.notes {
  margin-top: 35px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}
.notes summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  min-height: 44px;
  list-style: none;
}
.notes summary::-webkit-details-marker {
  display: none;
}
.notes summary > span {
  color: var(--muted);
  font-size: 9px;
}
.notes-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8vw;
  padding-top: 30px;
  line-height: 1.7;
}
.notes h2 {
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.05em;
  margin: 10px 0 20px;
}
.notes p {
  color: var(--muted);
  font-size: 12px;
  max-width: 560px;
}
.notes pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  padding: 20px;
  font-size: 11px;
  color: var(--ink);
  line-height: 1.7;
  margin: 0 0 15px;
}
.source-link {
  display: inline-flex;
  align-items: center;
  gap: 25px;
  font-size: 11px;
  margin-top: 14px;
  text-decoration: underline;
  text-underline-offset: 6px;
}
.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 28px;
  font-size: 9px;
  color: var(--muted);
}
.footer a {
  display: flex;
  align-items: center;
}
.fallback {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--stage);
  color: var(--stage-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 35px;
  gap: 20px;
  text-align: center;
}
.fallback h2 {
  font-size: 32px;
  letter-spacing: -0.06em;
  font-weight: 400;
}
.fallback p {
  font-size: 13px;
  line-height: 1.7;
  max-width: 320px;
}
.fallback button {
  padding: 15px;
  background: var(--accent);
  color: var(--accent-ink);
}
.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px;
  z-index: 10;
  transform: translateY(-200%);
}
.skip:focus {
  transform: none;
}
@media (min-width: 1650px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
  .controls {
    padding: 32px;
    gap: 32px;
  }
}
@media (max-width: 1000px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .controls {
    padding: 23px 18px;
    gap: 22px;
  }
  .viewport {
    min-height: 650px;
  }
  .heading h1 {
    font-size: 13vw;
  }
  .intro {
    max-width: 250px;
  }
  .intro p {
    font-size: 15px;
  }
}
@media (max-width: 700px) {
  .shell {
    padding: 0 20px 20px;
  }
  .nav {
    min-height: 64px;
    font-size: 9px;
  }
  .nav > span {
    display: none;
  }
  .heading {
    padding: 32px 0 25px;
    align-items: flex-start;
    gap: 20px;
  }
  .heading h1 {
    font-size: clamp(64px, 16vw, 110px);
  }
  .heading h1 sup {
    font-size: 9px;
    margin: 5px 0 0 7px;
  }
  .intro {
    max-width: 145px;
  }
  .intro > .eyebrow {
    font-size: 7px;
    line-height: 1.5;
    margin-bottom: 10px;
  }
  .intro p {
    font-size: 12px;
    line-height: 1.45;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .viewport {
    height: min(125vw, 590px);
    min-height: 360px;
  }
  .controls {
    padding: 23px 20px;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 20px;
  }
  .control-title {
    grid-column: 1/-1;
    padding-bottom: 15px;
  }
  .controls fieldset {
    grid-column: 1/-1;
  }
  .controls .sliders {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .actions {
    grid-column: 1/-1;
    grid-template-columns: 1fr 1fr;
  }
  .actions .primary {
    grid-column: 1/-1;
  }
  .actions > [data-source],
  .actions > [data-reset] {
    grid-column: 1/-1;
  }
  .stage-top,
  .stage-bottom {
    left: 18px;
    right: 18px;
  }
  .stage-top {
    top: 18px;
    font-size: 7px;
  }
  .stage-bottom p {
    font-size: 9px;
    max-width: 220px;
  }
  .stage-bottom {
    bottom: 15px;
  }
  .status-row {
    gap: 12px;
  }
  .status-row > span {
    font-size: 7px;
  }
  .notes-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .notes summary {
    font-size: 12px;
  }
  .notes summary > span {
    font-size: 8px;
  }
  .footer {
    font-size: 8px;
    line-height: 1.6;
  }
  .footer > span {
    max-width: 130px;
  }
}
@media (max-width: 370px) {
  .shell {
    padding-left: 14px;
    padding-right: 14px;
  }
  .heading {
    display: block;
  }
  .intro {
    display: flex;
    max-width: none;
    gap: 25px;
    align-items: center;
    margin-top: 20px;
  }
  .intro > .eyebrow {
    max-width: 110px;
    margin: 0;
  }
  .intro p {
    max-width: 155px;
  }
  .controls {
    padding: 20px 15px;
  }
  .actions {
    grid-template-columns: 1fr;
  }
  .actions .primary {
    grid-column: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
