@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,600;12..96,700;12..96,800&family=DM+Sans:wght@400;500;600;650;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --stage: #141414;
  --paper: #ffffff;
  --ink: #143b73;
  --muted: #526787;
  --line: #143b73;
  --blue: #155bdb;
  --red: #df2635;
  --yellow: #ffda28;
  --mono: 'IBM Plex Mono', monospace;
  --display: 'Bricolage Grotesque', 'DM Sans', sans-serif;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #155bdb;
  outline-offset: 5px;
}

button:disabled {
  cursor: wait;
}

header {
  min-height: 82px;
  padding: 0 max(4.1%, calc((100vw - 1470px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 5px solid var(--red);
  background: #ffffffec;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font: 800 29px var(--display);
  letter-spacing: -1.5px;
  text-decoration: none;
  white-space: nowrap;
  padding: 7px 12px 10px;
  border-radius: 16px 16px 21px 21px;
  background: var(--red);
  color: white;
  box-shadow: 0 4px 0 #a61727;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  margin-right: 10px;
  border: 2px solid var(--ink);
  border-radius: 11px;
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-7deg);
  color: var(--blue);
  font: 700 33px/1 var(--display);
}

.brand-period {
  color: var(--yellow);
}

.text-button,
.restart {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 19px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.text-button:hover,
.restart:hover,
.round-button:hover,
.surface-modes button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--ink);
}

.text-button:active,
.restart:active,
.round-button:active,
.surface-modes button:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--ink);
}

.text-button > span[aria-hidden],
.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  line-height: 1;
}

.ui-icon,
.mode-icon svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main {
  max-width: 1470px;
  margin-inline: auto;
  padding: 0 4.1% 30px;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  position: relative;
  margin: 42px 0 43px;
}

.intro .eyebrow {
  display: none;
}

h1 {
  margin: 0;
  font: 800 clamp(42px, 4.4vw, 68px)/1.01 var(--display);
  letter-spacing: -2.8px;
  color: var(--blue);
}

.headline-accent {
  display: inline-block;
  padding: 0 10px 4px;
  margin-left: 2px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--yellow);
  box-shadow: 3px 4px 0 var(--ink);
  position: relative;
  transform: rotate(-3deg);
}

.intro-note {
  position: relative;
  isolation: isolate;
  max-width: 260px;
  margin: 0 0 7px;
  color: #365680;
  font-size: 16px;
  line-height: 1.55;
}

.tunnel {
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 25px;
  background: #fffef9;
  box-shadow: 0 7px 0 var(--ink);
}

.scene {
  position: relative;
  height: clamp(390px, 34vw, 480px);
  isolation: isolate;
  overflow: hidden;
  background: var(--stage);
}

#scene-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-top {
  position: absolute;
  top: 22px;
  left: 25px;
  right: 25px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  pointer-events: none;
}


.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font: 600 10px var(--mono);
  letter-spacing: .055em;
}



.simulation-status {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: #fffffff2;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.simulation-status i,
.footer-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--blue);
}

.simulation-status i.busy {
  background: #df2635;
}

.simulation-status i.paused {
  background: #6a7a91;
}

.scene-bottom {
  position: absolute;
  left: 25px;
  right: 20px;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.view-label {
  padding: 4px 6px;
  border-radius: 5px;
  background: #ffffffcc;
  color: #526787;
  font: 400 10px var(--mono);
  letter-spacing: .025em;
}

.scene-actions {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.round-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  font-size: 27px;
}

#pause {
  background: var(--yellow);
}

.round-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wind-label {
  position: absolute;
  top: 58%;
  left: 25px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #155bdb;
  font: 500 10px var(--mono);
  letter-spacing: .05em;
  text-shadow: 0 0 6px white;
  transform: rotate(-15deg);
}

.wind-label > span {
  font-size: 27px;
}

.loading-note {
  position: absolute;
  left: 50%;
  bottom: 28px;
  max-width: 60%;
  padding: 9px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: #fff5b9f2;
  color: #143b73;
  font-size: 11px;
  text-align: center;
  transform: translateX(-50%);
}

.loading-note[hidden] {
  display: none;
}

.view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 18px;
  padding: 16px 22px 19px;
  border-top: 2px solid var(--ink);
  background: var(--paper);
}

.surface-modes {
  display: flex;
  gap: 9px;
}

.surface-modes button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 10px 15px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.surface-modes button[aria-pressed=true] {
  background: var(--red);
  color: white;
}

.rainbow-icon {
  display: inline-block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.6px solid var(--ink);
  border-radius: 50%;
  background: conic-gradient(#f5768e, #ffe67a, #b6e780, #7ce1d9, #a59aff, #f5768e);
}

#about-button > span {
  color: white;
  width: 21px;
  height: 21px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.color-key {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #365680;
  font: 500 11px var(--mono);
  white-space: nowrap;
}

.spectrum {
  display: block;
  width: 94px;
  height: 11px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(90deg, #103af9, #00bef6, #00da69, #dfec00, #ffa500, #e72c19);
}

.line-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  color: #143b73;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.line-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-track {
  position: relative;
  display: inline-block;
  width: 43px;
  height: 25px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #dce6f5;
}

.toggle-track::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: white;
  transition: transform 160ms ease;
}

.line-toggle input:checked + .toggle-track {
  background: var(--yellow);
}

.line-toggle input:checked + .toggle-track::before {
  transform: translateX(18px);
}

.line-toggle input:focus-visible + .toggle-track {
  outline: 3px solid #155bdb;
  outline-offset: 5px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) .62fr .62fr auto;
  align-items: center;
  gap: 16px;
  margin-top: 25px;
}

.control {
  --control-accent: #df2635;
  min-width: 0;
  padding: 16px 18px 14px;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: #ffda28;
  box-shadow: 0 4px 0 var(--ink);
}

.control:nth-child(2) {
  color: white;
  --control-accent: #ffda28;
  background: #155bdb;
}

.control-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-height: 32px;
  font-size: 14px;
  font-weight: 700;
}

.control-heading label {
  line-height: 1.2;
}

.control-hint {
  display: block;
  margin-top: 4px;
  color: #365680;
  font-size: 11px;
  font-weight: 500;
}

.control:nth-child(2) .control-hint {
  color: #ffffff;
}

.control-heading output {
  color: var(--ink);
  min-width: 47px;
  padding: 3px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  background: var(--paper);
  font: 700 18px var(--display);
  text-align: center;
  white-space: nowrap;
}

input[type=range] {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 44px;
  margin: 4px 0 0;
  background: transparent;
  cursor: grab;
  touch-action: pan-y;
}

input[type=range]:active {
  cursor: grabbing;
}

input[type=range]::-webkit-slider-runnable-track {
  height: 11px;
  border: 1.8px solid var(--ink);
  border-radius: 99px;
  background: linear-gradient(to right, var(--control-accent) var(--range-fill, 50%), #ffffff var(--range-fill, 50%));
}

input[type=range]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  margin-top: -11px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 3px 0 #99192a;
  transition: transform 120ms ease, background 120ms ease;
}

input[type=range]:hover::-webkit-slider-thumb,
input[type=range]:focus-visible::-webkit-slider-thumb {
  background: var(--yellow);
  transform: scale(1.09);
}

input[type=range]::-moz-range-track {
  height: 9px;
  border: 1.8px solid var(--ink);
  border-radius: 99px;
  background: linear-gradient(to right, var(--control-accent) var(--range-fill, 50%), #ffffff var(--range-fill, 50%));
}

input[type=range]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 3px 0 #99192a;
}

.range-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #365680;
  font-size: 11px;
  font-weight: 500;
}

.control:nth-child(2) .range-labels {
  color: #ffffff;
}

.measurement {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-left: 8px;
  min-width: 0;
}

.measurement > span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.measurement i {
  margin-left: 2px;
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  color: #526787;
  white-space: nowrap;
}

.measurement strong {
  font: 700 34px/1.15 var(--display);
  letter-spacing: -1px;
}

.measurement small {
  color: #526787;
  font-size: 11px;
  white-space: nowrap;
}

.restart {
  padding-inline: 15px;
  background: #ffda28;
  font-size: 13px;
}

.restart .button-icon {
  font-size: 25px;
}

.object-library {
  margin-top: 35px;
}

.library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.library-heading h2 {
  margin: 0;
  font: 750 27px/1.15 var(--display);
  letter-spacing: -.9px;
}

#random {
  color: white;
  min-height: 51px;
  padding-inline: 23px;
  background: var(--red);
  font-size: 15px;
  box-shadow: 3px 4px 0 var(--ink);
  transform: rotate(1deg);
}

#random:hover {
  transform: rotate(-2deg) translateY(-3px);
  box-shadow: 4px 7px 0 var(--ink);
}

#random:active {
  transform: rotate(0) translateY(3px);
  box-shadow: 0 0 0 var(--ink);
}

.object-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.object-card {
  --card-bg: #ffda28;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 157px;
  min-width: 0;
  padding: 14px 8px 15px;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--card-bg);
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.object-card:nth-child(2) {
  --card-bg: #155bdb;
}

.object-card:nth-child(3) {
  --card-bg: #df2635;
}

.object-card:nth-child(4) {
  --card-bg: #ffda28;
}

.object-card:nth-child(5) {
  --card-bg: #155bdb;
}

.object-card:nth-child(6) {
  --card-bg: #df2635;
}

.object-card img {
  display: block;
  width: 100%;
  max-width: 152px;
  height: 87px;
  object-fit: contain;
  filter: drop-shadow(0 4px 3px #143b732b);
  transition: transform 220ms cubic-bezier(.2, .8, .25, 1.4);
}

.object-card span {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.object-card:hover {
  transform: translateY(-5px) rotate(-1deg);
  box-shadow: 1px 9px 0 var(--ink);
}

.object-card:hover img {
  transform: scale(1.07) rotate(3deg);
}

.object-card:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.object-card[aria-pressed=true] {
  box-shadow: 0 4px 0 var(--ink), inset 0 0 0 3px var(--paper);
}

.object-card[aria-pressed=true]::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1.7px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 700;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 24px;
  color: #526787;
  font-size: 11px;
}

footer > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

footer button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #155bdb;
  font-size: 19px;
}

.scene.expanded {
  position: fixed;
  inset: 0;
  z-index: 20;
  height: 100%;
  background: var(--stage);
}

body.expanded {
  overflow: hidden;
}

dialog {
  width: min(660px, calc(100% - 32px));
  max-height: calc(100% - 40px);
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 24px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 7px 8px 0 var(--ink);
}

dialog::backdrop {
  background: #143b7370;
  backdrop-filter: blur(4px);
}

.dialog-top {
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 25px 17px;
  border-bottom: 2px solid var(--ink);
  background: var(--red);
}

.dialog-top h2 {
  margin: 0;
  font: 750 29px/1.1 var(--display);
  letter-spacing: -.8px;
}

.dialog-body {
  padding: 10px 26px 26px;
  color: #365680;
  font-size: 14px;
  line-height: 1.65;
}

.dialog-body h3 {
  margin: 20px 0 6px;
  color: var(--ink);
  font: 700 20px var(--display);
  letter-spacing: -.5px;
}

.dialog-body p {
  margin: 8px 0;
}

.dialog-body ul {
  padding-left: 19px;
}

.dialog-body a {
  color: #155bdb;
  text-underline-offset: 3px;
}

/* Crayon drawings sit in the margins around the interactive toy. */
.headline-accent::after {
  content: '';
  position: absolute;
  left: -8%;
  bottom: -28px;
  width: 122%;
  height: 24px;
  background: url('assets/crayon-red.webp') center / 100% 100% no-repeat;
  pointer-events: none;
  transform: rotate(2deg);
}

.intro-note::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -33px -28px;
  background: url('assets/crayon-blue.webp') center / 100% 100% no-repeat;
  opacity: .8;
  pointer-events: none;
  transform: rotate(4deg);
}

.object-library {
  position: relative;
  isolation: isolate;
}

.object-library::before {
  content: '';
  position: absolute;
  width: 95px;
  height: 95px;
  top: -31px;
  left: 330px;
  z-index: -1;
  background: url('assets/crayon-yellow.webp') center / contain no-repeat;
  pointer-events: none;
  transform: rotate(-12deg);
}

.library-heading h2 {
  color: var(--blue);
}

.object-card:nth-child(3n + 2),
.object-card:nth-child(3n) {
  color: white;
}

#about-button {
  color: var(--blue);
  background: white;
}

#pause {
  color: white;
  background: var(--red);
}

#expand {
  color: white;
  background: var(--blue);
}

.dialog-top .round-button {
  color: var(--blue);
}

footer {
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  right: 37%;
  top: -7px;
  width: 100px;
  height: 35px;
  background: url('assets/crayon-hatch.webp') center / contain no-repeat;
  pointer-events: none;
  opacity: .7;
}

@media (min-width: 1550px) {
  main {
    padding-inline: 0;
  }
}

@media (max-width: 1150px) {
  .view-bar {
    gap: 13px;
    padding-inline: 17px;
  }

  .surface-modes button {
    padding-inline: 12px;
  }

  .color-key {
    gap: 5px;
  }

  .spectrum {
    width: 67px;
  }

  .controls {
    grid-template-columns: 1fr 1fr .65fr .65fr;
    gap: 15px;
  }

  .restart {
    grid-column: 4;
    justify-self: end;
    margin-top: -6px;
  }

  .object-card {
    min-height: 142px;
  }

  .object-card img {
    height: 74px;
  }
}

@media (max-width: 900px) {
  header {
    min-height: 74px;
  }

  .intro {
    align-items: center;
    gap: 22px;
  }

  h1 {
    font-size: 51px;
    letter-spacing: -2px;
  }

  .intro-note {
  position: relative;
  isolation: isolate;
    max-width: 210px;
    font-size: 14px;
  }

  .scene {
    height: 400px;
  }

  .view-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
  }

  .surface-modes {
    grid-column: 1 / -1;
  }

  .surface-modes button {
    flex: 1;
  }

  .color-key {
    justify-content: flex-start;
  }

  .spectrum {
    width: 120px;
  }

  .controls {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 16px;
  }

  .control {
    grid-column: span 2;
  }

  .measurement {
    padding: 8px 2px 0;
  }

  .restart {
    grid-column: 3 / -1;
    align-self: center;
    justify-self: end;
    margin-top: 0;
  }

  .object-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
  }

  .object-card {
    min-height: 148px;
  }

  .object-card img {
    height: 80px;
  }

  .library-heading h2 {
    font-size: 25px;
  }
}

@media (max-width: 560px) {
  header {
    min-height: 74px;
    padding-inline: 18px;
    gap: 12px;
  }

  .brand {
    font-size: 25px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    margin-right: 8px;
    font-size: 29px;
    border-radius: 10px;
  }

  header .text-button {
    min-height: 44px;
    padding: 9px 13px;
    font-size: 12px;
  }

  main {
    padding-inline: 15px;
  }

  .intro {
    display: block;
    margin: 29px 0 23px;
  }

  h1 {
    font-size: clamp(38px, 10.5vw, 54px);
    line-height: 1.06;
    letter-spacing: -2px;
  }

  .headline-accent {
    padding-inline: 7px;
    border-radius: 11px;
  }

  .intro-note {
  position: relative;
  isolation: isolate;
    max-width: 100%;
    margin: 16px 0 0;
    font-size: 14px;
    line-height: 1.5;
  }

  .intro-note::before {
    display: none;
  }

  .headline-accent::after {
    bottom: -18px;
    height: 16px;
  }

  .object-library::before {
    width: 70px;
    height: 70px;
    top: -19px;
    left: 44%;
  }

  footer::before {
    right: 3px;
    top: -17px;
    width: 64px;
  }

  .intro-note br {
    display: none;
  }

  .tunnel {
    border-radius: 21px;
    box-shadow: 0 5px 0 var(--ink);
  }

  .scene {
    height: 356px;
  }

  .scene-top {
    top: 15px;
    left: 13px;
    right: 12px;
    gap: 8px;
  }




  .simulation-status {
    min-height: 30px;
    padding: 6px 7px;
    gap: 5px;
    font-size: 10px;
  }

  .simulation-status i {
    width: 5px;
    height: 5px;
  }

  .wind-label {
    top: 65%;
    left: 15px;
    font-size: 9px;
  }

  .scene-bottom {
    left: 13px;
    right: 13px;
    bottom: 14px;
  }

  .view-label {
    max-width: 150px;
    font-size: 8px;
    line-height: 1.45;
  }

  .scene-actions {
    gap: 9px;
  }

  .round-button {
    width: 46px;
    height: 46px;
  }

  .loading-note {
    max-width: 86%;
    width: max-content;
    bottom: 74px;
    padding: 7px 12px;
    font-size: 10px;
  }

  .view-bar {
    padding: 13px 12px 17px;
    gap: 13px 8px;
  }

  .surface-modes {
    gap: 6px;
  }

  .surface-modes button {
    min-width: 0;
    min-height: 47px;
    padding: 9px 6px;
    gap: 5px;
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .surface-modes .ui-icon {
    width: 16px;
    height: 16px;
  }

  .color-key {
    gap: 5px;
    font-size: 10px;
  }

  .spectrum {
    width: 57px;
    height: 10px;
  }

  .line-toggle {
    justify-self: end;
    gap: 6px;
    font-size: 12px;
  }

  .toggle-track {
    width: 39px;
  }

  .line-toggle input:checked + .toggle-track::before {
    transform: translateX(14px);
  }

  .controls {
    grid-template-columns: 1fr 1fr;
    gap: 19px 14px;
    margin-top: 23px;
  }

  .control {
    grid-column: 1 / -1;
    padding: 16px 19px 15px;
    border-radius: 18px;
  }

  .control-heading {
    font-size: 16px;
  }

  .control-heading output {
  color: var(--ink);
    min-width: 54px;
    font-size: 21px;
  }

  .range-labels {
    font-size: 12px;
  }

  .measurement {
    padding: 2px 4px;
  }

  .measurement > span {
    font-size: 13px;
  }

  .measurement strong {
    font-size: 35px;
  }

  .measurement small {
    font-size: 11px;
  }

  .restart {
    grid-column: 1 / -1;
    justify-self: stretch;
    min-height: 47px;
    font-size: 14px;
  }

  .object-library {
    margin-top: 29px;
  }

  .library-heading {
    align-items: center;
    gap: 14px;
    margin-bottom: 17px;
  }

  .library-heading h2 {
    max-width: 175px;
    font-size: 24px;
    letter-spacing: -.8px;
  }

  #random {
  color: white;
    min-height: 48px;
    padding: 10px 13px;
    font-size: 13px;
  }

  .object-grid {
    gap: 12px 9px;
  }

  .object-card {
    min-height: 128px;
    gap: 8px;
    padding: 12px 4px;
    border-radius: 16px;
  }

  .object-card img {
    height: 65px;
  }

  .object-card span {
    font-size: 12px;
  }

  .object-card[aria-pressed=true]::after {
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    font-size: 11px;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin-top: 23px;
    font-size: 11px;
    line-height: 1.4;
  }

  footer > span {
    min-height: 30px;
  }

  .dialog-top {
  color: white;
    padding: 18px 17px 15px;
  }

  .dialog-top h2 {
    font-size: 25px;
  }

  .dialog-body {
    padding: 7px 18px 22px;
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  header {
    padding-inline: 14px;
    gap: 7px;
  }

  .brand {
    font-size: 23px;
  }

  header .text-button {
    padding-inline: 9px;
  }

  .surface-modes .ui-icon,
  .surface-modes .mode-icon {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
