:root {
  --bg: #08090d;
  --bg-surface: #0f1117;
  --bg-card: #14161f;
  --fg: #e8e9ed;
  --fg-muted: #8b8d97;
  --fg-dim: #5c5e66;
  --accent-1: #6366f1;
  --accent-2: #a855f7;
  --accent-3: #ec4899;
  --border: rgba(255,255,255,0.06);
  --border-accent: rgba(99,102,241,0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.section-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-label {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* NAV */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* HERO */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, rgba(168,85,247,0.06) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 24px 40px;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent-2);
  border: 1px solid rgba(168,85,247,0.3);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 32px;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--fg-muted);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
}

/* HERO VISUAL */
.hero-visual {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 60px 24px 80px;
  flex-wrap: wrap;
}

.visual-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-long {
  width: 200px;
  text-align: center;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.6;
}

.card-label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 12px;
}

.card-bar {
  height: 4px;
  background: var(--bg-surface);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  width: 65%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border-radius: 4px;
  animation: barPulse 2s ease-in-out infinite;
}

@keyframes barPulse {
  0%, 100% { opacity: 0.7; width: 55%; }
  50% { opacity: 1; width: 75%; }
}

.visual-arrow {
  flex-shrink: 0;
}

.visual-clips {
  display: flex;
  gap: 12px;
}

.card-clip {
  width: 100px;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.3s ease;
}

.card-clip:hover {
  transform: translateY(-4px);
}

.c1 { border-color: var(--border-accent); }
.c2 { border-color: rgba(168,85,247,0.3); }
.c3 { border-color: rgba(236,72,153,0.3); }

.clip-tag {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}

.clip-score {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-2);
}

/* PROCESS */
.process {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.process-grid {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 48px;
}

.process-step {
  flex: 1;
  padding: 0 24px;
}

.process-connector {
  width: 1px;
  height: 80px;
  background: linear-gradient(180deg, var(--accent-1), transparent);
  flex-shrink: 0;
  margin-top: 16px;
}

.step-num {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.4;
  margin-bottom: 16px;
}

.process-step h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.process-step p {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* FEATURES */
.features {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.features-intro {
  font-size: 1.15rem;
  color: var(--fg-muted);
  max-width: 560px;
  margin-bottom: 48px;
  line-height: 1.7;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: border-color 0.3s ease;
}

.feature-card:hover {
  border-color: var(--border-accent);
}

.feature-highlight {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(168,85,247,0.04));
  border-color: var(--border-accent);
}

.feature-icon {
  font-size: 1.4rem;
  margin-bottom: 16px;
  opacity: 0.7;
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* NUMBERS */
.numbers {
  padding: 80px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.numbers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.number-value {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.number-label {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* CLOSING */
.closing {
  padding: 120px 0;
  text-align: center;
}

.closing-content {
  max-width: 640px;
  margin: 0 auto;
}

.closing h2 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.closing p {
  font-size: 1.1rem;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.closing-tagline {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--fg) !important;
  font-size: 1rem !important;
  letter-spacing: 0.02em;
  margin-top: 24px !important;
}

/* FOOTER */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-dim);
}

.footer-links span {
  font-size: 0.8rem;
  color: var(--fg-dim);
}

/* MOBILE */
@media (max-width: 768px) {
  .hero-content { padding: 48px 20px 24px; }
  .hero-visual { flex-direction: column; gap: 16px; padding: 32px 20px 60px; }
  .visual-arrow { transform: rotate(90deg); }
  .visual-clips { gap: 8px; }
  .card-clip { width: 85px; height: 120px; }
  .process-grid { flex-direction: column; gap: 32px; }
  .process-connector { width: 60px; height: 1px; background: linear-gradient(90deg, var(--accent-1), transparent); margin: 0 auto; }
  .features-grid { grid-template-columns: 1fr; }
  .feature-highlight { grid-column: span 1; }
  .numbers-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 480px) {
  .card-long { width: 160px; }
  .numbers-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   SHARED BUTTON COMPONENTS
   ═══════════════════════════════════════════════════════════ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-full { width: 100%; }

.btn-secondary {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.btn-secondary:hover { border-color: var(--border-accent); color: var(--fg); }

.btn-nav {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-1);
  background: rgba(99,102,241,0.08);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  padding: 7px 18px;
  text-decoration: none;
  transition: background 0.2s ease;
}
.btn-nav:hover { background: rgba(99,102,241,0.15); }

/* Hero CTA row */
.hero-cta {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
  margin-top: 36px;
  flex-wrap: wrap;
}
.btn-hero { font-size: 1.05rem; padding: 16px 36px; }
.hero-cta-note {
  font-size: 0.82rem;
  color: var(--fg-dim);
}

/* ═══════════════════════════════════════════════════════════
   APP LAYOUT (shared by upload + clips pages)
   ═══════════════════════════════════════════════════════════ */

.app-page { background: var(--bg); min-height: 100vh; }

.app-nav {
  border-bottom: 1px solid var(--border);
  background: rgba(8,9,13,0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.app-nav .logo { text-decoration: none; }

/* ═══════════════════════════════════════════════════════════
   UPLOAD PAGE
   ═══════════════════════════════════════════════════════════ */

.upload-main {
  position: relative;
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 24px 80px;
}

.upload-hero-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, rgba(168,85,247,0.05) 40%, transparent 70%);
  pointer-events: none;
}

.upload-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
}

.upload-header {
  text-align: center;
  margin-bottom: 36px;
}
.upload-header .hero-badge { margin-bottom: 20px; }
.upload-header .section-label { margin-bottom: 14px; }
.upload-sub {
  font-size: 1rem;
  color: var(--fg-muted);
  line-height: 1.7;
}

.upload-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(236,72,153,0.08);
  border: 1px solid rgba(236,72,153,0.25);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: #f8a9c8;
}
.error-icon { flex-shrink: 0; font-size: 1rem; margin-top: 1px; }

.upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  margin-bottom: 20px;
  position: relative;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--border-accent);
  background: rgba(99,102,241,0.03);
}
.file-input-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  /* Placed behind the inner content so the button still works */
  pointer-events: none;
}
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dropzone-icon { margin-bottom: 4px; }
.dropzone-label {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
}
.dropzone-sub { font-size: 0.82rem; color: var(--fg-dim); }
.file-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,102,241,0.1);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--fg);
  max-width: 100%;
  overflow: hidden;
}
.file-icon { flex-shrink: 0; }

/* OR divider */
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--fg-dim);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}
.or-divider::before, .or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* URL input */
.url-input-wrap { margin-bottom: 24px; }
.url-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s ease;
}
.url-input:focus { border-color: var(--border-accent); }
.url-input::placeholder { color: var(--fg-dim); }

.upload-footnote {
  text-align: center;
  font-size: 0.78rem;
  color: var(--fg-dim);
  margin-top: 18px;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════
   CLIPS RESULTS PAGE
   ═══════════════════════════════════════════════════════════ */

.clips-main {
  position: relative;
  padding: 48px 24px 100px;
}
.clips-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 65%);
  pointer-events: none;
}

.clips-container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
}

.clips-header {
  margin-bottom: 40px;
}
.clips-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.clips-filename {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--fg-muted);
}
.clips-filename-text {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clips-status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  color: #4ade80;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 100px;
  padding: 5px 14px;
}
.status-dot {
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.clips-header .section-label { margin-bottom: 10px; }
.clips-sub {
  font-size: 1rem;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 580px;
}

/* Grid */
.clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.clip-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.clip-result-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.clip-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Platform badges */
.clip-platform-badge {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 100px;
  text-transform: uppercase;
}
.platform-tiktok {
  background: rgba(99,102,241,0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.25);
}
.platform-reel {
  background: rgba(168,85,247,0.12);
  color: #d8b4fe;
  border: 1px solid rgba(168,85,247,0.25);
}
.platform-short {
  background: rgba(236,72,153,0.12);
  color: #f9a8d4;
  border: 1px solid rgba(236,72,153,0.25);
}

/* Score ring */
.clip-score-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.score-ring {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--accent-1) 0%,
    var(--accent-2) var(--score),
    var(--bg-surface) var(--score)
  );
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-ring::before {
  content: '';
  position: absolute;
  inset: 5px;
  background: var(--bg-card);
  border-radius: 50%;
}
.score-value {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fg);
}
.score-label {
  font-size: 0.65rem;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
}

.clip-num {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--fg-dim);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.clip-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 10px;
}
.clip-timing {
  font-size: 0.78rem;
  color: var(--fg-muted);
  font-family: monospace;
  background: var(--bg-surface);
  display: inline-flex;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 18px;
}
.clip-duration { color: var(--fg-dim); }

.clip-section-label {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
  margin-top: 16px;
}

.clip-caption-wrap, .clip-hashtags-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  position: relative;
}
.clip-caption {
  font-size: 0.88rem;
  color: var(--fg);
  line-height: 1.55;
  padding-right: 60px;
}
.clip-hashtags {
  font-size: 0.82rem;
  color: var(--accent-1);
  line-height: 1.6;
  word-break: break-word;
  padding-right: 60px;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--fg-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.copy-btn:hover { color: var(--fg); border-color: var(--border-accent); }
.copy-btn.copied { color: #4ade80; border-color: rgba(74,222,128,0.3); }

/* Empty state */
.clips-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--fg-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 20px; }
.clips-empty a { color: var(--accent-1); }

.clips-cta {
  text-align: center;
  padding-top: 16px;
}

/* Responsive */
@media (max-width: 600px) {
  .upload-card { padding: 20px; }
  .clips-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; gap: 12px; }
  .btn-hero { width: 100%; text-align: center; }
}