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

:root {
  --bg: #0a0a0f;
  --bg-elevated: rgba(255, 255, 255, 0.04);
  --bg-card: rgba(18, 18, 28, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --accent: #ff0033;
  --accent-hover: #ff1a4a;
  --accent-glow: rgba(255, 0, 51, 0.35);
  --gradient: linear-gradient(135deg, #ff0033 0%, #ff6b35 50%, #ff0033 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

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

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.bg-glow--1 {
  width: 600px;
  height: 600px;
  background: rgba(255, 0, 51, 0.15);
  top: -200px;
  left: -100px;
}

.bg-glow--2 {
  width: 500px;
  height: 500px;
  background: rgba(255, 107, 53, 0.1);
  bottom: -150px;
  right: -100px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}

.logo__icon {
  width: 36px;
  height: 36px;
  background: var(--gradient);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
}

.logo__icon svg {
  width: 22px;
  height: 22px;
}

.logo__text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* Main */
main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.hero__badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
}

.download-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 640px;
  margin: 0 auto;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon svg {
  width: 20px;
  height: 20px;
}

.input-group input {
  width: 100%;
  padding: 1.1rem 3rem 1.1rem 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.input-group input:focus {
  border-color: rgba(255, 0, 51, 0.5);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.btn-clear {
  position: absolute;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}

.btn-clear:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.1rem 2rem;
  background: var(--gradient);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--accent-glow);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.status-panel {
  max-width: 640px;
  margin: 1.5rem auto 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 0, 51, 0.25);
  border-radius: var(--radius);
  text-align: left;
  animation: fadeUp 0.3s ease;
}

.status-panel__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.status-panel__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 0, 51, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.status-panel--done .status-panel__spinner,
.status-panel--error .status-panel__spinner {
  display: none;
}

.status-panel__title {
  font-weight: 600;
  font-size: 0.95rem;
}

.status-panel__bar {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.status-panel__fill {
  height: 100%;
  width: 0%;
  background: var(--gradient);
  border-radius: 100px;
  transition: width 0.3s ease;
}

.status-panel--indeterminate .status-panel__fill {
  width: 40% !important;
  animation: indeterminate 1.2s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.status-panel__message {
  font-size: 0.9rem;
  color: var(--text);
}

.status-panel__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.status-panel--error {
  border-color: rgba(255, 0, 51, 0.5);
}

.status-panel--error .status-panel__fill {
  background: #666;
}

.status-panel--done .status-panel__fill {
  width: 100% !important;
}

.disclaimer {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* Results */
.results {
  margin-bottom: 4rem;
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.video-preview {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  align-items: flex-start;
}

.video-preview img {
  width: 180px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.video-preview__meta h2 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.video-preview__meta p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.formats h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.formats__grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.formats__group-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.formats__grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.format-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.format-btn:hover:not(:disabled) {
  border-color: rgba(255, 0, 51, 0.4);
  background: rgba(255, 0, 51, 0.08);
}

.format-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.format-btn__label {
  font-weight: 600;
  font-size: 0.95rem;
}

.format-btn__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.format-btn--loading .format-btn__label::after {
  content: " …";
}

.btn-secondary {
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.9rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* Sections */
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

.how-to,
.features,
.faq {
  padding: 4rem 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
}

.step__num {
  width: 44px;
  height: 44px;
  margin: 0 auto 1rem;
  background: var(--gradient);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.step h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.step p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform var(--transition), border-color var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 0, 51, 0.25);
}

.feature-card__icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

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

.faq__list {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq__item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq__item summary {
  padding: 1.1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition);
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

.faq__item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.faq__item[open] summary::after {
  transform: rotate(45deg);
}

.faq__item summary:hover {
  background: var(--bg-elevated);
}

.faq__item p {
  padding: 0 1.25rem 1.1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  background: rgba(10, 10, 15, 0.6);
}

.footer__brand {
  margin-bottom: 1.25rem;
}

.footer__brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.footer__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color var(--transition);
}

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

.footer__copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1c1c28;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 200;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  max-width: 90vw;
}

.toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast--error {
  border-color: rgba(255, 0, 51, 0.4);
}

/* Mobile */
@media (max-width: 768px) {
  .header {
    padding: 1rem 1.25rem;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 10, 15, 0.95);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
  }

  .nav--open {
    display: flex;
  }

  .nav a {
    padding: 0.85rem 1.25rem;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .video-preview {
    flex-direction: column;
  }

  .video-preview img {
    width: 100%;
  }
}
