:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #1a1a26;
  --fg: #e8e8f0;
  --fg-muted: #8888a0;
  --accent: #b4ff39;
  --accent-dim: rgba(180, 255, 57, 0.12);
  --accent-glow: rgba(180, 255, 57, 0.25);
  --magenta: #ff3c8e;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --max-w: 1120px;
}

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

html { scroll-behavior: smooth; }

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

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 24px 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 60, 142, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(180, 255, 57, 0.2);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 32px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 780px;
  margin-bottom: 24px;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero .lede {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--fg-muted);
  max-width: 540px;
  line-height: 1.7;
}

.hero-visual {
  margin-top: 56px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.clip-mockup {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  max-width: 200px;
}

.clip-mockup .bar {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--magenta));
}

.clip-mockup .bar.short { width: 60%; }
.clip-mockup .bar.med { width: 85%; }
.clip-mockup .bar.long { width: 100%; }

.clip-mockup .label {
  font-size: 0.7rem;
  color: var(--fg-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== HOW IT WORKS ===== */
.how {
  padding: 100px 24px;
  background: var(--bg-elevated);
}

.how-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 16px;
}

.how h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 56px;
  max-width: 600px;
}

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

.step {
  position: relative;
  padding: 32px 28px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 20px;
  transition: border-color 0.3s;
}

.step:hover {
  border-color: rgba(180, 255, 57, 0.2);
}

.step-num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: rgba(180, 255, 57, 0.15);
  line-height: 1;
  margin-bottom: 16px;
}

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

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

/* ===== FEATURES ===== */
.features {
  padding: 100px 24px;
}

.features-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.features h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 56px;
  max-width: 500px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.feature-card {
  padding: 36px 32px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 20px;
  transition: transform 0.25s, border-color 0.3s;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(180, 255, 57, 0.15);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.fi-clip { background: var(--accent-dim); }
.fi-caption { background: rgba(255, 60, 142, 0.12); }
.fi-frame { background: rgba(100, 140, 255, 0.12); }
.fi-score { background: rgba(255, 180, 40, 0.12); }

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
}

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

/* ===== PLATFORMS ===== */
.platforms {
  padding: 80px 24px;
  background: var(--bg-elevated);
  text-align: center;
}

.platforms-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.platforms h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}

.platform-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.platform-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.platform-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  transition: border-color 0.3s;
}

.platform-icon:hover {
  border-color: var(--accent);
}

.platform-item span {
  font-size: 0.82rem;
  color: var(--fg-muted);
  font-weight: 500;
}

/* ===== CLOSING ===== */
.closing {
  padding: 120px 24px;
  text-align: center;
  position: relative;
}

.closing::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.4;
}

.closing-inner {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.closing h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.closing h2 .accent { color: var(--accent); }

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

/* ===== FOOTER ===== */
.footer {
  padding: 40px 24px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer p {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.footer .brand {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--fg);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  .hero-visual {
    flex-direction: column;
    align-items: stretch;
  }

  .clip-mockup {
    max-width: 100%;
  }

  .platform-row {
    gap: 24px;
  }
}

/* ===== URL INPUT FORM ===== */
.clip-form {
  margin: 40px 0 0;
  max-width: 680px;
}

.clip-input-wrap {
  display: flex;
  gap: 0;
  border: 1.5px solid rgba(180, 255, 57, 0.3);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.clip-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.clip-url-input {
  flex: 1;
  padding: 16px 20px;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.97rem;
  font-family: var(--font-body);
  color: var(--fg);
}

.clip-url-input::placeholder {
  color: var(--fg-muted);
}

.clip-submit-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--accent);
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: #0a0a0f;
  transition: background 0.2s, opacity 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.clip-submit-btn:hover:not(:disabled) {
  background: #c9ff4d;
}

.clip-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-arrow {
  font-size: 1.1rem;
}

.clip-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-box {
  text-align: center;
  padding: 48px 56px;
  background: var(--bg-card);
  border: 1px solid rgba(180, 255, 57, 0.15);
  border-radius: 24px;
  max-width: 400px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(180, 255, 57, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}

.loading-sub {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* ===== RESULTS SECTION ===== */
.results-section {
  padding: 80px 24px;
  background: var(--bg-elevated);
}

.results-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.results-header {
  margin-bottom: 48px;
}

.results-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.results-sub {
  font-size: 0.88rem;
  color: var(--fg-muted);
  word-break: break-all;
}

/* Clips grid — 2 columns desktop, 1 mobile */
.clips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

/* Each card is horizontal: vertical embed on left, meta on right */
.clip-card-inner {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  transition: border-color 0.3s, transform 0.25s;
}

.clip-card-inner:hover {
  border-color: rgba(180, 255, 57, 0.2);
  transform: translateY(-2px);
}

/* Vertical 9:16 iframe wrapper */
.clip-embed-wrap {
  flex-shrink: 0;
  width: 120px;
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.clip-embed-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.clip-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.clip-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.clip-number {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.clip-duration {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.clip-score {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-display);
  margin-left: auto;
}

.clip-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg);
}

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

.clip-caption-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px 12px;
}

.clip-caption-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.clip-caption-text {
  font-size: 0.82rem;
  color: var(--fg-muted);
  line-height: 1.55;
}

.clip-watch-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(180, 255, 57, 0.2);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  align-self: flex-start;
  margin-top: auto;
}

.clip-watch-btn:hover {
  background: rgba(180, 255, 57, 0.2);
  border-color: var(--accent);
}

.error-state {
  grid-column: 1 / -1;
  padding: 40px;
  text-align: center;
  color: var(--fg-muted);
  background: var(--bg-card);
  border: 1px solid rgba(255, 60, 142, 0.2);
  border-radius: 16px;
  font-size: 0.95rem;
}

.try-another-btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.try-another-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

@media (max-width: 600px) {
  .clip-card-inner {
    flex-direction: column;
  }

  .clip-embed-wrap {
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 320px;
  }

  .clip-input-wrap {
    flex-direction: column;
    border-radius: 12px;
  }

  .clip-submit-btn {
    justify-content: center;
    border-radius: 0 0 10px 10px;
  }
}