/* ── Design System ────────────────────────────────────────────────────────── */
:root {
  --bg: #030310;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --text-dim: #94a3b8;
  --accent1: #8b5cf6;
  /* Violet */
  --accent2: #06b6d4;
  /* Cyan */
  --accent3: #ec4899;
  /* Pink */
  --radius: 24px;
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --glass: blur(16px) saturate(180%);
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-family: 'Inter', sans-serif;
}

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

/* ── Decorative Background ───────────────────────────────────────────────── */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 50vw;
  height: 50vw;
  filter: blur(100px);
  opacity: 0.15;
  border-radius: 50%;
  animation: blob-float 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

.blob-1 {
  background: var(--accent1);
  top: -10%;
  left: -10%;
}

.blob-2 {
  background: var(--accent2);
  bottom: -10%;
  right: -10%;
  animation-delay: -5s;
}

.blob-3 {
  background: var(--accent3);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.1;
}

@keyframes blob-float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(50px, 30px) scale(1.1);
  }
}

/* ── Typography & Gradients ──────────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--accent1), var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h1,
h2,
h3 {
  letter-spacing: -0.02em;
  font-weight: 800;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 20px 0;
  z-index: 100;
  background: rgba(3, 3, 16, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 800;
  text-decoration: none;
  color: #fff;
}

.nav-logo .icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent2);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  width: 100%;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
section {
  padding: 100px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@keyframes title-pop {
  0% {
    transform: scale(0.9);
    opacity: 0;
    filter: blur(10px);
  }

  100% {
    transform: scale(1);
    opacity: 1;
    filter: blur(0);
  }
}

.hero h1 {
  animation: title-pop 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding-top: 180px;
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent1);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1;
  margin-bottom: 24px;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto 48px;
}

/* ── Search Section ──────────────────────────────────────────────────────── */
.search-container {
  max-width: 700px;
  margin: 0 auto;
}

.search-box {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 10px;
  gap: 10px;
  backdrop-filter: var(--glass);
  box-shadow: var(--shadow-lg);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.search-box:focus-within {
  border-color: var(--accent2);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.15);
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  padding: 0 20px;
  font-size: 1.1rem;
}

#fetchBtn {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  border: none;
  padding: 14px 40px;
  border-radius: 100px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

#fetchBtn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

#fetchBtn:active {
  transform: scale(0.98);
}

/* ── Video Card ──────────────────────────────────────────────────────────── */
.video-card {
  margin-top: 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: var(--glass);
  display: flex;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--shadow-lg);
}

.card-thumb {
  width: 40%;
  position: relative;
  overflow: hidden;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-thumb .duration {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.8);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.card-details {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-details h2 {
  font-size: 1.5rem;
  line-height: 1.3;
}

.stats-row {
  display: flex;
  gap: 24px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.format-box select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #fff;
  padding: 12px;
  border-radius: 12px;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.btn-download {
  background: linear-gradient(135deg, var(--accent2), #0ea5e9);
  border: none;
  padding: 16px;
  border-radius: 14px;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 10px 20px -5px rgba(6, 182, 212, 0.3);
}

.btn-download:hover {
  transform: translateY(-3px);
}

/* ── Features ────────────────────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 40px;
  border-radius: var(--radius);
  transition: transform 0.3s, background 0.3s;
}

.feature-card:hover {
  transform: translateY(-10px);
  background: var(--surface-hover);
}

.feature-icon {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.feature-card h3 {
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ── How It Works ────────────────────────────────────────────────────────── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 60px;
  max-width: 800px;
  margin: 0 auto;
}

.step-item {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.step-num {
  width: 60px;
  height: 60px;
  min-width: 60px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
}

.step-content h3 {
  margin-bottom: 8px;
  font-size: 1.4rem;
}

.step-content p {
  color: var(--text-dim);
}

/* ── FAQ ─────────────────────────────────────────────────────────────────── */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.faq-q {
  padding: 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
}

.faq-a .inner {
  padding: 0 24px 24px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.faq-item.active .faq-a {
  max-height: 200px;
}

.faq-item.active .faq-q svg {
  transform: rotate(180deg);
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 80px 40px 40px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 60px;
}

.footer-brand h2 {
  margin-bottom: 16px;
}

.footer-brand p {
  color: var(--text-dim);
  max-width: 300px;
  margin-bottom: 24px;
}

.footer-links h4 {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-dim);
  transition: 0.3s;
}

.footer-links a:hover {
  color: var(--accent2);
}

.footer-bottom {
  max-width: 1200px;
  margin: 60px auto 0;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .video-card {
    flex-direction: column;
  }

  .card-thumb {
    width: 100%;
    height: 250px;
  }

  .footer-content {
    grid-template-columns: 1fr 1fr;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .nav-container {
    padding: 0 20px;
  }

  .hero {
    padding-top: 140px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.hidden {
  display: none !important;
}

.error-msg {
  color: var(--accent3);
  margin-top: 12px;
  text-align: center;
}

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.modal-content {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 40px;
  border-radius: 32px;
  max-width: 450px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 8px;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text);
  transform: rotate(90deg);
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.modal-body h2 {
  font-size: 2rem;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-body p {
  color: var(--text-dim);
  margin-bottom: 30px;
  font-size: 1.1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  border: none;
  padding: 14px 40px;
  border-radius: 100px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}