:root {
  --bg: #08080d;
  --bg-soft: #0d0d15;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f2f7;
  --muted: #a1a1b5;
  --faint: #6f6f85;
  --brand: #7c6cff;
  --brand-2: #22d3ee;
  --brand-soft: rgba(124, 108, 255, 0.16);
  --ok: #34d399;
  --err: #fb7185;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  --wrap: 1140px;
  --grad: linear-gradient(100deg, #a78bfa 0%, #7c6cff 38%, #22d3ee 100%);
}

[data-theme='light'] {
  --bg: #f7f7fb;
  --bg-soft: #ffffff;
  --surface: rgba(15, 15, 30, 0.025);
  --surface-2: rgba(15, 15, 30, 0.05);
  --line: rgba(15, 15, 30, 0.1);
  --line-strong: rgba(15, 15, 30, 0.18);
  --text: #14141d;
  --muted: #565670;
  --faint: #7d7d95;
  --brand: #5b4bdb;
  --brand-2: #0891b2;
  --brand-soft: rgba(91, 75, 219, 0.12);
  --shadow: 0 24px 50px -32px rgba(20, 20, 50, 0.5);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: -30% -10% auto -10%;
  height: 70vh;
  background:
    radial-gradient(46% 55% at 22% 30%, rgba(124, 108, 255, 0.22), transparent 70%),
    radial-gradient(40% 50% at 78% 22%, rgba(34, 211, 238, 0.16), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}

[data-theme='light'] body::before {
  opacity: 0.55;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

p {
  margin: 0;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
  position: relative;
  z-index: 1;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 100;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
}

.skip-link:focus {
  left: 12px;
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.nav.is-stuck {
  border-bottom-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.06rem;
}

.brand__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand__logo {
  height: 34px;
  width: auto;
  border-radius: 10px;
  box-shadow: 0 8px 20px -10px var(--brand);
}

.nav__links {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 0.92rem;
  color: var(--muted);
}

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

.nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.pill--offline {
  border-color: rgba(52, 211, 153, 0.4);
  color: var(--ok);
  background: rgba(52, 211, 153, 0.1);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

[data-theme='dark'] .icon-sun,
[data-theme='light'] .icon-moon {
  display: none;
}

/* ---------- botones ---------- */

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--line);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

.btn--primary {
  background: var(--grad);
  color: #0a0a12;
  box-shadow: 0 14px 34px -16px var(--brand);
}

.btn--primary:hover:not(:disabled) {
  filter: brightness(1.07);
  background: var(--grad);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--text);
}

.btn--soft {
  background: var(--brand-soft);
  color: var(--text);
  border-color: transparent;
  width: 100%;
}

.btn--lg {
  padding: 14px 30px;
  font-size: 1rem;
  border-radius: 14px;
}

.btn--tiny {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 9px;
}

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

.hero {
  padding: 60px 20px 56px;
  text-align: center;
}

.hero__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.hero__logo img {
  max-height: 180px;
  width: auto;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 7px 15px;
  border-radius: 999px;
  margin-bottom: 26px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

.hero__title {
  font-size: clamp(2.3rem, 6.2vw, 4.2rem);
  max-width: 17ch;
  margin-inline: auto;
}

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

.hero__lead {
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.16rem);
  max-width: 60ch;
  margin: 22px auto 0;
}

.hero__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.hero__badges li {
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--surface);
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 7vw, 68px);
  margin-top: 48px;
  flex-wrap: wrap;
}

.hero__stats div {
  display: grid;
  gap: 2px;
}

.hero__stats strong {
  font-size: 1.9rem;
  letter-spacing: -0.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__stats span {
  font-size: 0.8rem;
  color: var(--faint);
}

/* ---------- converter ---------- */

.converter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
  padding-bottom: 72px;
}

.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.tab:hover {
  color: var(--text);
  background: var(--surface);
}

.tab.is-active {
  background: var(--brand-soft);
  border-color: var(--line);
  border-color: color-mix(in srgb, var(--brand) 35%, transparent);
  color: var(--text);
}

.tab__ico svg {
  display: block;
  width: 17px;
  height: 17px;
}

.converter__body {
  padding: 24px;
}

.converter__blurb {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 22px;
}

.field {
  margin-bottom: 20px;
}

.field__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin-bottom: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.16s ease;
}

.chip:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-strong);
}

.chip.is-active {
  background: var(--grad);
  border-color: transparent;
  color: #0a0a12;
}

.chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.chip small {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.7;
  letter-spacing: 0.02em;
}

/* ---------- dropzone ---------- */

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.dropzone.is-over {
  transform: scale(1.008);
}

.dropzone__ico {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand-2);
}

.dropzone__ico svg {
  width: 26px;
  height: 26px;
}

.dropzone__title {
  font-weight: 700;
  font-size: 1.05rem;
}

.dropzone__hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.dropzone__note {
  color: var(--faint);
  font-size: 0.8rem;
  margin-top: 14px;
}

/* ---------- cola ---------- */

.queue {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.queue__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.queue__head h3 {
  font-size: 0.9rem;
}

.queue__tools {
  display: flex;
  gap: 8px;
}

.queue__list {
  max-height: 340px;
  overflow-y: auto;
  overflow-x: hidden;
}

.qitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.qitem:last-child {
  border-bottom: 0;
}

.qitem__thumb {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--faint);
  overflow: hidden;
}

.qitem__main {
  flex: 1 1 auto;
  min-width: 0;
}

.qitem__name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qitem__meta {
  font-size: 0.76rem;
  color: var(--faint);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.qitem__meta b {
  color: var(--muted);
  font-weight: 600;
}

.qitem__meta .saving {
  color: var(--ok);
}

.qitem__right {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.qitem__state {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--faint);
}

.qitem.is-work .qitem__state {
  color: var(--brand-2);
}

.qitem.is-merged .qitem__state {
  color: var(--muted);
}

.qitem.is-done .qitem__state {
  color: var(--ok);
}

.qitem.is-error .qitem__state {
  color: var(--err);
  max-width: 190px;
  text-align: right;
}

/* ---------- destino de descarga ---------- */

.destino {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.82rem;
  color: var(--muted);
}

.destino__ico {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
}

.destino__ico svg {
  width: 17px;
  height: 17px;
}

.destino__text {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
}

.destino__text strong {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.destino__actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

/* ---------- opciones ---------- */

.options {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.options > summary {
  cursor: pointer;
  padding: 13px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

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

.options__badge {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--faint);
}

.options__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  padding: 4px 16px 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.opt label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
}

.opt select,
.opt input[type='number'],
.opt input[type='text'] {
  width: 100%;
  font: inherit;
  font-size: 0.88rem;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}

.opt input[type='range'] {
  width: 100%;
  accent-color: var(--brand);
}

.opt__row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.opt__val {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-2);
  min-width: 46px;
  text-align: right;
}

.opt--inline {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.86rem;
  color: var(--muted);
}

.opt--inline input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}

.rotrow {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- acciones ---------- */

.converter__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.converter__status {
  color: var(--muted);
  font-size: 0.88rem;
}

.converter__status.is-err {
  color: var(--err);
}

.converter__status.is-ok {
  color: var(--ok);
}

/* ---------- lateral ---------- */

.card--side {
  padding: 24px;
}

.side__title {
  font-size: 1.05rem;
  margin-bottom: 18px;
}

.side__list {
  display: grid;
  gap: 16px;
}

.side__list li {
  display: grid;
  gap: 3px;
  padding-left: 16px;
  border-left: 2px solid var(--brand-soft);
}

.side__list strong {
  font-size: 0.92rem;
}

.side__list span {
  font-size: 0.85rem;
  color: var(--muted);
}

.side__cta {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.side__cta p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ---------- secciones ---------- */

.section {
  padding-bottom: 84px;
}

.section__head {
  text-align: center;
  margin-bottom: 38px;
}

.section__head h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
}

.section__head p {
  color: var(--muted);
  margin-top: 12px;
  max-width: 52ch;
  margin-inline: auto;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
}

.feat {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.feat:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.feat__ico {
  font-size: 1.5rem;
  line-height: 1;
  display: block;
  margin-bottom: 14px;
}

.feat h3 {
  font-size: 1.02rem;
  margin-bottom: 8px;
}

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

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  counter-reset: step;
}

.steps li {
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.steps__num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--grad);
  color: #0a0a12;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.steps h3 {
  font-size: 1.02rem;
  margin-bottom: 8px;
}

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

/* ---------- faq ---------- */

.faq {
  display: grid;
  gap: 10px;
  max-width: 820px;
  margin-inline: auto;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.faq summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.96rem;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  list-style: none;
}

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

.faq summary::after {
  content: '+';
  color: var(--brand-2);
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.faq details[open] summary::after {
  content: '\2212';
}

.faq p {
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 32px;
  background: var(--bg-soft);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer__brand {
  font-weight: 700;
}

.footer__note {
  color: var(--faint);
  font-size: 0.85rem;
  margin-top: 4px;
}

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

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

.footer__legal {
  margin-top: 26px;
  color: var(--faint);
  font-size: 0.8rem;
}

.footer__legal--center {
  text-align: center;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--text);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.8);
  max-width: min(90vw, 460px);
  text-align: center;
}

.toast.is-err {
  background: var(--err);
  color: #fff;
}

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

@media (max-width: 940px) {
  .converter {
    grid-template-columns: 1fr;
  }

  .nav__links {
    display: none;
  }

  .nav__actions {
    margin-left: auto;
  }
}

@media (max-width: 620px) {
  .hero {
    padding-top: 56px;
  }

  .converter__body {
    padding: 18px;
  }

  .pill--offline {
    display: none;
  }

  .converter__actions .btn--lg {
    width: 100%;
  }

  .qitem {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .qitem__right {
    flex: 1 0 100%;
    justify-content: space-between;
  }
}

@media (max-width: 470px) {
  .nav__inner {
    gap: 12px;
  }

  .brand__text {
    font-size: 0.95rem;
  }

  .brand__logo {
    height: 28px;
  }

  .nav__actions {
    gap: 6px;
  }

  .pill {
    font-size: 0.68rem;
    padding: 4px 8px;
  }

  .tab {
    padding: 9px 11px;
    font-size: 0.86rem;
  }

  .queue__head {
    flex-wrap: wrap;
  }

  .destino {
    flex-wrap: wrap;
  }

  .destino__actions {
    flex: 1 0 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 360px) {
  .brand__text {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}
