/* BlinkConvert — site styles. One family (Archivo, variable width) does both jobs:
   expanded heavy for names and headings, normal width for reading. */
:root {
  --ink: #171a3a;
  --ink-2: #2b2f5c;
  --paper: #f3f5f8;
  --card: #ffffff;
  --line: #d9dee7;
  --muted: #565d78;
  --signal: #ffc21a;
  --signal-deep: #e0a400;
  --ok: #10794a;
  --err: #b42318;
  --c-pdf: #e0393e;
  --c-image: #2f6bff;
  --c-media: #c2337a;
  --c-text: #12a150;
  --c-gen: #e8730c;
  --c-dev: #6c4cf1;
  --c-calc: #0b8fb3;
  --r-s: 6px;
  --r-m: 12px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
  --read: 68ch;
  color-scheme: light; /* one deliberate light theme */
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.55;
  font-stretch: 100%;
}
img, svg, canvas, video { max-width: 100%; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--signal-deep); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--signal); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.top { background: var(--ink); color: #fff; }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 58px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none;
  font-weight: 800; font-stretch: 125%; font-size: 20px; letter-spacing: -0.01em; }
.brand svg { width: 28px; height: 28px; flex: none; }
.nav { display: flex; gap: 4px 16px; flex-wrap: wrap; margin-left: auto; font-size: 15px; }
.nav a { color: #e7e9f6; text-decoration: none; padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 3px; }

/* Type */
h1, h2, h3, .display { text-wrap: balance; font-stretch: 125%; letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 850; }
h2 { font-size: clamp(24px, 3.2vw, 32px); font-weight: 800; }
h3 { font-size: 20px; font-weight: 750; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(18px, 2.2vw, 21px); max-width: 60ch; color: var(--ink-2); margin-top: 14px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Home hero */
.hero { padding-top: 48px; padding-bottom: 28px; }
.hero h1 { max-width: 14ch; }
.search { margin-top: 26px; position: relative; max-width: 720px; }
.search input {
  width: 100%; font: inherit; font-size: clamp(19px, 2.6vw, 24px); font-weight: 600;
  padding: 18px 20px; border: 3px solid var(--ink); border-radius: var(--r-m);
  background: #fff; color: var(--ink); box-shadow: 6px 6px 0 var(--signal);
}
.search input::placeholder { color: #8a90a8; font-weight: 500; }
.search input:focus { outline: none; box-shadow: 6px 6px 0 var(--signal-deep); }
.promise { margin-top: 18px; display: flex; gap: 8px 22px; flex-wrap: wrap; font-size: 15px; color: var(--ink-2); }
.promise span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--signal-deep); margin-right: 8px; vertical-align: 1px; }
.noresult { margin-top: 18px; display: none; }

/* Category index */
.index { columns: 3 320px; column-gap: 28px; padding: 18px 0 56px; }
.cat { break-inside: avoid; margin: 0 0 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px 18px 8px; }
.cat h2 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.cat h2 a { text-decoration: none; }
.cat h2 a:hover { text-decoration: underline; }
.tab { width: 14px; height: 14px; border-radius: 3px; flex: none; display: inline-block; }
.t-pdf { background: var(--c-pdf); } .t-image { background: var(--c-image); } .t-media { background: var(--c-media); }
.t-text { background: var(--c-text); } .t-gen { background: var(--c-gen); } .t-dev { background: var(--c-dev); } .t-calc { background: var(--c-calc); }
.rows { list-style: none; margin: 12px 0 0; padding: 0; }
.rows li { border-top: 1px solid var(--line); }
.rows a { display: block; padding: 10px 0; text-decoration: none; }
.rows a strong { display: block; font-weight: 700; font-size: 16.5px; }
.rows a span { display: block; color: var(--muted); font-size: 14.5px; line-height: 1.4; }
.rows a:hover strong { text-decoration: underline; text-decoration-color: var(--signal-deep); text-decoration-thickness: 3px; }
.rows li[hidden] { display: none; }

/* Tool page */
.crumbs { font-size: 14px; padding-top: 22px; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: #9aa0b6; }
.crumbs a { color: var(--muted); }
.toolhead { padding: 14px 0 22px; }
.toolhead h1 { font-size: clamp(32px, 5.4vw, 54px); }
.catline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; }
.tool { margin-bottom: 40px; }

/* Dropzone: the one loud thing */
.drop {
  display: grid; place-items: center; text-align: center; gap: 6px;
  background: var(--signal); color: var(--ink); border-radius: var(--r-m);
  min-height: 190px; padding: 28px 18px; cursor: pointer; position: relative;
  border: 3px dashed rgba(23, 26, 58, .55);
}
.drop.over { border-style: solid; border-color: var(--ink); }
.drop .big { font-stretch: 125%; font-weight: 850; font-size: clamp(24px, 4vw, 34px); letter-spacing: -0.02em; line-height: 1.05; }
.drop .hint { font-size: 15px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop.compact { min-height: 0; padding: 14px; }
.drop.compact .big { font-size: 20px; }

/* Controls */
.opts:empty { display: none; }
.opts { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; margin: 18px 0 4px; }
.field { display: grid; gap: 6px; font-size: 15px; min-width: 0; }
.field > span { font-weight: 650; }
.field small { color: var(--muted); font-size: 13px; }
input[type="text"], input[type="number"], input[type="url"], input[type="email"], input[type="tel"], input[type="date"], input[type="datetime-local"], input[type="password"], select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 2px solid var(--line); border-radius: var(--r-s); padding: 9px 11px; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
textarea { width: 100%; min-height: 180px; resize: vertical; line-height: 1.5; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14.5px; }
input[type="range"] { accent-color: var(--ink); width: 180px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); width: 18px; height: 18px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; }
input[type="color"] { width: 48px; height: 40px; border: 2px solid var(--line); border-radius: var(--r-s); padding: 2px; background: #fff; }

.btn {
  font: inherit; font-weight: 750; font-size: 16px; border: 2px solid var(--ink); border-radius: var(--r-s);
  background: #fff; color: var(--ink); padding: 10px 16px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; line-height: 1.2;
}
.btn:hover { background: #eef0f6; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-2); }
.btn.go { background: var(--ink); color: #fff; font-stretch: 112%; font-size: 17px; padding: 13px 22px; }
.btn.go:hover { background: var(--ink-2); }
.btn.slim { padding: 6px 10px; font-size: 14px; font-weight: 650; border-width: 1.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: var(--r-s); overflow: hidden; }
.seg button { font: inherit; font-size: 15px; font-weight: 650; border: 0; background: #fff; color: var(--ink); padding: 8px 12px; cursor: pointer; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* File + result lists */
.files { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.files li { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 10px; }
.files .thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--paper); flex: none; }
.files .meta { flex: 1; min-width: 0; }
.files .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.files .size { font-size: 13.5px; color: var(--muted); }
.files .ctl { display: flex; gap: 6px; flex: none; }
.saving { color: var(--ok); font-weight: 650; }
.results { margin-top: 22px; }
.results h3 { margin-bottom: 4px; }
.status { margin-top: 14px; font-size: 15px; min-height: 1.4em; }
.status.err { color: var(--err); font-weight: 600; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; display: none; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }

/* PDF page grid */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; margin-top: 16px; }
.page { background: #fff; border: 2px solid var(--line); border-radius: var(--r-s); padding: 6px; text-align: center; font-size: 13px; cursor: pointer; position: relative; }
.page canvas { display: block; margin: 0 auto 4px; box-shadow: 0 0 0 1px var(--line); transition: transform .2s; }
.page[aria-pressed="true"] { border-color: var(--ink); background: #fff6d6; }
.page.del[aria-pressed="true"] canvas { opacity: .35; }
.page .badge { position: absolute; top: 6px; right: 6px; background: var(--ink); color: #fff; border-radius: 4px; font-size: 12px; padding: 1px 6px; display: none; }
.page[aria-pressed="true"] .badge { display: block; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; }
.stat b { display: block; font-stretch: 120%; font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat span { font-size: 13.5px; color: var(--muted); }
.out { margin-top: 14px; }
.answer { font-stretch: 118%; font-weight: 800; font-size: clamp(24px, 4vw, 34px); line-height: 1.15; margin: 14px 0 4px; word-break: break-word; }
.limits { display: grid; gap: 10px; margin-top: 16px; }
.limit { font-size: 14.5px; }
.limit .track { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.limit .track i { display: block; height: 100%; background: var(--c-text); }
.limit.over .track i { background: var(--err); }
table.data { border-collapse: collapse; width: 100%; font-size: 15.5px; background: #fff; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.data th { font-weight: 700; background: #eceff5; }
.diff { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px; max-height: 480px; overflow: auto; }
.diff del { background: #fde2e1; color: #8a1c14; text-decoration: line-through; }
.diff ins { background: #dcf4e6; color: #0b5a35; text-decoration: none; }
.swatch { width: 100%; height: 120px; border-radius: var(--r-m); border: 1px solid var(--line); margin-top: 14px; }
.cropwrap { position: relative; display: inline-block; max-width: 100%; touch-action: none; user-select: none; margin-top: 14px; }
.cropwrap img { display: block; max-height: 60vh; }
.cropbox { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(23,26,58,.55); cursor: move; }
.cropbox i { position: absolute; width: 18px; height: 18px; background: var(--signal); border: 2px solid var(--ink); border-radius: 3px; }
.cropbox i[data-h="nw"] { left: -10px; top: -10px; cursor: nwse-resize; }
.cropbox i[data-h="ne"] { right: -10px; top: -10px; cursor: nesw-resize; }
.cropbox i[data-h="sw"] { left: -10px; bottom: -10px; cursor: nesw-resize; }
.cropbox i[data-h="se"] { right: -10px; bottom: -10px; cursor: nwse-resize; }
.preview { margin-top: 14px; max-height: 360px; border-radius: var(--r-s); border: 1px solid var(--line); background: #fff; }
.qrbox { display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px; margin-top: 16px; }
.meter { height: 14px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.meter i { display: block; height: 100%; width: 0; background: var(--c-media); transition: width .08s; }
.timer { font-stretch: 120%; font-weight: 800; font-size: 40px; font-variant-numeric: tabular-nums; margin-top: 10px; }

/* Content below the tool */
.content { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding-bottom: 64px; }
.content > div > section { margin-bottom: 36px; }
.content h2 { margin-bottom: 14px; }
.content p, .content li { max-width: var(--read); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(s); font-stretch: 125%; font-weight: 850; font-size: 20px; width: 36px; height: 36px; display: grid; place-items: center; background: var(--signal); border-radius: 50%; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { font-weight: 700; cursor: pointer; font-size: 17.5px; list-style-position: outside; }
.faq details p { margin: 8px 0 0; color: var(--ink-2); }
.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 15.5px; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
aside .panel { position: sticky; top: 16px; }
aside h2 { font-size: 20px; }
aside .rows a strong { font-size: 15.5px; }
.updated { font-size: 14px; color: var(--muted); }

/* Generic pages */
.prose { max-width: var(--read); padding-top: 28px; padding-bottom: 64px; }
.prose h2 { margin: 28px 0 10px; }

/* Footer */
.foot { background: var(--ink); color: #c9cce0; font-size: 15px; padding: 36px 0 28px; }
.foot a { color: #fff; }
.foot .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; }
.foot h2 { font-size: 16px; color: #fff; margin-bottom: 8px; font-stretch: 110%; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.foot .legal { border-top: 1px solid #343868; margin-top: 26px; padding-top: 16px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-s); font-size: 15px; z-index: 50; max-width: min(92vw, 520px); display: flex; gap: 12px; align-items: center; box-shadow: 0 6px 24px rgba(23,26,58,.25); }
.toast button { font: inherit; font-weight: 700; background: var(--signal); color: var(--ink); border: 0; border-radius: 4px; padding: 6px 10px; cursor: pointer; }

@media (max-width: 860px) {
  .content { grid-template-columns: 1fr; gap: 8px; }
  aside .panel { position: static; }
  .nav { margin-left: 0; width: 100%; font-size: 15px; flex-wrap: nowrap; overflow-x: auto; gap: 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .top .wrap { padding-top: 8px; padding-bottom: 8px; gap: 6px 20px; }
}
@media (max-width: 520px) {
  body { font-size: 16.5px; }
  .hero { padding-top: 30px; }
  .panel { padding: 14px; }
  .drop { min-height: 160px; }
  .files li { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
