:root {
  --bg: #070707;
  --panel: #0e0e0e;
  --line: #222;
  --text: #f2efe8;   /* the logo's off-white */
  --dim: #77736c;
  --accent: #c80a14;
  --radius: 6px;     /* rounded like the logo's pads */
  --mono: ui-monospace, "Cascadia Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.4 var(--mono);
}

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  height: 100vh;
}

/* ---------- preview ---------- */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  cursor: pointer;
}

.stage.dragover { outline: 1px dashed var(--accent); outline-offset: -8px; }

/* The canvas is always 1080 px wide internally; object-fit scales it down without distortion. */
#out {
  position: absolute;
  top: 16px;
  left: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  object-fit: contain;
}

.drop-hint {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  padding: 12px 18px;
  text-align: center;
  background: rgba(0, 0, 0, 0.75);
  border: 2px dashed #444;
  border-radius: var(--radius);
  pointer-events: none;
  white-space: nowrap;
}
.drop-hint strong { display: block; letter-spacing: 0.08em; text-transform: uppercase; }
.drop-hint span { color: var(--dim); }

.rec-badge {
  position: absolute;
  top: 24px;
  left: 24px;
  padding: 4px 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius);
  letter-spacing: 0.08em;
}

.transport {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}

.transport-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.btn.icon { width: 40px; padding: 7px 0; letter-spacing: 0; }

.time { color: var(--dim); min-width: 120px; font-variant-numeric: tabular-nums; }
.time.start { color: var(--accent); min-width: 0; }
.hint { margin-left: auto; color: var(--dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

#timeline {
  display: block;
  width: 100%;
  height: 72px;
  touch-action: none;
  cursor: crosshair;
  background: #0b0b0b;
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

/* ---------- controls ---------- */

.panel {
  overflow-y: auto;
  padding: 16px;
  background: var(--panel);
  border-left: 1px solid var(--line);
}

h1 {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: 0.4em;
}
h1 img { display: block; width: 100%; height: auto; }

h2 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: normal;
  color: var(--dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

section {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.note { margin: 8px 0 0; color: var(--dim); font-size: 11px; }
.note.warn { color: #d9a441; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.row > select { flex: 1; min-width: 0; }
.row input[type="range"] { width: 160px; }

.btn, select, input[type="text"] {
  font: inherit;
  color: var(--text);
  background: #151515;
  border: 2px solid #2c2c2c;
  border-radius: var(--radius);
  padding: 7px 10px;
}
.btn { cursor: pointer; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.btn:hover:not(:disabled) { border-color: var(--text); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.wide { width: 100%; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; margin-top: 10px; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.15); border-color: var(--accent); }

input[type="text"] { width: 100%; margin-bottom: 6px; }
input[type="range"] { accent-color: var(--accent); }
input[type="color"] { width: 44px; height: 26px; padding: 0; border: 2px solid #2c2c2c; border-radius: var(--radius); background: none; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.grid .btn { padding: 12px 4px; font-size: 11px; }
.grid:empty { display: none; }
#lookGrid .btn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The chosen one is filled solid, like the one solid pad in the logo. */
.grid .btn.active { border-color: var(--text); color: var(--bg); background: var(--text); }

.row > select { max-width: 160px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }

.thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 8px 0;
}
.thumbs:empty { display: none; }
.thumb {
  aspect-ratio: 1;
  padding: 0;
  background: #000;
  border: 2px solid #2c2c2c;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--text); }

/* Keyframe diamond after each slider: grey = no keys, white = has keys, red = key at playhead. */
.row input[type="range"] { margin-left: auto; }
.key {
  flex: none;
  width: 18px;
  padding: 0;
  border: 0;
  background: none;
  color: #3a3a3a;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
h2 .key { margin-left: 6px; vertical-align: middle; }
.key.has { color: var(--text); }
.key.on { color: var(--accent); }

.swatches { display: flex; gap: 8px; }
.swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid #2c2c2c;
  border-radius: var(--radius);
  cursor: pointer;
}
.swatch.active { border-color: var(--text); }

/* ---------- narrow screens ---------- */

@media (max-width: 820px) {
  .app { display: block; height: auto; }
  .stage { height: 70vh; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .row input[type="range"] { width: 55%; }
}
