/* Made This Studio: the "Two monitors" design. Dark, quiet panels around
   two screens and a timeline; one accent for what's live (the playhead, a
   mark, what's chosen) and a colour for each kind of track. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #0f1012;
  --bar: #131417;
  --panel: #17181b;
  --panel-2: #1d1f23;
  --raised: #22252a;
  --hover: #262930;
  --on: #2a2d33;
  --line: #26282d;
  --line-2: #33363d;
  --text: #e6e7ea;
  --muted: #8b8f97;
  --faint: #5c6069;
  --accent: #2bd4e6;
  --accent-ink: #031417;
  --accent-soft: rgba(43, 212, 230, 0.16);
  --danger: #e2685b;
  --picture: #3a5068;
  --title: #c99a3e;
  --dialogue: #1f8a80;
  --music: #5a5bd3;
  --sound: #b1506a;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
}

body {
  color: var(--text);
  font: 12px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

button:disabled {
  cursor: default;
  opacity: 0.4;
}

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

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.icon {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The window: a bar, the monitors and panels, the tools, the timeline. */
.studio {
  height: 100dvh;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr) 40px minmax(240px, 40%);
}

/* The bar at the top. */
.bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
}

.menus {
  display: flex;
  gap: 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.menus button {
  padding: 4px 7px;
  border-radius: 5px;
}

.menus button:hover {
  background: var(--panel-2);
  color: var(--text);
}

.title {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.title strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title span {
  color: var(--faint);
  white-space: nowrap;
}

/* A choice of a few, side by side: workspaces, fit, fill. */
.segments {
  display: flex;
  padding: 3px;
  gap: 2px;
  background: var(--panel-2);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.segments button {
  padding: 4px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 500;
}

.segments button:hover {
  color: var(--text);
}

.segments button[aria-pressed="true"] {
  background: var(--on);
  color: var(--text);
}

.segments.small {
  padding: 2px;
}

.segments.small button {
  padding: 2px 9px;
}

.button {
  height: 30px;
  padding: 0 14px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.button:hover {
  background: var(--hover);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.button.primary:hover {
  background: #4fdcec;
}

.button.quiet {
  height: 26px;
  font-weight: 500;
}

/* The panels and monitors. */
.upper {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) minmax(0, 1fr) 300px;
  gap: 8px;
  padding: 8px;
  min-height: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.head {
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}

.head .tab {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.head .tab:hover {
  color: var(--text);
}

.head .tab[aria-pressed="true"] {
  color: var(--text);
}

.head .tab[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.head .about {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The project: what's been brought in. */
.finder {
  display: flex;
  gap: 8px;
  padding: 10px;
}

.search {
  flex: 1;
  min-width: 0;
  height: 30px;
  border-radius: 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--faint);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  color: var(--text);
}

.search input::placeholder {
  color: var(--faint);
}

.hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bin {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bin.dropping {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}

.group-name {
  padding: 10px 10px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 7px;
  text-align: left;
  width: 100%;
}

.item:hover {
  background: var(--panel-2);
}

.item[aria-pressed="true"] {
  background: var(--raised);
  box-shadow: inset 2px 0 0 var(--accent);
}

.item .thumb {
  width: 64px;
  height: 36px;
  flex: none;
  object-fit: cover;
  border-radius: 4px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}

.item .thumb.sound {
  background: #23244a;
  color: #8d8ef0;
}

.item .words,
.summary .words {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.item .name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item .meta {
  color: var(--muted);
  font-size: 11px;
}

.empty {
  margin: auto;
  padding: 24px;
  max-width: 240px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty strong {
  color: var(--text);
  font-weight: 600;
}

.status {
  flex: none;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  min-height: 33px;
}

/* The two monitors. */
.screen {
  flex: 1;
  min-height: 0;
  background: #050506;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.screen video,
.screen canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.screen .empty {
  color: var(--faint);
}

.transport {
  flex: none;
  height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border-top: 1px solid var(--line);
}

.scrub {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: #2b2e34;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.controls .mark {
  font-size: 11px;
}

.controls .spacer {
  flex: 1;
}

.controls .middle {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 14px;
  align-items: center;
}

.round {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.round:hover {
  background: var(--panel-2);
}

.round.play {
  background: var(--text);
  color: var(--bg);
}

.round.play .icon {
  fill: currentColor;
}

.time {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 13px;
}

.time.quiet {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

.mark {
  color: var(--accent);
}

/* The inspector. */
.group {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group:last-child {
  border-bottom: 0;
}

.group .group-name {
  padding: 0 0 4px;
}

.summary {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.summary img,
.summary .thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
  background: #000;
  flex: none;
}

.summary .name,
.summary strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary .meta {
  color: var(--muted);
  font-size: 11px;
}

.field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 28px;
}

.field .label {
  color: var(--muted);
  white-space: nowrap;
}

.value {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  min-width: 92px;
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The tools above the timeline. */
.tools {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  margin: 0 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  border-bottom: 0;
}

.tool {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.tool:hover {
  color: var(--text);
  background: var(--panel-2);
}

.tool[aria-pressed="true"] {
  background: var(--on);
  color: var(--text);
}

.divider {
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 6px;
}

.tools .now {
  flex: 1;
  display: flex;
  justify-content: center;
  color: var(--accent);
  font-size: 14px;
}

.zoom {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.zoom input {
  width: 110px;
  accent-color: var(--text);
}

/* The timeline. */
.timeline {
  margin: 0 8px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.headers {
  width: 178px;
  flex: none;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.corner {
  height: 30px;
  flex: none;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
}

.track-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.track-head .name {
  flex: 1;
  font-weight: 500;
}

.badge {
  width: 26px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 11px var(--mono);
  color: var(--bg);
}

.toggle {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  border: 1px solid var(--line);
}

.toggle[aria-pressed="true"] {
  color: var(--bg);
  background: var(--muted);
  border-color: var(--muted);
}

.toggle.muting[aria-pressed="true"] {
  background: var(--danger);
  border-color: var(--danger);
}

.lanes {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
}

.lanes-inner {
  position: relative;
  min-height: 100%;
}

.ruler {
  height: 30px;
  position: relative;
  border-bottom: 1px solid var(--line);
  cursor: text;
}

.tick {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 1px solid var(--line-2);
  padding: 4px 0 0 5px;
  color: var(--faint);
  font: 10px var(--mono);
  white-space: nowrap;
}

.tick.minor {
  top: auto;
  bottom: 0;
  height: 6px;
  padding: 0;
}

.lane {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.heads {
  display: flex;
  flex-direction: column;
}

/* Each kind of track: its height, and its colour. */
.titles {
  --colour: var(--title);
  height: 40px;
}

.picture {
  --colour: var(--picture);
  height: 76px;
}

.dialogue {
  --colour: var(--dialogue);
  height: 56px;
}

.music {
  --colour: var(--music);
  height: 52px;
}

.sound {
  --colour: var(--sound);
  height: 52px;
}

.badge.titles,
.badge.picture,
.badge.dialogue,
.badge.music,
.badge.sound {
  height: 20px;
  background: var(--colour);
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px solid var(--accent);
  pointer-events: none;
  z-index: 3;
}

.playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -7px;
  border: 6px solid transparent;
  border-top: 8px solid var(--accent);
}

.meters {
  width: 34px;
  flex: none;
  border-left: 1px solid var(--line);
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 38px 0 12px;
}

.meter {
  width: 7px;
  border-radius: 2px;
  background: #22252a;
  position: relative;
  overflow: hidden;
}

.meter div {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: linear-gradient(#e2685b 0 4%, #e2c044 4% 16%, #3cc47c 16%);
  background-size: 100% var(--full, 300px);
  background-position: bottom;
}

/* The source's marks and the program's progress on their bars. */
.scrub {
  cursor: pointer;
  touch-action: none;
}

.scrub::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  bottom: -8px;
}

.marked {
  position: absolute;
  top: -3px;
  height: 10px;
  border-radius: 2px;
  background: rgba(43, 212, 230, 0.35);
  border: 1px solid var(--accent);
}

.head-mark {
  position: absolute;
  top: -6px;
  width: 2px;
  height: 16px;
  margin-left: -1px;
  background: var(--text);
  pointer-events: none;
}

.head-mark.program {
  background: var(--accent);
}

.played {
  height: 100%;
  border-radius: 2px;
  background: #555a63;
}

.panel.monitor.active {
  border-color: var(--line-2);
}

.panel.monitor.active .head .tab[aria-pressed="true"]::after {
  background: var(--accent);
}

.panel.monitor:not(.active) .head .tab[aria-pressed="true"]::after {
  background: var(--faint);
}

[hidden] {
  display: none !important;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.marker {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  margin-left: -5px;
  border: 5px solid transparent;
  border-bottom: 8px solid var(--title);
  pointer-events: none;
}

/* Clips on the timeline. */
.lanes-body {
  position: relative;
}

.lanes-body.blade .clip {
  cursor: crosshair;
}

.lane {
  touch-action: none;
}

.clip {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 4px;
  overflow: hidden;
  background: color-mix(in srgb, var(--colour) 78%, #000);
  border: 1px solid color-mix(in srgb, var(--colour) 70%, #fff);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 6px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  min-width: 2px;
}

.clip[aria-selected="true"] {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  z-index: 2;
}

.clip.dragging {
  opacity: 0.85;
  cursor: grabbing;
  pointer-events: none;
  z-index: 4;
}

.clip-frame {
  height: calc(100% + 6px);
  margin: -3px 0 -3px -6px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  flex: none;
  opacity: 0.9;
  pointer-events: none;
}

.clip-name {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.titles .clip {
  align-items: center;
  justify-content: center;
}

.titles .clip-name {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 7px;
  cursor: ew-resize;
  z-index: 1;
}

.edge.head {
  left: 0;
}

.edge.tail {
  right: 0;
}

.clip:hover .edge,
.clip[aria-selected="true"] .edge {
  background: rgba(255, 255, 255, 0.18);
}

.head .head-time {
  margin-left: auto;
  font-size: 12px;
}
