:root {
  color-scheme: dark;
  --bg: #161510;
  --deep: #15140f;
  --panel: #1e1c16;
  --well: #12110d;
  --line: #33312a;
  --accent: #e25b45;
  --bone: #edebe2;
  --muted: #9a948a;
  --dim: #6e6960;
  --steel: #4a463c;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--bone);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); }
body { user-select: none; }
button, input { font: inherit; }

#footprint {
  position: fixed;
  z-index: 20;
  top: 5px;
  right: 20px;
  color: #a8a294;
  background: transparent;
  font: 12px/18px Consolas, "SFMono-Regular", monospace;
  letter-spacing: .02em;
  white-space: nowrap;
  pointer-events: none;
}

#empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: calc(40vh - 124px);
  text-align: center;
}
#empty-state img { opacity: .8; image-rendering: auto; }
#empty-state h1 {
  margin: 13px 0 5px;
  color: var(--bone);
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-size: 37px;
  line-height: 50px;
  font-weight: 700;
}
#empty-state p { margin: 0; color: var(--muted); font-size: 15px; line-height: 26px; }
#empty-state small { margin-top: 7px; color: var(--dim); font: 12px/24px Consolas, "SFMono-Regular", monospace; }

#editor { position: absolute; inset: 0; }
#video-stage {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  bottom: 222px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: #000;
  object-fit: contain;
  cursor: default;
}
#mock-video { width: min(56%, 720px); aspect-ratio: 4 / 3; max-height: 100%; background: #888; }
#loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  background: #000;
}
#loading img { opacity: .75; }

#timeline {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 114px;
  width: calc(100% - 56px);
  height: 100px;
  cursor: pointer;
  outline: none;
  touch-action: none;
}
#timeline-playhead {
  position: absolute;
  z-index: 2;
  left: 28px;
  bottom: 114px;
  width: 2px;
  height: 100px;
  background: var(--accent);
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}
#timeline-hover-line {
  position: absolute;
  z-index: 3;
  left: 28px;
  bottom: 114px;
  width: 1px;
  height: 100px;
  background: #c6beaf;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
}
#timeline-hover {
  position: absolute;
  z-index: 5;
  bottom: 218px;
  min-width: 94px;
  padding: 4px 7px;
  border: 1px solid var(--steel);
  border-radius: 4px;
  color: var(--bone);
  background: #1c1a15;
  font: 12px/16px Consolas, "SFMono-Regular", monospace;
  text-align: center;
  pointer-events: none;
  transform: translateX(-50%);
}
#clip-rename {
  position: absolute;
  z-index: 8;
  bottom: 175px;
  height: 27px;
  min-width: 64px;
  padding: 2px 6px;
  border: 1px solid var(--accent);
  outline: 0;
  color: var(--bone);
  background: #1e1c16;
  font: 15px/21px "Segoe UI", sans-serif;
  user-select: text;
}

#transport {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 44px;
  height: 62px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.transport-primary { display: flex; align-items: center; justify-content: center; height: 62px; }
.transport-audio { position: absolute; right: 0; top: 0; height: 62px; display: flex; align-items: center; }
#transport button {
  height: 52px;
  margin-top: 5px;
  border: 0;
  border-radius: 14px;
  color: var(--bone);
  background: transparent;
  cursor: default;
}
#transport button:hover:not(:disabled) { background: #2c2921; }
#transport button:active:not(:disabled) { background: #3c372d; }
#transport button:disabled { color: var(--dim); }
.icon { width: 48px; padding: 0; font-family: "Segoe UI Symbol", system-ui, sans-serif; font-size: 20px; }
.icon.primary { width: 58px; font-size: 28px; }
.label-button { width: 108px; padding: 0 10px; font-size: 15px; text-align: left; }
.label-button span { display: inline-block; width: 28px; text-align: center; font-size: 20px; }
.text-control { width: 40px; padding: 0; font-size: 15px; }
.separator { width: 1px; height: 32px; margin: 0 8px; background: #3c3931; }
#volume { width: 110px; margin: 0 8px 0 0; accent-color: var(--accent); cursor: default; }

footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 0 28px;
  color: var(--muted);
  font: 12px/1 Consolas, "SFMono-Regular", monospace;
}
#media-info { color: var(--dim); text-align: center; }
#status { text-align: right; }
#export-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: #28261e; }
#export-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .12s linear; }

body.dragging::after {
  content: "Drop video to open";
  position: fixed;
  z-index: 50;
  inset: 18px;
  border: 2px dashed var(--accent);
  display: grid;
  place-items: center;
  color: var(--bone);
  background: rgb(22 21 16 / 88%);
  font-size: 24px;
}

body.fullscreen #footprint { display: none; }
body.fullscreen #video-stage { inset: 0; }
body.fullscreen #timeline, body.fullscreen #timeline-playhead, body.fullscreen #timeline-hover-line,
body.fullscreen #timeline-hover, body.fullscreen #clip-rename, body.fullscreen footer { display: none; }
body.fullscreen #transport {
  left: 50%;
  right: auto;
  width: min(calc(100% - 48px), 900px);
  bottom: 24px;
  transform: translateX(-50%);
  background: rgb(22 21 16 / 92%);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0 12px;
  opacity: 1;
  transition: opacity .2s;
}
body.fullscreen.transport-hidden #transport { opacity: 0; pointer-events: none; }

@media (max-width: 1180px) {
  .exposure, .exposure-separator { display: none; }
}
@media (max-width: 820px) {
  #media-info { display: none; }
  footer { grid-template-columns: 1fr 1fr; }
  .transport-primary { transform: translateX(-110px); }
  .label-button { width: 90px; }
}
@media (max-width: 700px) {
  #footprint { display: none; }
  .label-button { font-size: 0; width: 44px; padding: 0; text-align: center; }
  .label-button span { width: auto; font-size: 20px; }
  .transport-primary { transform: translateX(-90px); }
  #volume { width: 76px; }
}
