:root {
  color-scheme: dark;
  --navy: #0e1a2e;
  --gold: #e8c96a;
  --teal: #2e9bad;
  --paper: #f6f4ef;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--navy);
  color: var(--paper);
  font:
    15px/1.5 Arial,
    sans-serif;
}
main {
  max-width: 1560px;
  margin: auto;
  padding: 26px 24px 50px;
}
a {
  color: #9ad2dc;
}
.back {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  text-decoration: none;
  font-size: 13px;
}
.eyebrow {
  font-size: 11px;
  color: #80c3cf;
  font-weight: bold;
  letter-spacing: 0.2em;
  margin: 16px 0 8px;
}
h1 {
  font:
    800 clamp(42px, 5vw, 66px)/1 'Barlow Condensed',
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0;
}
h1 span {
  color: var(--gold);
}
header > p:last-child {
  color: #b9c9da;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 1fr);
  align-items: start;
  gap: 26px;
}
.preview {
  position: sticky;
  top: 20px;
  min-width: 0;
}
.stagebox {
  padding: 18px;
  background: #13233d;
  border: 1px solid #29415e;
  border-radius: 12px;
}
.stage {
  position: relative;
  width: min(100%, 56vh);
  aspect-ratio: 1;
  margin: auto;
  background-color: #d3d9dd;
  background-image:
    linear-gradient(45deg, #b5bec5 25%, transparent 25%),
    linear-gradient(-45deg, #b5bec5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #b5bec5 75%),
    linear-gradient(-45deg, transparent 75%, #b5bec5 75%);
  background-size: 24px 24px;
  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;
}
.stage canvas {
  width: 100%;
  height: 100%;
  display: block;
}
#canvas {
  touch-action: none;
}
#selection {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.playbar,
.row {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.playbar {
  margin: 14px 0;
}
.scrub {
  flex: 1;
  min-width: 100px;
}
.controls {
  min-width: 0;
}
fieldset,
.tim-projects {
  border: 1px solid #29415e;
  border-radius: 10px;
  padding: 18px;
  margin: 0 0 18px;
  background: #13233d;
  min-width: 0;
}
legend {
  font:
    700 24px 'Barlow Condensed',
    sans-serif;
  padding: 0 7px;
  color: var(--gold);
}
label {
  display: block;
  font-size: 13px;
  color: #c7d4e3;
  margin: 10px 0;
}
.row > label {
  flex: 1;
  min-width: 130px;
}
.row > button {
  flex: 1;
}
input,
textarea,
select,
button {
  font: inherit;
  max-width: 100%;
}
select,
input[type='search'],
textarea {
  width: 100%;
  color: var(--paper);
  background: #0d1c31;
  border: 1px solid #425571;
  border-radius: 6px;
  padding: 10px;
}
input[type='range'] {
  display: block;
  width: 100%;
  accent-color: var(--teal);
}
input[type='color'] {
  width: 100%;
  height: 44px;
  background: #0d1c31;
  border: 1px solid #425571;
  border-radius: 6px;
}
.toggle {
  display: flex;
  gap: 8px;
  align-items: center;
}
.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}
output {
  float: right;
  color: var(--gold);
}
button {
  min-height: 44px;
  color: var(--paper);
  background: #19344c;
  border: 1px solid #425571;
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button.primary {
  background: var(--gold);
  color: var(--navy);
  font-weight: bold;
  border-color: var(--gold);
}
button:hover:not(:disabled) {
  border-color: var(--gold);
}
.catalog {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding: 8px 3px;
}
.catalog button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1.2;
  gap: 7px;
  min-width: 0;
  min-height: 108px;
  padding: 8px;
  background: #1b354c;
}
.catalog img {
  width: 100%;
  height: 64px;
  object-fit: contain;
}
.catalog button span {
  min-height: 26px;
  display: grid;
  place-items: center;
}
.note {
  font-size: 12px;
  line-height: 1.6;
  color: #aebfd2;
}
summary {
  cursor: pointer;
  min-height: 44px;
  align-content: center;
}
#addText {
  width: 100%;
  margin-top: 12px;
}
#status {
  font-size: 13px;
  color: var(--gold);
  min-height: 24px;
}
#result {
  border: 1px solid #29415e;
  border-radius: 10px;
  padding: 16px;
  margin-top: 18px;
}
video {
  display: block;
  width: 100%;
  max-height: 45vh;
  background: #172b40;
}
footer {
  color: #8ba5bc;
  font-size: 11px;
  letter-spacing: 0.16em;
  margin-top: 22px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .preview {
    position: static;
  }
  .stage {
    width: min(100%, 46vh);
  }
  main {
    padding: 16px 12px 40px;
  }
  .catalog {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  fieldset {
    padding: 14px;
  }
  .catalog {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stagebox {
    padding: 10px;
  }
  .catalog button {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
