:root {
  --bg: #080d16;
  --surface: rgba(19, 27, 43, 0.5);
  --surface-strong: rgba(18, 25, 39, 0.78);
  --surface-soft: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f5f7fb;
  --muted: #a4b0c5;
  --accent: #ff8a3d;
  --accent-soft: rgba(255, 138, 61, 0.2);
  --danger: #ff5d78;
  --video: #78b8ff;
  --title: #ffc466;
  --audio: #84ebb2;
  --glow: 0 35px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 10% 10%, rgba(112, 167, 255, 0.18), transparent 26%),
    radial-gradient(circle at 85% 10%, rgba(255, 172, 111, 0.14), transparent 28%),
    linear-gradient(180deg, #090d16 0%, #0b1220 42%, #070b12 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

.page-aura {
  position: fixed;
  inset: auto;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.45;
  z-index: 0;
}

.page-aura-left {
  top: 80px;
  left: -80px;
  width: 260px;
  height: 260px;
  background: rgba(111, 164, 255, 0.22);
}

.page-aura-right {
  right: -50px;
  top: 0;
  width: 300px;
  height: 260px;
  background: rgba(255, 141, 77, 0.2);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 24px;
}

.glass-shell,
.glass-panel {
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04)),
    rgba(13, 19, 31, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 22px 24px;
  border-radius: 30px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fdf1e7;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.05)),
    linear-gradient(135deg, rgba(255, 159, 94, 0.4), rgba(110, 162, 255, 0.26));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand-copy {
  display: grid;
  gap: 6px;
}

.eyebrow {
  margin: 0;
  color: #ffb070;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
.frame-copy h3,
.summary-card strong,
.export-stats strong {
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.3rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 1.18rem;
  letter-spacing: -0.03em;
}

.brand-subcopy {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.45;
}

.topbar-actions,
.inspector-actions,
.transport,
.timeline-legend,
.sequence-metrics,
.export-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

button,
.upload-button {
  border: 0;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

button:hover,
.upload-button:hover {
  transform: translateY(-1px);
}

.accent-button,
.upload-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, #ff995a, #ff7a2f);
  color: #160b03;
  font-weight: 800;
  padding: 13px 18px;
  border-radius: 16px;
  box-shadow: 0 18px 36px rgba(255, 122, 47, 0.24);
}

.ghost-button,
.transport-button,
.danger-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.11);
  padding: 12px 15px;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ghost-button:focus-visible,
.accent-button:focus-visible,
.transport-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.danger-button {
  color: #ffd7de;
  border-color: rgba(255, 93, 120, 0.35);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 18px;
}

.summary-card {
  padding: 18px 18px 16px;
  border-radius: 24px;
  display: grid;
  gap: 6px;
}

.summary-card span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.summary-card strong {
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.summary-card p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.workspace {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr) 320px;
  gap: 18px;
  min-height: calc(100vh - 240px);
}

.panel,
.preview-panel,
.timeline-panel {
  border-radius: 30px;
}

.glass-panel {
  padding: 20px;
}

.panel-header,
.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.panel-copy {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.52;
  font-size: 0.94rem;
}

.center-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.preview-panel {
  display: grid;
  gap: 16px;
}

.sequence-metrics {
  gap: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}

.metric-chip,
.stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stage-chip-soft {
  background: rgba(16, 21, 34, 0.44);
}

.preview-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(111, 168, 255, 0.22), transparent 32%),
    linear-gradient(145deg, rgba(42, 55, 99, 0.86), rgba(36, 131, 126, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.stage-sheen {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.15), transparent 28%),
    linear-gradient(180deg, rgba(7, 10, 18, 0.02), rgba(7, 10, 18, 0.32));
  pointer-events: none;
}

.preview-stage video,
.preview-stage img,
.fallback-frame,
.text-overlay,
.preview-safe-guides {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.preview-stage video,
.preview-stage img {
  object-fit: cover;
  display: none;
}

.fallback-frame {
  display: grid;
  place-items: center;
}

.frame-glow {
  position: absolute;
  width: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 61, 0.2), transparent 70%);
  filter: blur(18px);
}

.frame-copy {
  position: relative;
  text-align: center;
  z-index: 1;
}

.frame-copy p {
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 8px;
}

.frame-copy h3 {
  font-size: clamp(1.6rem, 3vw, 2.7rem);
  letter-spacing: -0.04em;
  max-width: 520px;
}

.stage-topline {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  z-index: 2;
}

.text-overlay {
  display: grid;
  place-items: end start;
  padding: 8%;
  pointer-events: none;
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.05em;
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.preview-safe-guides::before,
.preview-safe-guides::after {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 20px;
}

.audio-hud {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 180px;
  display: grid;
  gap: 10px;
}

.audio-pill {
  justify-self: end;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  background: rgba(9, 14, 23, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.audio-meter {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.audio-meter i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--video), var(--accent));
  transition: width 120ms linear;
}

.transport {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr);
}

.transport input[type="range"] {
  width: 100%;
}

.timeline-panel {
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.timeline-copy {
  margin-top: -4px;
}

.timeline-scroll-shell {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
}

.timeline-body {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
}

.timeline-scale {
  padding-left: 48px;
  min-width: fit-content;
}

.timeline-ruler {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(56px, 1fr);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
}

.timeline-ruler span {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 10px;
}

.timeline-track-labels {
  display: grid;
  gap: 12px;
  width: 48px;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 800;
  padding-top: 12px;
}

.timeline-track {
  position: relative;
  display: grid;
  gap: 12px;
  min-width: fit-content;
}

.track-row {
  position: relative;
  min-height: 78px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.track-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.03));
  pointer-events: none;
}

.track-row.drop-active {
  border-color: rgba(255, 184, 116, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255, 184, 116, 0.4);
}

.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #fff4dd, var(--accent));
  box-shadow: 0 0 18px rgba(255, 138, 61, 0.45);
  z-index: 4;
}

.clip-chip {
  position: absolute;
  top: 9px;
  bottom: 9px;
  border-radius: 18px;
  padding: 12px 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.clip-chip.video {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    linear-gradient(135deg, rgba(110, 161, 255, 0.32), rgba(71, 99, 170, 0.26));
}

.clip-chip.title {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(255, 193, 95, 0.38), rgba(255, 138, 61, 0.2));
}

.clip-chip.audio {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(123, 230, 174, 0.32), rgba(99, 164, 255, 0.12));
}

.clip-chip.selected {
  outline: 2px solid rgba(255, 255, 255, 0.72);
}

.clip-chip.dragging {
  opacity: 0.55;
}

.clip-chip strong {
  font-size: 0.92rem;
  letter-spacing: -0.02em;
}

.clip-chip span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
}

.legend-swatch.video {
  background: var(--video);
}

.legend-swatch.title {
  background: var(--title);
}

.legend-swatch.audio {
  background: var(--audio);
}

.media-bin {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.media-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
}

.media-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 138, 61, 0.22), rgba(95, 178, 255, 0.26));
  position: relative;
  overflow: hidden;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-meta {
  min-width: 0;
}

.media-meta h3 {
  font-size: 0.96rem;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.media-meta p {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.add-clip-button {
  grid-column: 1 / -1;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.inspector-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.empty-inspector {
  color: var(--muted);
  line-height: 1.6;
}

.inspector-form {
  display: grid;
  gap: 14px;
}

.inspector-form label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  color: #dbe3ef;
}

.inspector-form input[type="text"],
.inspector-form textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(14, 20, 32, 0.7);
  color: var(--text);
  padding: 12px 14px;
}

.inspector-form input[type="color"] {
  width: 100%;
  min-height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

.toggle-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.toggle-row input {
  width: 20px;
  height: 20px;
}

.field-value {
  color: var(--muted);
  font-size: 0.82rem;
}

.export-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.68);
  backdrop-filter: blur(16px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 20;
}

.export-dialog {
  width: min(700px, 100%);
  border-radius: 30px;
  padding: 24px;
  display: grid;
  gap: 18px;
}

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

.export-stats article {
  padding: 16px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 6px;
}

.export-stats strong {
  font-size: 1.5rem;
}

.export-stats span {
  color: var(--muted);
  font-size: 0.85rem;
}

.hidden {
  display: none;
}

@media (max-width: 1180px) {
  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .center-column {
    order: 1;
  }

  .media-panel {
    order: 2;
  }

  .inspector-panel {
    order: 3;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .brand-block {
    align-items: flex-start;
  }

  .brand-subcopy {
    max-width: none;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .transport,
  .export-actions,
  .timeline-legend,
  .sequence-metrics {
    width: 100%;
    flex-wrap: wrap;
  }

  .sequence-metrics {
    justify-content: flex-start;
  }

  .panel,
  .preview-panel,
  .timeline-panel,
  .export-dialog {
    border-radius: 24px;
  }

  .timeline-track-labels {
    width: 34px;
  }

  .timeline-body {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .timeline-scale {
    padding-left: 34px;
  }

  .stage-topline {
    flex-direction: column;
    align-items: flex-start;
    right: auto;
  }

  .export-stats {
    grid-template-columns: 1fr;
  }
}
