:root {
  --primary: #6c4cf1;
  --text: #1d1b2c;
  --muted: #646177;
  --bg: #ffffff;
  --bg-alt: #f6f5fb;
  --card: #ffffff;
  --border: #e6e4ef;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 16, 50, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
img { max-width: 100%; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 780px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 20px; }
.brand img { max-height: 40px; width: auto; display: block; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--primary); }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav-links a:hover { color: var(--primary); }
@media (max-width: 600px) { .nav-links a:not(:last-child) { display: none; } }

/* Hero */
.hero {
  background:
    radial-gradient(1000px 400px at 10% -10%, rgba(255, 255, 255, .25), transparent 60%),
    linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #ff3d77));
  color: #fff;
  padding: 56px 0 64px;
}
.hero-inner { text-align: center; }
.hero h1 { font-size: clamp(26px, 4.4vw, 42px); line-height: 1.2; margin: 0 0 12px; font-weight: 800; }
.hero-sub { margin: 0 auto 28px; max-width: 620px; opacity: .92; font-size: 17px; }

.dl-form { display: flex; gap: 10px; max-width: 760px; margin: 0 auto; background: #fff; padding: 8px; border-radius: 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, .18); }
.input-wrap { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; padding-left: 12px; }
.input-icon { color: #9a97ab; flex: none; }
.input-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 16px; padding: 14px 4px; color: var(--text); background: transparent; }
.paste-btn { flex: none; border: 1px solid var(--border); background: var(--bg-alt); color: var(--text); border-radius: 10px; padding: 8px 14px; font-weight: 600; cursor: pointer; font-size: 14px; }
.paste-btn:hover { border-color: var(--primary); color: var(--primary); }
.submit-btn { flex: none; border: 0; border-radius: 12px; padding: 0 30px; font-size: 17px; font-weight: 700; color: #fff; background: var(--primary); cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 52px; transition: filter .15s; }
.submit-btn:hover { filter: brightness(1.08); }
.submit-btn:disabled { cursor: wait; opacity: .85; }
.spinner { display: none; width: 18px; height: 18px; border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.submit-btn.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .dl-form { flex-direction: column; }
  .input-wrap { padding: 0 4px 0 10px; }
  .submit-btn { justify-content: center; }
}
.dl-error { max-width: 760px; margin: 14px auto 0; background: #fff1f2; color: #b4232f; border-radius: 12px; padding: 12px 16px; font-weight: 500; }
.platforms { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.platforms li { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; padding: 4px 14px; font-size: 14px; }

/* Ads */
.ad { margin: 24px auto; text-align: center; overflow: hidden; max-width: 100%; }
.ad:empty { display: none; }

/* Resultado */
.result { margin: 28px 0; }
.result-card { display: grid; grid-template-columns: 260px 1fr; gap: 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.result-media { position: relative; border-radius: 12px; overflow: hidden; background: var(--bg-alt); aspect-ratio: 9 / 12; }
.result-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-media.no-thumb { aspect-ratio: 16 / 9; }
.duration { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 13px; border-radius: 6px; padding: 2px 8px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, #fff); border-radius: 999px; padding: 3px 10px; }
.result-author { margin: 10px 0 4px; font-size: 20px; word-break: break-word; }
.result-title { margin: 0 0 18px; color: var(--muted); word-break: break-word; }
.result-buttons { display: grid; gap: 10px; }
.dl-btn { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: #fff; background: var(--primary); border-radius: 12px; padding: 14px 18px; font-weight: 700; transition: transform .1s, filter .15s; }
.dl-btn:hover { filter: brightness(1.08); }
.dl-btn:active { transform: scale(.99); }
.dl-btn small { opacity: .8; font-weight: 600; }
.dl-btn.dl-audio { background: #17a673; }
.dl-btn.dl-image { background: #2f7de1; }
.dl-btn.dl-video-alt { background: #fff; color: var(--text); border: 1px solid var(--border); }
.again-btn { margin-top: 14px; background: none; border: 0; color: var(--primary); font-weight: 600; cursor: pointer; padding: 6px 0; font-size: 15px; }
@media (max-width: 680px) {
  .result-card { grid-template-columns: 1fr; }
  .result-media { max-width: 260px; margin: 0 auto; width: 100%; }
}

/* Secciones */
.section { padding: 56px 0; }
.section.alt { background: var(--bg-alt); }
.section-title { text-align: center; font-size: clamp(22px, 3vw, 30px); margin: 0 0 32px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.step h3 { margin: 12px 0 6px; font-size: 18px; }
.step p { margin: 0; color: var(--muted); }
.step-n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 800; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px; }
.feature { background: var(--card); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); }
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }
.about { max-width: 780px; margin: 0 auto; }
.about h2 { font-size: 24px; }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) { .features { grid-template-columns: 1fr; } }

.faq-item { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; background: var(--card); }
.faq-item summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; position: relative; padding-right: 44px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 18px; top: 12px; font-size: 22px; color: var(--primary); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0; padding: 0 18px 16px; color: var(--muted); }

.prose h1 { font-size: 30px; margin-top: 0; }
.prose p, .prose li { color: #3b3850; }

/* Footer */
.site-footer { background: #15131f; color: #b9b6c8; padding: 32px 0; text-align: center; font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-bottom: 10px; }
.footer-links a { color: #fff; text-decoration: none; }
.site-footer p { margin: 0; }
