:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --bg-accent: #fdf7ee;
  --panel: #ffffff;
  --border: rgba(20, 32, 54, 0.12);
  --text: #1c1e26;
  --muted: #5f6b7a;
  --accent: #06b6d4;
  --accent-deep: #0e7490;
  --accent-warm: #f97316;
  --accent-soft: rgba(6, 182, 212, 0.18);
  --shadow: 0 20px 50px rgba(25, 38, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #fff9f2 0%, #f4f1ea 45%, #ece6da 100%);
  position: relative;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.glow {
  position: fixed;
  inset: -40% 0 0 0;
  background: radial-gradient(circle at 20% 20%, rgba(6, 182, 212, 0.25), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(249, 115, 22, 0.18), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.035'/></svg>");
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: multiply;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 28px 90px;
}

.hero {
  margin-bottom: 36px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.95rem;
}

.home-link {
  font-weight: 600;
  color: var(--accent-deep);
}

.pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
  font-size: 0.85rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 20px 0 8px;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  margin: 0 0 8px;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
}

.lead {
  font-size: 1.1rem;
  max-width: 720px;
  color: var(--muted);
  margin: 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.panel-head p {
  margin: 0;
  color: var(--muted);
}

.intake {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dropzone {
  border: 2px dashed rgba(6, 182, 212, 0.45);
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(249, 115, 22, 0.08));
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.dropzone.dragover {
  border-color: var(--accent-deep);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(249, 115, 22, 0.12));
  transform: translateY(-2px);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.drop-title {
  font-weight: 600;
}

.drop-sub {
  color: var(--muted);
}

.clip-list {
  display: grid;
  gap: 12px;
}

.clip-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fbfaf7;
}

.clip-name {
  font-weight: 600;
  margin: 0 0 4px;
}

.clip-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.clip-empty {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  color: var(--muted);
}

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

.stat {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg-accent);
  border: 1px solid rgba(20, 32, 54, 0.08);
}

.stat .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 6px;
}

.settings {
  display: grid;
  gap: 10px;
}

.preview {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.video-shell {
  background: #0f172a;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 20px;
  text-align: center;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(2, 6, 23, 0.8));
}

.transport {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.timeline {
  position: relative;
  padding-top: 8px;
}

.timeline-track {
  position: relative;
  height: 58px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.02));
  overflow: hidden;
  cursor: pointer;
}

.timeline-track::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.08),
    rgba(15, 23, 42, 0.08) 1px,
    transparent 1px,
    transparent 30px
  );
  opacity: 0.5;
}

.timeline-range {
  position: absolute;
  top: 8px;
  bottom: 8px;
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(6, 182, 212, 0.8), rgba(249, 115, 22, 0.6));
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.25);
  z-index: 1;
}

.timeline-playhead {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #111827;
  border-radius: 999px;
  z-index: 2;
}

.timeline-playhead::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111827;
  transform: translateX(-50%);
}

.timeline-handle {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 12px;
  border-radius: 999px;
  background: #111827;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.25);
  cursor: ew-resize;
  transform: translateX(-50%);
  z-index: 3;
}

.timeline-handle::after {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 999px;
  color: #fff;
  background: #111827;
  content: "";
  white-space: nowrap;
}

#handle-start {
  background: var(--accent);
  box-shadow: 0 6px 14px rgba(6, 182, 212, 0.35);
}

#handle-start::after {
  content: "IN";
  background: var(--accent-deep);
}

#handle-end {
  background: var(--accent-warm);
  box-shadow: 0 6px 14px rgba(249, 115, 22, 0.35);
}

#handle-end::after {
  content: "OUT";
  background: #c2410c;
}

.timeline-inputs {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 58px;
  pointer-events: none;
}

.timeline-inputs input[type="range"] {
  position: absolute;
  width: 100%;
  height: 58px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: ew-resize;
}

.timeline-inputs input[type="range"]:focus {
  outline: none;
}

.timeline-inputs input[type="range"]::-webkit-slider-runnable-track {
  height: 58px;
  background: transparent;
}

.timeline-inputs input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #111827;
  border: 3px solid #fff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
  cursor: pointer;
  position: relative;
  z-index: 3;
}

#trim-start::-webkit-slider-thumb {
  background: var(--accent);
  box-shadow: 0 10px 20px rgba(6, 182, 212, 0.35);
}

#trim-end::-webkit-slider-thumb {
  background: var(--accent-warm);
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.35);
}

.timeline-inputs input[type="range"]::-moz-range-track {
  height: 58px;
  background: transparent;
}

.timeline-inputs input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #111827;
  border: 3px solid #fff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
  cursor: pointer;
}

#trim-start::-moz-range-thumb {
  background: var(--accent);
  box-shadow: 0 10px 20px rgba(6, 182, 212, 0.35);
}

#trim-end::-moz-range-thumb {
  background: var(--accent-warm);
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.35);
}

#trim-start {
  z-index: 2;
}

#trim-end {
  z-index: 1;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.timeline-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.fine-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(20, 32, 54, 0.1);
  background: #fbfaf7;
}

.fine-control.start {
  border-color: rgba(6, 182, 212, 0.35);
}

.fine-control.end {
  border-color: rgba(249, 115, 22, 0.35);
}

.fine-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.fine-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fine-actions input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(20, 32, 54, 0.15);
  font-size: 0.9rem;
  font-family: inherit;
}

.fine-btn {
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 12px;
}

.export {
  grid-column: 1 / -1;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}

.field input,
.field select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(20, 32, 54, 0.15);
  font-family: inherit;
  font-size: 0.95rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  align-items: center;
}

.primary,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 30px rgba(6, 182, 212, 0.3);
}

.primary:hover {
  transform: translateY(-1px);
  background: #03a9c4;
}

.ghost-btn {
  background: #f3f4f6;
  color: #111827;
  text-decoration: none;
}

.ghost-btn:hover {
  transform: translateY(-1px);
  background: #e5e7eb;
}

.ghost-btn.is-disabled,
.ghost-btn[aria-disabled="true"],
.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--muted);
}

.toggle input {
  width: 18px;
  height: 18px;
}

.status {
  margin-top: 12px;
  font-weight: 600;
}

.status[data-state="working"] {
  color: var(--accent-deep);
}

.status[data-state="error"] {
  color: #c0392b;
}

.progress {
  height: 8px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  transition: width 0.2s ease;
}

.helper {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.future {
  margin-top: 48px;
}

.future-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

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

.future-card {
  padding: 20px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.future-card p {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.15);
  color: #c2410c;
  font-size: 0.75rem;
  font-weight: 600;
}

.is-hidden {
  display: none;
}

@media (max-width: 1024px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

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

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

  .timeline-controls {
    grid-template-columns: 1fr;
  }
}
