/* Layout idea: a wide-set type wordmark over one big drop target; each file becomes a "ticket" listing every format it can become. Ads live in a quiet right rail and one inline banner. */
:root {
  --paper: #ECEEF3;
  --card: #F9FAFC;
  --ink: #12141B;
  --muted: #5A6072;
  --line: #CDD2DE;
  --accent: #2B47F5;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCE2FF;
  --good: #0E7A55;
  --bad: #C2391B;
  --cat-image: #2B47F5;
  --cat-pdf: #C2391B;
  --cat-data: #0E7A55;
  --cat-doc: #8B5CF6;
  --cat-text: #A26200;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1117; --card: #171A23; --ink: #EDEFF5; --muted: #9AA1B4; --line: #2A2F3D;
    --accent: #7187FF; --accent-ink: #0B0D14; --accent-soft: #1E2550;
    --good: #43C595; --bad: #FF7A5C;
    --cat-image: #7187FF; --cat-pdf: #FF7A5C; --cat-data: #43C595; --cat-doc: #B79BFF; --cat-text: #F0B44C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1117; --card: #171A23; --ink: #EDEFF5; --muted: #9AA1B4; --line: #2A2F3D;
  --accent: #7187FF; --accent-ink: #0B0D14; --accent-soft: #1E2550;
  --good: #43C595; --bad: #FF7A5C;
  --cat-image: #7187FF; --cat-pdf: #FF7A5C; --cat-data: #43C595; --cat-doc: #B79BFF; --cat-text: #F0B44C;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-stretch: 100%;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* header */
header.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 8px; flex-wrap: wrap; }
.wordmark { color: inherit; text-decoration: none; font-weight: 900; font-stretch: 125%; font-size: 22px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.wordmark .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); position: relative; overflow: hidden; }
.wordmark .mark::before, .wordmark .mark::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 3px; }
.wordmark .mark::before { left: 4px; top: 4px; background: var(--paper); }
.wordmark .mark::after { right: 4px; bottom: 4px; background: var(--accent); }
.privacy { font-family: var(--mono); font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--card); }
.privacy .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }

/* hero */
.hero { padding: 28px 0 22px; }
.hero h1 {
  margin: 0; font-weight: 800; font-stretch: 112%; letter-spacing: -0.025em;
  font-size: clamp(34px, 6.4vw, 76px); line-height: 1.0; text-wrap: balance;
}
.swap { display: inline-block; position: relative; font-stretch: 125%; font-weight: 900; color: var(--accent); vertical-align: bottom; overflow: hidden; height: 1.08em; line-height: 1.08; }
.swap span { display: block; transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .45s; }
.swap span.out { transform: translateY(-100%); opacity: 0; }
.swap span.in-start { transform: translateY(100%); opacity: 0; transition: none; }
.swap.from { color: var(--ink); }
.hero p { margin: 16px 0 0; max-width: 60ch; color: var(--muted); font-size: 17.5px; }

/* page grid */
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 48px; }
@media (min-width: 980px) { .grid { grid-template-columns: minmax(0, 1fr) 300px; } }
.main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* drop zone */
.drop {
  position: relative; border: 2px dashed var(--line); border-radius: 22px; background: var(--card);
  padding: 34px 24px; display: grid; gap: 14px; justify-items: center; text-align: center;
  transition: border-color .15s, background .15s, transform .15s;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.005); }
.drop .big { font-weight: 800; font-stretch: 118%; font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.01em; }
.drop .hint { color: var(--muted); font-size: 14.5px; }
.drop .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 10px 16px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: background .12s, border-color .12s, transform .08s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { padding: 6px 11px; font-size: 13.5px; border-radius: 8px; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .5; cursor: default; }
.formats-strip { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .02em; }

/* batch bar */
.batch { display: none; border-radius: var(--radius); background: var(--ink); color: var(--paper); padding: 14px 16px; gap: 12px; align-items: center; flex-wrap: wrap; }
.batch.show { display: flex; }
.batch .label { font-weight: 700; font-stretch: 110%; margin-right: auto; }
.batch .btn { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 30%, transparent); }
.batch .btn:hover { border-color: var(--paper); }
.batch .btn.primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.batch .btn.primary:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.batch .results { flex-basis: 100%; display: none; }
.batch .results.show { display: block; }
.batch .results .out { border-color: color-mix(in srgb, var(--paper) 18%, transparent); }
.batch .results .out .meta { color: color-mix(in srgb, var(--paper) 65%, transparent); }

/* file cards */
.files { display: flex; flex-direction: column; gap: 14px; }
.file {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; padding: 16px; position: relative;
  border-left: 5px solid var(--cat, var(--line));
  animation: rise .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { transform: translateY(8px); opacity: .0; } to { transform: none; opacity: 1; } }
.thumb {
  width: 92px; height: 92px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden;
}
.thumb img, .thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .glyph { font-weight: 900; font-stretch: 125%; font-size: 17px; color: var(--cat); letter-spacing: -0.01em; }
.fhead { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.fname { font-weight: 700; font-size: 16.5px; word-break: break-all; line-height: 1.3; }
.fmeta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cat-pill { color: var(--cat); border: 1px solid color-mix(in srgb, var(--cat) 45%, transparent); border-radius: 999px; padding: 0 8px; font-weight: 600; }
.remove { appearance: none; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1; padding: 4px 6px; border-radius: 6px; }
.fbtns { display: flex; gap: 2px; flex: none; }
.remove.mv { font-size: 15px; }
.files > article:only-child .mv { display: none; }
.remove:hover { color: var(--ink); background: var(--paper); }
.to-row { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.to-label { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-right: 2px; }
.fmt {
  appearance: none; cursor: pointer; border: 1.5px solid var(--ink); background: transparent; border-radius: 9px;
  padding: 7px 12px 6px; font-weight: 800; font-stretch: 125%; font-size: 14px; letter-spacing: .01em;
  display: inline-flex; align-items: baseline; gap: 6px; transition: background .12s, color .12s, transform .08s;
}
.fmt small { font-family: var(--mono); font-weight: 500; font-stretch: 100%; font-size: 11px; color: var(--muted); letter-spacing: 0; }
.fmt:hover { background: var(--ink); color: var(--paper); }
.fmt:hover small { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.fmt:active { transform: translateY(1px); }
.fmt.pick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fmt.pick small { color: color-mix(in srgb, var(--accent-ink) 75%, transparent); }
.fmt.busy { pointer-events: none; opacity: .6; }
.fmt.busy::after { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; align-self: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.none { color: var(--muted); font-size: 14px; margin-top: 10px; }

.opts { margin-top: 12px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13.5px; color: var(--muted); }
.opts label { display: inline-flex; gap: 8px; align-items: center; }
.opts select { border: 1px solid var(--line); background: var(--paper); border-radius: 7px; padding: 4px 8px; font-size: 13.5px; }
.opts input[type=range] { accent-color: var(--accent); width: 120px; }
.opts output { font-family: var(--mono); font-size: 12.5px; color: var(--ink); min-width: 3ch; }

.outs { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.out { display: flex; align-items: center; gap: 10px; border-top: 1px dashed var(--line); padding-top: 8px; flex-wrap: wrap; }
.out .ext { font-weight: 900; font-stretch: 125%; font-size: 12.5px; background: var(--accent); color: var(--accent-ink); border-radius: 5px; padding: 2px 7px; }
.out .oname { font-weight: 600; font-size: 14px; word-break: break-all; }
.out .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-right: auto; }
.out .meta .down { color: var(--good); }
.out .meta .up { color: var(--bad); }
.err { color: var(--bad); font-size: 13.5px; margin-top: 10px; }

/* ad slots: hidden until an ad unit is pasted in */
.ad-slot { min-height: 0; }
.ad-slot:not(:has(ins, iframe, script)) { display: none; }
.ad-slot.banner:has(ins) { min-height: 90px; }
.ad-slot.rail:has(ins) { min-height: 250px; }
/* old placeholder styles */
.ad {
  border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; text-align: center;
  color: var(--muted); font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--line) 35%, transparent) 10px 11px);
}
.ad.banner { min-height: 90px; }
.ad.rail { height: 250px; }
.ad span { background: var(--paper); padding: 3px 8px; border-radius: 5px; }

/* side rail */
aside { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 980px) { aside { position: sticky; top: 16px; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel h2 { margin: 0 0 10px; font-size: 13px; font-family: var(--mono); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.panel ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; }

/* matrix */
.matrix h2 { margin: 6px 0 12px; font-weight: 800; font-stretch: 115%; font-size: 24px; letter-spacing: -0.01em; }
.matrix .table { display: grid; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.matrix .row { display: grid; grid-template-columns: minmax(0, 1.25fr) 28px minmax(0, 1fr); gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.matrix .row:first-child { border-top: 0; }
.matrix .grp { font-weight: 700; display: flex; gap: 8px; align-items: center; }
.matrix .grp i { width: 9px; height: 9px; border-radius: 3px; background: var(--cat); flex: none; }
.matrix .ins { font-family: var(--mono); font-size: 11.5px; color: var(--muted); font-weight: 400; display: block; }
.matrix .arrow { color: var(--muted); text-align: center; }
.matrix .tos { display: flex; gap: 5px; flex-wrap: wrap; }
.matrix .tos b { font-weight: 800; font-stretch: 125%; font-size: 11.5px; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
@media (max-width: 560px) {
  .matrix .row { grid-template-columns: 1fr; gap: 6px; }
  .matrix .arrow { display: none; }
  .file { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .thumb { width: 64px; height: 64px; }
  .thumb .glyph { font-size: 13px; }
}

footer { border-top: 1px solid var(--line); padding: 18px 0 40px; color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
footer .mono { font-family: var(--mono); }

/* toast */
.toast-wrap { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); border-radius: 10px; padding: 10px 14px; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.25); animation: rise .25s; }
.toast.bad { background: var(--bad); color: #fff; }

input[type=file] { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ---------- landing page content ---------- */
.crumbs { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin: 18px 0 0; }
.crumbs a { color: inherit; }
.content { display: grid; gap: 8px; max-width: 70ch; padding-top: 8px; }
.content h2 { margin: 26px 0 4px; font-weight: 800; font-stretch: 112%; font-size: 24px; letter-spacing: -0.01em; text-wrap: balance; }
.content h3 { margin: 16px 0 0; font-size: 17px; font-weight: 700; }
.content p, .content li { font-size: 16.5px; margin: 0; }
.content ol, .content ul { margin: 4px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.content code { font-family: var(--mono); font-size: .92em; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.compare > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.compare b { font-weight: 900; font-stretch: 125%; display: block; margin-bottom: 4px; }
.compare p { font-size: 15px; color: var(--muted); }
.linkgrid h2 { margin: 6px 0 12px; font-weight: 800; font-stretch: 115%; font-size: 24px; letter-spacing: -0.01em; }
.linkgroups { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.linkgroups h3 { margin: 0 0 8px; font-family: var(--mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.linkgroups ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.linkgroups a { display: inline-block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 5px 10px; font-size: 14px; font-weight: 600; }
.linkgroups a:hover { border-color: var(--ink); }
.linkgroups a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.panel ol a, footer a { color: inherit; }

.hero.landing { padding-top: 14px; }
.hero h1 .kicker { display: block; font-family: var(--mono); font-size: 13.5px; font-weight: 600; font-stretch: 100%; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; line-height: 1.3; }
.hero h1 .x { font-stretch: 125%; font-weight: 900; }
.hero h1 .x.to { color: var(--accent); }
