:root {
  --bg: #0b0b0f;
  --bg-soft: #101017;
  --surface: #15151d;
  --surface-2: #1c1c26;
  --border: #26262f;
  --text: #f4f4f7;
  --muted: #9a9aa8;
  --accent: #ff2d55;
  --accent-2: #e60023;
  --ok: #29c46b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 50% -180px, rgba(255, 45, 85, 0.22), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 22px; height: 22px;
  border-radius: 7px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 22px rgba(255, 45, 85, 0.55);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--muted);
}

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

.ghost-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

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

/* ------------------------------------------------------------------ hero */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.hero {
  text-align: center;
  padding: 56px 0 8px;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 22px auto 14px;
  max-width: 18ch;
  font-size: clamp(2.1rem, 5.4vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, #ff5c78, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 56ch;
  margin: 0 auto 34px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ form */

.url-form {
  display: flex;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.field-icon {
  position: absolute;
  left: 16px;
  width: 18px; height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  pointer-events: none;
}

.field input {
  width: 100%;
  padding: 14px 42px 14px 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
}

.field input::placeholder { color: #6d6d7a; }

.icon-btn {
  position: absolute;
  right: 10px;
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover { color: var(--text); }

.primary-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  white-space: nowrap;
}

.primary-btn:hover:not(:disabled) { filter: brightness(1.08); }
.primary-btn:active:not(:disabled) { transform: translateY(1px); }
.primary-btn:disabled { opacity: 0.65; cursor: progress; }

.spinner {
  display: none;
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.is-loading .spinner { display: block; }
.is-loading .label { opacity: 0.8; }

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

.form-note {
  min-height: 24px;
  margin: 14px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.form-note.error { color: #ff7089; }

/* ---------------------------------------------------------------- result */

.result {
  margin-top: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.result-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 26px;
  padding: 26px;
}

.thumb {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  aspect-ratio: 3 / 4;
}

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

.thumb-badge {
  position: absolute;
  left: 10px; top: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(4px);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.result h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.byline {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.byline.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 18px;
}

.chip {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.78rem;
  color: var(--muted);
}

.downloads { display: grid; gap: 8px; }

.download-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.download-row .quality {
  font-weight: 600;
  font-size: 0.95rem;
}

.download-row .detail {
  color: var(--muted);
  font-size: 0.8rem;
}

.dl-btn {
  flex: none;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dl-btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.dl-btn.subtle { font-weight: 500; color: var(--muted); }
.dl-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.preview-btn {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.preview-btn:hover { color: var(--text); }

/* ----------------------------------------------------------- steps, etc. */

.steps, .faq { margin-top: 84px; }

.steps h2,
.faq h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.step-grid li {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  margin-bottom: 14px;
  border-radius: 9px;
  background: rgba(255, 45, 85, 0.14);
  color: #ff7d95;
  font-weight: 700;
  font-size: 0.9rem;
}

.step-grid h3,
.features h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.step-grid p,
.features p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 0.85em;
}

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

.features article {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 16px 18px;
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 550;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.faq summary::after {
  content: "+";
  color: var(--muted);
}

.faq details[open] summary::after { content: "–"; }

.faq details p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px 40px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer p { margin: 4px 0; }

.muted { color: #6d6d7a; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .result-grid { grid-template-columns: 1fr; }
  .thumb { max-width: 240px; aspect-ratio: 3 / 4; }
  .step-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .site-nav a:not(.ghost-btn) { display: none; }
}

@media (max-width: 620px) {
  .url-form { flex-direction: column; border-radius: var(--radius); padding: 10px; }
  .field input { padding: 12px 42px 12px 42px; }
  .primary-btn { justify-content: center; }
  .features { grid-template-columns: 1fr; }
  .hero { padding-top: 32px; }
  .download-row { flex-direction: column; align-items: stretch; }
  .dl-btn { width: 100%; }
}
