:root {
  --bg: #f5f8ff;
  --surface: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --primary: #6d28d9;
  --primary-strong: #5b21b6;
  --ring: rgba(109, 40, 217, 0.25);
  --border: #e5e7eb;
  --success: #16a34a;
  --error: #dc2626;
  --shadow: 0 20px 45px -30px rgba(17, 24, 39, 0.5);
}

body.dark {
  --bg: #0b1020;
  --surface: #111827;
  --text: #f3f4f6;
  --muted: #cbd5e1;
  --primary: #8b5cf6;
  --primary-strong: #7c3aed;
  --ring: rgba(139, 92, 246, 0.35);
  --border: #1f2937;
  --shadow: 0 20px 45px -30px rgba(0, 0, 0, 0.75);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, rgba(109, 40, 217, 0.1), transparent 42%), var(--bg);
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
}

.nav-actions {
  display: flex;
  gap: 18px;
  align-items: center;
}

.nav-actions a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.nav-actions a:hover {
  color: var(--text);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.hero {
  padding: 64px 0 48px;
}

.hero-grid {
  display: grid;
  gap: 32px;
  align-items: start;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  background: rgba(109, 40, 217, 0.12);
  color: var(--primary);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

h1, h2, h3 {
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  margin-bottom: 14px;
}

.hero-copy p {
  color: var(--muted);
  margin-top: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.chips span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.converter-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-subtext {
  margin-top: -4px;
  color: var(--muted);
}

label {
  display: block;
  margin: 14px 0 8px;
  font-weight: 600;
}

.input-wrap {
  display: flex;
  gap: 8px;
}

input[type="url"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  background: var(--surface);
  color: var(--text);
}

input[type="url"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.ghost-btn,
.primary-btn {
  border: none;
  border-radius: 12px;
  font: inherit;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.ghost-btn {
  border: 1px solid var(--border);
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
}

.primary-btn {
  margin-top: 12px;
  width: 100%;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), #3b82f6);
  padding: 12px 16px;
}

.ghost-btn:hover,
.primary-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.status-region {
  min-height: 24px;
  margin-top: 12px;
  font-weight: 500;
}

.status-region.error {
  color: var(--error);
}

.status-region.success {
  color: var(--success);
}

.progress-shell {
  margin-top: 10px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
  transition: width 0.28s ease;
}

.video-preview {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

.video-preview img {
  width: 100%;
  border-radius: 8px;
}

.video-preview h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.video-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.download-link {
  margin-top: 14px;
  display: inline-flex;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 12px;
  background: #16a34a;
  color: #fff;
  font-weight: 700;
  transition: filter 0.2s ease;
}

.download-link:hover {
  filter: brightness(1.05);
}

.section {
  padding: 56px 0;
}

.section-alt {
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.feature-grid,
.faq-list {
  display: grid;
  gap: 14px;
}

.feature-grid article,
.faq-list article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.feature-grid p,
.faq-list p {
  margin: 0;
  color: var(--muted);
}

.steps {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 14px;
}

.steps p {
  margin: 4px 0 0;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .faq-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .nav-actions a {
    display: none;
  }

  .hero {
    padding-top: 42px;
  }

  .converter-card {
    padding: 18px;
  }

  .input-wrap {
    flex-direction: column;
  }

  .ghost-btn {
    min-height: 42px;
  }
}
