/* =============================================================
   Ligero — comprime y convierte imágenes en tu navegador
   0. Tipografías autoalojadas (privacidad: sin llamadas a Google)
   ============================================================= */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url('assets/fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url('assets/fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  color-scheme: light dark;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Manrope", var(--sans);

  --bg: #f5f7fb;
  --bg-soft: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --surface-3: #e9edf6;
  --border: #dfe4f0;
  --border-strong: #c8d0e4;
  --text: #101828;
  --muted: #5a6580;
  --muted-2: #6f7c99;

  --accent: #2f5fe0;
  --accent-hover: #2450c7;
  --accent-soft: #e8eefe;
  --accent-ink: #ffffff;
  --violet: #6f4bf0;

  --ok: #0f8f5b;
  --ok-soft: #e2f6ee;
  --warn: #a34d05;
  --warn-soft: #fdf0dd;
  --danger: #cb2418;
  --danger-soft: #fdeceb;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow: 0 4px 16px rgba(16, 24, 40, .07), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .18);

  --gutter: clamp(1rem, 4vw, 2rem);
  --maxw: 1140px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1e;
    --bg-soft: #0e152a;
    --surface: #121a30;
    --surface-2: #18213b;
    --surface-3: #1f2947;
    --border: #253157;
    --border-strong: #33406c;
    --text: #eaefff;
    --muted: #a3aecb;
    --muted-2: #8792b3;

    --accent: #7f9dff;
    --accent-hover: #98b1ff;
    --accent-soft: #1b2954;
    --accent-ink: #08122b;
    --violet: #9d84ff;

    --ok: #34d399;
    --ok-soft: #10331f;
    --warn: #fbbf24;
    --warn-soft: #33260c;
    --danger: #fb7185;
    --danger-soft: #3a1220;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 4px 16px rgba(0, 0, 0, .45);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
  }
}

:root[data-theme="dark"] {
  --bg: #0a0f1e;
  --bg-soft: #0e152a;
  --surface: #121a30;
  --surface-2: #18213b;
  --surface-3: #1f2947;
  --border: #253157;
  --border-strong: #33406c;
  --text: #eaefff;
  --muted: #a3aecb;
  --muted-2: #8792b3;

  --accent: #7f9dff;
  --accent-hover: #98b1ff;
  --accent-soft: #1b2954;
  --accent-ink: #08122b;
  --violet: #9d84ff;

  --ok: #34d399;
  --ok-soft: #10331f;
  --warn: #fbbf24;
  --warn-soft: #33260c;
  --danger: #fb7185;
  --danger-soft: #3a1220;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}
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;
  min-height: 100svh;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--display);
  text-wrap: balance;
  line-height: 1.14;
  letter-spacing: -0.02em;
  font-weight: 800;
}
h1 { font-size: clamp(1.85rem, 5vw, 2.9rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.42rem, 3.4vw, 2.05rem); }
h3 { font-size: clamp(1.08rem, 2.2vw, 1.28rem); font-weight: 700; }
::selection { background: var(--accent); color: var(--accent-ink); }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 860px; }
.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;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 999;
  padding: .65rem 1rem; background: var(--accent); color: var(--accent-ink);
  border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .8125rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* =============================================================
   4. Header / nav
   ============================================================= */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 62px;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--display); font-weight: 800; font-size: 1.12rem;
  letter-spacing: -0.03em; color: var(--text); text-decoration: none;
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  display: grid; place-items: center; color: #fff; flex: 0 0 auto;
}
.brand__mark svg { width: 18px; height: 18px; }

.nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.nav__list { display: none; list-style: none; gap: .15rem; padding: 0; margin: 0; }
.nav__link {
  display: inline-block; padding: .5rem .7rem; border-radius: 9px;
  color: var(--muted); font-size: .925rem; font-weight: 500; text-decoration: none;
  transition: background .18s var(--ease-out), color .18s var(--ease-out);
}
.nav__link:hover, .nav__link:focus-visible { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav__link[aria-current] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  color: var(--muted); border: 1px solid transparent;
  transition: background .18s var(--ease-out), color .18s var(--ease-out);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
}

.nav__toggle { display: grid; }
.nav__panel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow); padding: .75rem var(--gutter) 1.25rem;
  display: none;
}
.nav__panel[data-open="true"] { display: block; }
.nav__panel .nav__group + .nav__group { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.nav__group h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); margin-bottom: .4rem; font-weight: 700; }
.nav__group ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; }
.nav__group a { display: block; padding: .5rem .6rem; border-radius: 9px; color: var(--text); font-size: .95rem; text-decoration: none; }
.nav__group a:hover { background: var(--surface-2); text-decoration: none; }

@media (min-width: 960px) {
  .nav__list { display: flex; }
  .nav__toggle { display: none; }
  .nav__panel { display: none !important; }
}

/* =============================================================
   5. Buttons, chips, badges
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.15rem; border-radius: 11px;
  font-weight: 600; font-size: .95rem; line-height: 1.2;
  border: 1px solid transparent; text-decoration: none;
  transition: transform .16s var(--ease-out), background .18s var(--ease-out),
              border-color .18s var(--ease-out), box-shadow .18s var(--ease-out), color .18s var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--muted-2); }
.btn--quiet { background: transparent; color: var(--muted); }
.btn--quiet:hover { background: var(--surface-2); color: var(--text); }
.btn--lg { padding: .95rem 1.6rem; font-size: 1.02rem; border-radius: 13px; }
.btn--sm { padding: .45rem .75rem; font-size: .85rem; border-radius: 9px; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .22rem .6rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600; line-height: 1.5;
  background: var(--surface-3); color: var(--muted);
  white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; }
.chip--ok { background: var(--ok-soft); color: var(--ok); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--danger { background: var(--danger-soft); color: var(--danger); }
.chip--accent { background: var(--accent-soft); color: var(--accent); }

.privacy-badge {
  display: inline-flex; align-items: center; gap: .55rem; flex-wrap: wrap;
  padding: .6rem .95rem; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok);
  font-size: .875rem; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--ok) 22%, transparent);
}
.privacy-badge svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* =============================================================
   6. Hero + tool
   ============================================================= */
.hero {
  position: relative;
  padding: clamp(1.5rem, 4vw, 2.6rem) 0 0;
}
.hero::before {
  content: ""; position: absolute; inset: -40% 0 45%;
  background:
    radial-gradient(60% 55% at 18% 10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(50% 50% at 85% 15%, color-mix(in srgb, var(--violet) 14%, transparent), transparent 70%);
  pointer-events: none; z-index: -1;
}
.hero__head { text-align: center; max-width: 46rem; margin-inline: auto; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .82rem; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); padding: .3rem .8rem; border-radius: 999px;
  margin-bottom: .9rem;
}
.hero__eyebrow svg { width: 14px; height: 14px; }
.hero__sub {
  margin-top: .85rem; font-size: clamp(1rem, 2.1vw, 1.12rem);
  color: var(--muted); max-width: 42rem; margin-inline: auto;
}
.hero__trust {
  display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center;
  margin-top: 1.1rem;
}

/* --- The tool card --- */
.tool {
  margin-top: clamp(1.1rem, 3vw, 1.7rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: clamp(.8rem, 2.2vw, 1.4rem);
  scroll-margin-top: 80px;
}
.tool__noscript {
  padding: 1rem; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--warn); font-weight: 600; text-align: center;
}

/* Dropzone */
.dropzone {
  position: relative; display: block; width: 100%;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  padding: clamp(1.3rem, 5vw, 2.5rem) 1.1rem;
  text-align: center; cursor: pointer;
  transition: border-color .18s var(--ease-out), background .18s var(--ease-out), transform .18s var(--ease-out);
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 3px; }
.dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.008); }
.dropzone input[type="file"] {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.dropzone__icon {
  width: 54px; height: 54px; margin: 0 auto .8rem; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff; box-shadow: var(--shadow);
}
.dropzone__icon svg { width: 26px; height: 26px; }
.dropzone__title { font-family: var(--display); font-weight: 800; font-size: clamp(1.05rem, 2.6vw, 1.3rem); letter-spacing: -.02em; }
.dropzone__hint { margin-top: .35rem; color: var(--muted); font-size: .93rem; }
.dropzone__cta {
  display: inline-flex; margin-top: 1rem;
  padding: .7rem 1.3rem; border-radius: 11px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: .95rem;
  box-shadow: var(--shadow-sm);
}
.dropzone__formats { margin-top: .85rem; font-size: .8rem; color: var(--muted-2); }

/* Compact dropzone once files are loaded */
.tool[data-state="files"] .dropzone,
.tool[data-state="working"] .dropzone {
  padding: .85rem 1rem; display: flex; align-items: center; justify-content: center; gap: .6rem;
  border-radius: var(--radius);
}
.tool[data-state="files"] .dropzone__icon,
.tool[data-state="working"] .dropzone__icon { width: 34px; height: 34px; margin: 0; border-radius: 10px; }
.tool[data-state="files"] .dropzone__icon svg,
.tool[data-state="working"] .dropzone__icon svg { width: 17px; height: 17px; }
.tool[data-state="files"] .dropzone__title,
.tool[data-state="working"] .dropzone__title { font-size: .96rem; }
.tool[data-state="files"] .dropzone__hint,
.tool[data-state="files"] .dropzone__cta,
.tool[data-state="files"] .dropzone__formats,
.tool[data-state="working"] .dropzone__hint,
.tool[data-state="working"] .dropzone__cta,
.tool[data-state="working"] .dropzone__formats { display: none; }

.tool__privacy { margin-top: .9rem; display: flex; justify-content: center; }
.tool[data-state="files"] .privacy-badge,
.tool[data-state="working"] .privacy-badge { font-size: .82rem; padding: .45rem .8rem; }

/* Settings panel */
.panel { margin-top: 1rem; display: none; }
.tool[data-state="files"] .panel,
.tool[data-state="working"] .panel { display: block; }

.panel__modes {
  display: grid; grid-template-columns: 1fr; gap: .4rem;
  background: var(--surface-2); padding: .35rem; border-radius: 13px;
  border: 1px solid var(--border);
}
.mode {
  position: relative; display: flex; align-items: flex-start; gap: .55rem;
  padding: .65rem .75rem; border-radius: 10px; cursor: pointer;
  transition: background .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.mode input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode__dot {
  width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto; margin-top: .18rem;
  border: 2px solid var(--border-strong); background: var(--surface);
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.mode__text strong { display: block; font-size: .93rem; font-weight: 700; }
.mode__text span { display: block; font-size: .8rem; color: var(--muted); line-height: 1.35; }
.mode:has(input:checked) { background: var(--surface); box-shadow: var(--shadow-sm); }
.mode:has(input:checked) .mode__dot { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 9px var(--accent); }
.mode:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.panel__controls { margin-top: .9rem; display: grid; gap: .9rem; }
.panel__controls[data-disabled="true"] { opacity: .5; pointer-events: none; }
.field { display: grid; gap: .35rem; min-width: 0; }
.field__label { font-size: .85rem; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.field__label .value { color: var(--accent); font-variant-numeric: tabular-nums; }
.field__hint { font-size: .78rem; color: var(--muted-2); }

.select, .input {
  width: 100%; padding: .6rem .75rem; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: .93rem; transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.select:focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f7c99' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: 16px;
  padding-right: 2rem;
}

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px; background: var(--surface-3);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%; margin-top: -7px;
  background: var(--accent); border: 3px solid var(--surface); box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--surface-3); }
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--surface);
  background: var(--accent); box-shadow: var(--shadow-sm);
}
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }

.check { display: flex; align-items: flex-start; gap: .55rem; cursor: pointer; font-size: .9rem; }
.check input { width: 18px; height: 18px; margin-top: .18rem; accent-color: var(--accent); flex: 0 0 auto; }
.check span small { display: block; color: var(--muted-2); font-size: .78rem; line-height: 1.4; }

.target { position: relative; }
.target .input { padding-right: 3rem; }
.target__unit {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  font-size: .85rem; font-weight: 700; color: var(--muted-2); pointer-events: none;
}

.dims { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: end; }
.dims__link {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
  transition: color .18s var(--ease-out), border-color .18s var(--ease-out), background .18s var(--ease-out);
}
.dims__link[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.dims__link svg { width: 17px; height: 17px; }

.advanced { margin-top: .3rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.advanced > summary {
  cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--accent);
  list-style: none; display: inline-flex; align-items: center; gap: .4rem;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::after {
  content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .2s var(--ease-out);
}
.advanced[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.advanced__grid { margin-top: .9rem; display: grid; gap: .9rem; }

.panel__actions {
  margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
}
.panel__actions .btn { flex: 1 1 12rem; }

/* Progress */
.progress {
  margin-top: .9rem; display: none; gap: .6rem; align-items: center;
}
.tool[data-state="working"] .progress { display: flex; }
.progress__track {
  flex: 1; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden;
}
.progress__bar {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  transition: width .25s var(--ease-out);
}
.progress__label { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Summary */
.summary { display: none; margin-top: 1rem; }
.summary[data-has-results="true"] { display: block; }
.summary__card {
  border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent);
  background: var(--ok-soft);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem;
}
.summary__stats { display: flex; flex-wrap: wrap; gap: .9rem 1.6rem; flex: 1 1 auto; margin: 0; }
.summary__stat { display: grid; gap: .1rem; }
.summary__stat dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.summary__stat dd { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.summary__stat--win dd { color: var(--ok); }
.summary__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* File list */
.filelist { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .6rem; }
.file {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: .8rem;
  align-items: start;
  padding: .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.file[data-status="done"] { border-color: color-mix(in srgb, var(--ok) 32%, transparent); }
.file[data-status="error"] { border-color: color-mix(in srgb, var(--danger) 34%, transparent); }
.file__thumb {
  width: 56px; height: 56px; border-radius: 10px; overflow: hidden;
  background: var(--surface-3); display: grid; place-items: center;
  border: 1px solid var(--border);
}
.file__thumb img { width: 100%; height: 100%; object-fit: cover; }
.file__thumb svg { width: 22px; height: 22px; color: var(--muted-2); }
.file__body { min-width: 0; display: grid; gap: .35rem; }
.file__top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.file__name {
  font-weight: 600; font-size: .93rem; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
.file__meta { display: flex; flex-wrap: wrap; gap: .3rem .55rem; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.file__meta b { color: var(--text); font-weight: 600; }
.file__sizes { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .875rem; font-variant-numeric: tabular-nums; }
.file__size-old { color: var(--muted); text-decoration: line-through; }
.file__size-new { font-weight: 700; }
.file__arrow { color: var(--muted-2); }
.file__actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .15rem; }
.file__error { font-size: .84rem; color: var(--danger); font-weight: 500; }

.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tool__error {
  display: none; margin-top: .9rem; padding: .85rem 1rem; border-radius: var(--radius);
  background: var(--danger-soft); color: var(--danger); font-size: .9rem; font-weight: 500;
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
}
.tool__error[data-visible="true"] { display: flex; gap: .55rem; align-items: flex-start; }
.tool__error svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: .1rem; }

/* =============================================================
   7. Compare dialog (before/after slider)
   ============================================================= */
dialog {
  border: 0; padding: 0; background: transparent; color: inherit;
  max-width: min(94vw, 980px); width: 100%;
}
dialog::backdrop { background: rgba(8, 12, 24, .62); backdrop-filter: blur(3px); }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal__head {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--border);
}
.modal__title { font-family: var(--display); font-weight: 800; font-size: 1rem; letter-spacing: -.02em; margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal__body { padding: 1rem; }
.modal__foot { padding: .85rem 1rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

.compare {
  position: relative; width: 100%; overflow: hidden;
  border-radius: var(--radius);
  touch-action: none; user-select: none; -webkit-user-select: none;
  background-color: var(--surface-3);
  background-image:
    linear-gradient(45deg, var(--surface-2) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface-2) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface-2) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface-2) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0px;
}
.compare img { width: 100%; height: 100%; object-fit: contain; display: block; }
.compare__after {
  position: absolute; inset: 0;
  clip-path: inset(0 0 0 var(--pos, 50%));
}
.compare__divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%);
  width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25);
  pointer-events: none;
}
.compare__handle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 50%;
  background: #fff; color: #101828; display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.compare__handle svg { width: 20px; height: 20px; }
.compare__tag {
  position: absolute; top: .6rem; padding: .2rem .55rem; border-radius: 999px;
  background: rgba(8, 12, 24, .74); color: #fff; font-size: .72rem; font-weight: 700;
  letter-spacing: .03em; pointer-events: none; z-index: 3;
}
.compare__tag--before { left: .6rem; }
.compare__tag--after { right: .6rem; }
.compare__range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; z-index: 4;
}
.compare__range:focus-visible ~ .compare__divider { box-shadow: 0 0 0 3px var(--accent); }
.compare-legend { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin: .9rem 0 0; }
.compare-legend > div { display: grid; gap: .05rem; }
.compare-legend dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.compare-legend dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.compare-legend .win { color: var(--ok); }

/* =============================================================
   8. Ads (placeholders only)
   ============================================================= */
.ad-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--muted-2);
  text-align: center; padding: 1rem;
  overflow: hidden;
}
.ad-slot__label {
  font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.ad-slot__note { font-size: .74rem; color: var(--muted-2); }
.ad-slot--leaderboard { min-height: 100px; margin: clamp(1.2rem, 3vw, 2rem) 0; }
.ad-slot--incontent { min-height: 250px; margin: clamp(1.5rem, 4vw, 2.5rem) 0; }
.ad-slot--footer { min-height: 100px; margin: clamp(1.2rem, 3vw, 2rem) 0 0; }
.ad-slot--dialog { min-height: 250px; width: 100%; }

.ad-corner {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 55;
  width: 180px; padding: .6rem; border-radius: var(--radius);
  background: var(--surface); border: 1px dashed var(--border-strong);
  box-shadow: var(--shadow); display: none;
}
.ad-corner[data-visible="true"] { display: block; animation: cornerIn .35s var(--ease-out) both; }
@keyframes cornerIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ad-corner__close {
  position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--muted);
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.ad-corner__close svg { width: 13px; height: 13px; }
.ad-corner .ad-slot { min-height: 120px; border: 0; background: var(--surface-2); }
@media (max-width: 899px) { .ad-corner { display: none !important; } }

.ad-dialog { max-width: min(94vw, 440px); }
.ad-dialog__done {
  display: flex; align-items: center; gap: .5rem;
  font-size: .88rem; color: var(--ok); font-weight: 600;
}
.ad-dialog__done svg { width: 17px; height: 17px; flex: 0 0 auto; }

/* =============================================================
   9. Content sections
   ============================================================= */
.section { padding: clamp(2.2rem, 6vw, 3.6rem) 0; }
.section--tight { padding: clamp(1.4rem, 4vw, 2.4rem) 0; }
.section--alt { background: var(--bg-soft); border-block: 1px solid var(--border); }
.section__head { max-width: 44rem; margin-bottom: clamp(1.2rem, 3vw, 1.8rem); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__lead { margin-top: .6rem; color: var(--muted); font-size: 1.02rem; }

.steps { display: grid; gap: 1rem; }
.step {
  position: relative; padding: 1.25rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.step__num {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--display); font-weight: 800; font-size: 1rem; margin-bottom: .7rem;
}
.step h3 { margin-bottom: .3rem; }
.step p { color: var(--muted); font-size: .95rem; }

.cards { display: grid; gap: 1rem; }
.card {
  padding: 1.25rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), border-color .2s var(--ease-out);
}
.card__icon {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: .7rem;
}
.card__icon svg { width: 20px; height: 20px; }
.card h3 { margin-bottom: .3rem; font-size: 1.05rem; }
.card p { color: var(--muted); font-size: .93rem; }
a.card { color: inherit; text-decoration: none; display: block; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }
.card__more { display: inline-flex; align-items: center; gap: .3rem; margin-top: .6rem; color: var(--accent); font-weight: 600; font-size: .88rem; }
.card__more svg { width: 14px; height: 14px; }

.prose { max-width: 44rem; }
.prose h2 { margin-top: 2rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.4rem; }
.prose p, .prose ul, .prose ol { margin-top: .8rem; }
.prose ul, .prose ol { padding-left: 1.15rem; }
.prose li { margin-top: .35rem; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 700; }
.table-wrap { overflow-x: auto; margin-top: 1rem; border-radius: 10px; border: 1px solid var(--border); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table-wrap th, .table-wrap td { padding: .6rem .8rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap th { font-weight: 700; background: var(--surface-2); }

.codeblock {
  margin-top: 1rem; padding: .9rem 1rem; border-radius: var(--radius);
  background: var(--surface-3); border: 1px solid var(--border);
  overflow-x: auto; font-size: .85rem; line-height: 1.6;
}
.codeblock code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  white-space: pre; color: var(--text);
}

.faq { display: grid; gap: .6rem; max-width: 46rem; }
.faq__item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.faq__item > summary {
  cursor: pointer; list-style: none; padding: 1rem 1.1rem;
  font-weight: 700; font-family: var(--display); font-size: 1rem; letter-spacing: -.01em;
  display: flex; align-items: flex-start; gap: .75rem;
}
.faq__item > summary::-webkit-details-marker { display: none; }
.faq__item > summary::after {
  content: ""; margin-left: auto; flex: 0 0 auto; width: 9px; height: 9px; margin-top: .45rem;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(45deg); transition: transform .2s var(--ease-out);
}
.faq__item[open] > summary::after { transform: rotate(-135deg); }
.faq__answer { padding: 0 1.1rem 1.1rem; color: var(--muted); }
.faq__answer > * + * { margin-top: .6rem; }

.usecases { display: grid; gap: .7rem; list-style: none; padding: 0; }
.usecase {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: .9rem 1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.usecase__icon {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.usecase__icon svg { width: 17px; height: 17px; }
.usecase strong { display: block; font-size: .96rem; }
.usecase span { font-size: .89rem; color: var(--muted); }

.linkgrid { display: grid; gap: .5rem; list-style: none; padding: 0; }
.linkgrid a {
  display: flex; align-items: center; gap: .55rem; padding: .7rem .85rem;
  border-radius: 11px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 600; font-size: .92rem; text-decoration: none;
  transition: border-color .18s var(--ease-out), background .18s var(--ease-out), transform .18s var(--ease-out);
}
.linkgrid a:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; transform: translateY(-1px); }
.linkgrid svg { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; }

.callout {
  display: flex; gap: .85rem; padding: 1rem 1.1rem; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  font-size: .93rem;
}
.callout svg { width: 20px; height: 20px; color: var(--accent); flex: 0 0 auto; margin-top: .1rem; }
.callout--ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.callout--ok svg { color: var(--ok); }

/* =============================================================
   10. Footer
   ============================================================= */
.site-footer {
  margin-top: clamp(2rem, 5vw, 3rem);
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: clamp(2rem, 5vw, 2.8rem) 0 1.5rem;
}
.footer__grid { display: grid; gap: 1.6rem; }
.footer__about p { color: var(--muted); font-size: .9rem; margin-top: .7rem; max-width: 30rem; }
.footer__col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted-2); font-weight: 800; margin-bottom: .6rem; }
.footer__col ul { list-style: none; padding: 0; display: grid; gap: .35rem; }
.footer__col a { color: var(--muted); font-size: .9rem; text-decoration: none; }
.footer__col a:hover { color: var(--accent); text-decoration: underline; }
.footer__bottom {
  margin-top: 1.8rem; padding-top: 1.2rem; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center;
  font-size: .84rem; color: var(--muted-2);
}
.footer__bottom nav { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; margin-left: auto; }

/* =============================================================
   11. Toast
   ============================================================= */
.toast-host {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  z-index: 90; display: grid; gap: .5rem; width: min(92vw, 380px); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem .9rem; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); font-size: .89rem; font-weight: 500;
  animation: toastIn .3s var(--ease-out) both;
}
.toast svg { width: 17px; height: 17px; flex: 0 0 auto; }
.toast--ok svg { color: var(--ok); }
.toast--error { border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.toast--error svg { color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* =============================================================
   12. Reveal (functional, subtle)
   ============================================================= */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* =============================================================
   13. Responsive
   ============================================================= */
/* Móvil: la herramienta tiene que verse sin desplazar la página */
@media (max-width: 539px) {
  .hero { padding-top: .9rem; }
  .hero__eyebrow { font-size: .76rem; padding: .25rem .7rem; margin-bottom: .6rem; }
  .hero__sub { font-size: .95rem; margin-top: .6rem; }
  .tool { margin-top: 1rem; border-radius: var(--radius-lg); }
  .dropzone { padding: 1.15rem 1rem; }
  .dropzone__icon { width: 46px; height: 46px; margin-bottom: .6rem; border-radius: 13px; }
  .dropzone__icon svg { width: 22px; height: 22px; }
  .dropzone__cta { margin-top: .8rem; padding: .65rem 1.1rem; }
  .dropzone__formats { margin-top: .7rem; }
  .privacy-badge { font-size: .82rem; padding: .5rem .8rem; }
  .summary__card { padding: .85rem .9rem; }
  .summary__stats { gap: .7rem 1.1rem; }
  .summary__stat dd { font-size: 1.05rem; }
}

@media (min-width: 540px) {
  .panel__modes { grid-template-columns: 1fr 1fr; }
  .filelist { gap: .7rem; }
  .file { grid-template-columns: 72px minmax(0, 1fr); }
  .file__thumb { width: 72px; height: 72px; }
  .panel__controls { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .panel__controls .field--full, .panel__controls .check { grid-column: 1 / -1; }
  .advanced__grid { grid-template-columns: 1fr 1fr; }
  .advanced__grid .field--full { grid-column: 1 / -1; }
}
@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .usecases { grid-template-columns: repeat(2, 1fr); }
  .linkgrid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1.5fr 1fr 1fr; }
}
@media (min-width: 960px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; }
  .cards--3 { grid-template-columns: repeat(3, 1fr); }
  .linkgrid--3 { grid-template-columns: repeat(3, 1fr); }
  .tool { padding: 1.5rem; }
  .panel__controls { grid-template-columns: repeat(3, 1fr); }
  .panel__controls .field--full { grid-column: 1 / -1; }
  .advanced__grid { grid-template-columns: repeat(3, 1fr); }
  .file { grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; }
  .file__thumb { width: 84px; height: 84px; }
  .file__actions { margin-top: 0; justify-content: flex-end; }
}

/* =============================================================
   14. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation-duration: 1.6s; }
  .ad-corner[data-visible="true"] { animation: none; }
}

/* =============================================================
   15. Print
   ============================================================= */
@media print {
  .site-header, .ad-slot, .ad-corner, .tool, .toast-host { display: none !important; }
}
