/* =============================================================
   SinSubir — herramientas multimedia 100% en tu navegador
   1. Tokens
   ============================================================= */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f1f8;
  --text: #15172b;
  --muted: #5c5f78;
  --accent: #5b5bd6;
  --accent-2: #7c3aed;
  --accent-ink: #ffffff;
  --border: #e3e4f0;
  --ok: #10b981;
  --warn: #f59e0b;
  --err: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 22, 50, .04), 0 8px 24px rgba(20, 22, 50, .06);
  --shadow-lg: 0 12px 40px rgba(20, 22, 50, .14);
  --maxw: 1100px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e18;
    --surface: #171827;
    --surface-2: #1f2132;
    --text: #ececf5;
    --muted: #a0a2bd;
    --accent: #8b8bf0;
    --accent-2: #a78bfa;
    --border: #2a2c40;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.02em; }
input, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--accent); color: var(--accent-ink);
  border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.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;
}
.center { text-align: center; }

/* =============================================================
   4. Header
   ============================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; letter-spacing: -0.03em; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #fff; flex: none;
}
.brand .logo svg { width: 18px; height: 18px; }
.brand b { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 12px; border-radius: 9px; font-size: .92rem; font-weight: 500;
  color: var(--muted); transition: background .2s, color .2s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-toggle { display: none; padding: 8px; border-radius: 9px; }
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 719px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav {
    position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px 16px 14px; box-shadow: var(--shadow);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 12px; }
}

/* =============================================================
   5. Hero / tool header
   ============================================================= */
.hero { padding: 34px 0 10px; text-align: center; }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); font-weight: 800; }
.hero .lead { color: var(--muted); font-size: clamp(1rem, 2.5vw, 1.15rem); margin: 12px auto 0; max-width: 640px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .8rem; font-weight: 600; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}
.eyebrow svg { width: 14px; height: 14px; }

/* =============================================================
   6. Tool card
   ============================================================= */
.tool { padding: 18px 0 8px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(16px, 4vw, 30px); margin: 0 auto; max-width: 820px;
}
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: clamp(26px, 7vw, 48px) 20px;
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer;
  transition: border-color .2s, background .2s, transform .1s;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); transform: scale(1.005); }
.dropzone .dz-icon { width: 46px; height: 46px; color: var(--accent); }
.dropzone .dz-title { font-weight: 700; font-size: 1.08rem; }
.dropzone .dz-sub { color: var(--muted); font-size: .9rem; }
.dropzone .btn { margin-top: 4px; pointer-events: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 11px; font-weight: 600; font-size: .98rem;
  background: var(--accent); color: var(--accent-ink);
  transition: transform .12s var(--ease-out), filter .2s, box-shadow .2s;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-lg { padding: 15px 28px; font-size: 1.08rem; width: 100%; }
.btn-ghost { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn-ghost:hover { background: var(--border); filter: none; }
.btn-link { color: var(--accent); font-weight: 600; background: none; box-shadow: none; padding: 8px; }
.btn-danger { background: var(--err); box-shadow: none; }

/* states driven by data-state on .tool-card */
[data-state] .state { display: none; }
[data-state="idle"]      .state-idle,
[data-state="ready"]     .state-ready,
[data-state="engine"]    .state-engine,
[data-state="working"]   .state-working,
[data-state="done"]      .state-done,
[data-state="error"]     .state-error { display: block; }

.panel { margin-top: 18px; }
.filemeta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: .92rem;
}
.filemeta .fname { font-weight: 600; word-break: break-all; }
.filemeta .fsize { color: var(--muted); }
.filemeta .chg { margin-left: auto; }

.controls { display: grid; gap: 16px; margin-top: 18px; }
@media (min-width: 540px) { .controls.two { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field select, .field input[type="number"], .field input[type="text"] {
  padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); width: 100%;
}
.field select:focus, .field input:focus { border-color: var(--accent); outline: none; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button {
  padding: 9px 15px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-weight: 600; font-size: .9rem; color: var(--muted);
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.progress-wrap { margin-top: 20px; }
.progress-label { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 8px; color: var(--muted); }
.progress {
  height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden;
  border: 1px solid var(--border);
}
.progress > span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s var(--ease-out);
}
.progress.indeterminate > span {
  width: 40% !important; animation: slide 1.3s var(--ease-out) infinite;
}
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.hint { font-size: .85rem; color: var(--muted); margin-top: 10px; }

.result-box {
  text-align: center; padding: 22px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--ok) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--border));
}
.result-box .rb-icon { width: 44px; height: 44px; color: var(--ok); margin: 0 auto 8px; }
.result-box h3 { font-size: 1.2rem; margin-bottom: 4px; }
.result-box .rb-meta { color: var(--muted); font-size: .92rem; margin-bottom: 16px; }
.result-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }

.errbox {
  padding: 18px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--err) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--err) 35%, var(--border));
}
.errbox h3 { color: var(--err); font-size: 1.08rem; margin-bottom: 6px; }
.errbox p { font-size: .94rem; }

.badge-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px auto 0; max-width: 820px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 500; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 999px;
}
.badge svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.badge.privacy { color: var(--text); border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.badge.privacy svg { color: var(--ok); }

/* waveform (mp3 trimmer) */
#waveform { margin-top: 18px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); min-height: 128px; }
.wave-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.time-pill { font-variant-numeric: tabular-nums; font-weight: 600; background: var(--surface-2); padding: 6px 12px; border-radius: 999px; font-size: .9rem; }

/* video preview */
.video-stage { margin-top: 4px; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.video-stage video { width: 100%; max-height: 340px; margin: 0 auto; }
.gif-preview { margin-top: 16px; text-align: center; }
.gif-preview img { margin: 0 auto; border-radius: var(--radius-sm); border: 1px solid var(--border); max-height: 360px; }

/* range */
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* =============================================================
   7. Ad slots (placeholders only)
   ============================================================= */
.ad-slot {
  max-width: 820px; margin: 26px auto; min-height: 100px;
  display: grid; place-items: center;
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, color-mix(in srgb, var(--border) 25%, transparent) 10px, color-mix(in srgb, var(--border) 25%, transparent) 20px);
  color: var(--muted); font-size: .78rem; letter-spacing: .14em; font-weight: 600;
  text-transform: uppercase;
}
.ad-slot.leaderboard { min-height: 100px; }
.ad-slot.in-content { min-height: 250px; }

/* corner toast ad */
.ad-toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: 230px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 14px;
  transform: translateY(140%); opacity: 0; transition: transform .45s var(--ease-out), opacity .45s;
}
.ad-toast.show { transform: translateY(0); opacity: 1; }
.ad-toast .ad-mini {
  min-height: 90px; display: grid; place-items: center; border: 1px dashed var(--border);
  border-radius: 8px; color: var(--muted); font-size: .72rem; letter-spacing: .12em; font-weight: 600; text-transform: uppercase;
}
.ad-toast .close {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center; color: var(--muted); background: var(--surface-2);
}
.ad-toast .close:hover { color: var(--text); }
@media (max-width: 540px) { .ad-toast { right: 10px; left: 10px; width: auto; } }

/* download interstitial dialog */
dialog.ad-dialog {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  max-width: 420px; width: calc(100% - 32px);
}
dialog.ad-dialog::backdrop { background: rgba(10, 10, 25, .55); backdrop-filter: blur(2px); }
.ad-dialog .ad-body { padding: 22px; text-align: center; }
.ad-dialog h3 { font-size: 1.15rem; margin-bottom: 6px; }
.ad-dialog p { color: var(--muted); font-size: .92rem; margin-bottom: 14px; }
.ad-dialog .ad-rect {
  min-height: 200px; display: grid; place-items: center; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); color: var(--muted); font-size: .76rem; letter-spacing: .14em;
  font-weight: 600; text-transform: uppercase; margin-bottom: 16px;
}
.ad-dialog .close-x {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; background: var(--surface-2); color: var(--muted);
}
.ad-dialog .close-x:hover { color: var(--text); }

/* =============================================================
   8. Content sections
   ============================================================= */
.section { padding: 40px 0; }
.section h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 800; margin-bottom: 8px; }
.section .sub { color: var(--muted); margin-bottom: 26px; max-width: 640px; }

.steps { display: grid; gap: 18px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.step .num {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
  font-weight: 800; margin-bottom: 12px;
}
.step h3 { font-size: 1.08rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: .94rem; }

.prose { max-width: 760px; }
.prose p { margin-bottom: 14px; color: var(--muted); }
.prose h3 { margin: 22px 0 8px; font-size: 1.15rem; color: var(--text); }
.prose strong { color: var(--text); }

.uses { display: grid; gap: 14px; margin-top: 6px; }
@media (min-width: 540px) { .uses { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .uses { grid-template-columns: repeat(3, 1fr); } }
.use {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px;
}
.use svg { width: 22px; height: 22px; color: var(--accent); flex: none; margin-top: 2px; }
.use b { display: block; margin-bottom: 2px; }
.use span { color: var(--muted); font-size: .9rem; }

details.faq {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); margin-bottom: 10px; overflow: hidden;
}
details.faq summary {
  cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--accent); line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq .faq-a { padding: 0 18px 16px; color: var(--muted); }

.tool-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }
.tool-link {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); transition: transform .18s var(--ease-out), box-shadow .2s, border-color .2s;
}
.tool-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.tool-link .ti {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
}
.tool-link .ti svg { width: 24px; height: 24px; }
.tool-link h3 { font-size: 1.12rem; }
.tool-link p { color: var(--muted); font-size: .92rem; }
.tool-link .go { margin-top: auto; color: var(--accent); font-weight: 600; font-size: .92rem; }

/* =============================================================
   9. Footer
   ============================================================= */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 30px; padding: 30px 0;
  color: var(--muted); font-size: .88rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.credits { font-size: .78rem; opacity: .8; width: 100%; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }

/* =============================================================
   10. No-JS notice
   ============================================================= */
.nojs {
  display: none; margin-top: 18px; padding: 14px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--border)); font-size: .92rem;
}
html:not(.js) .nojs { display: block; }
html:not(.js) .needs-js { display: none; }

/* =============================================================
   11. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress.indeterminate > span { animation: none; }
  .ad-toast { transition: opacity .3s; transform: none; }
}
