/* Layout: one focused column; file extensions set in mono act as the visual motif (".heic → .jpg"). */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 500 800; font-display: swap; src: url("fonts/BricolageGrotesque.c47ac31e5437.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400 700; font-display: swap; src: url("fonts/InstrumentSans.e35fad09c70b.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400 600; font-display: swap; src: url("fonts/JetBrainsMono.570751c5f8b4.woff2") format("woff2"); }

:root {
  --bg: #f5f6f8;        /* cool paper, biased toward the cobalt */
  --surface: #ffffff;
  --sunk: #eceff4;      /* wells: inputs, code, chips */
  --text: #11151d;
  --muted: #586174;
  --line: #dde2ea;
  --brand: #2a45df;     /* cobalt, kept under ~75% saturation */
  --brand-ink: #ffffff;
  --brand-soft: #e6eaff;
  --spark: #ffc928;     /* signal yellow: the bolt only */
  --ok: #167a46;
  --err: #c0322b;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  --shadow: 0 12px 32px rgb(24 36 92 / .16);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0f15; --surface: #141923; --sunk: #1b2130; --text: #edf0f6; --muted: #98a2b6; --line: #262d3b;
    --brand: #8899f2; --brand-ink: #0c0f15; --brand-soft: #1b2340; --spark: #ffd04d; --ok: #4fd18b; --err: #ff7a70;
    --shadow: 0 12px 32px rgb(0 0 0 / .45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0f15; --surface: #141923; --sunk: #1b2130; --text: #edf0f6; --muted: #98a2b6; --line: #262d3b;
  --brand: #8899f2; --brand-ink: #0c0f15; --brand-soft: #1b2340; --spark: #ffd04d; --ok: #4fd18b; --err: #ff7a70;
  --shadow: 0 12px 32px rgb(0 0 0 / .45); color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
code, pre, kbd { font-family: var(--mono); }
.wrap { max-width: 880px; margin: 0 auto; padding-inline: 20px; }

/* Header */
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 22px; }
.logo { display: flex; align-items: center; gap: 8px; font: 700 23px/1 var(--display); letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.logo svg { width: 24px; height: 24px; fill: var(--spark); stroke: var(--text); stroke-width: 1.4; stroke-linejoin: round; }
.nav { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--spark); text-decoration-thickness: 3px; text-underline-offset: 6px; }

/* Skip link: visible only when focused from the keyboard */
.skip { position: absolute; left: 16px; top: -48px; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; border-radius: 8px; z-index: 20; text-decoration: none; }
.skip:focus { top: 12px; }
main:focus { outline: none; }
.lang { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 3px 9px; font: 500 13px var(--mono); cursor: pointer; }
.lang:hover { color: var(--text); border-color: var(--muted); }

/* Type scale: 48 / 30 / 21 / 17 / 15 / 13 */
h1 { font: 800 clamp(34px, 6.4vw, 48px)/1.05 var(--display); letter-spacing: -0.035em; margin: 28px 0 12px; text-wrap: balance; }
h2 { font: 700 21px/1.25 var(--display); letter-spacing: -0.015em; text-wrap: balance; }
.sub { color: var(--muted); margin: 0 0 28px; font-size: 19px; max-width: 34em; }

/* Drop zone: the page's main object */
.drop { position: relative; display: grid; justify-items: center; gap: 6px; padding: 44px 20px 36px; text-align: center;
  background: var(--surface); border: 1.5px dashed var(--line); border-radius: 16px; cursor: pointer;
  transition: border-color .15s, background-color .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop:focus-within { outline: 3px solid var(--brand); outline-offset: 3px; }
.drop svg { width: 34px; height: 34px; fill: var(--brand); }
.drop strong { font: 700 21px/1.25 var(--display); letter-spacing: -0.01em; }
.drop span { color: var(--muted); font-size: 14px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop .exts { font: 13px/1.6 var(--mono); color: var(--muted); letter-spacing: .02em; max-width: 30em; }

.count { margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.count { display: flex; align-items: center; gap: 6px; }
.count svg { width: 16px; height: 16px; fill: var(--spark); stroke: var(--text); stroke-width: 1.6; stroke-linejoin: round; }
.count strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* Extension chips */
.popular { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.popular a { display: inline-block; font: 500 13px/1 var(--mono); letter-spacing: .02em; color: var(--muted); text-decoration: none;
  background: var(--sunk); border: 1px solid transparent; border-radius: 6px; padding: 7px 10px; }
.popular a:hover { color: var(--text); border-color: var(--line); }

/* Queue of files */
.files { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.file { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; }
.name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { color: var(--muted); font: 13px var(--mono); }
.controls { display: flex; gap: 8px; align-items: center; }
select, .btn, input { font: inherit; font-size: 15px; }
select { background: var(--sunk); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-family: var(--mono); }
.btn { display: inline-block; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 8px; padding: 9px 16px;
  font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn, .lang, .popular a, .grid a, .period button { transition: background-color .2s, color .2s, border-color .2s, filter .2s, transform .1s; }
.btn:hover { filter: brightness(1.08); }
.btn:active, .lang:active, .period button:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; filter: none; }
.btn.ghost { background: none; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover { color: var(--text); border-color: var(--muted); }
.controls .btn.ghost { border: 0; padding: 8px; }
.bar { grid-column: 1 / -1; height: 3px; background: var(--sunk); border-radius: 2px; overflow: hidden; display: none; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.busy .bar { display: block; }
.busy.processing .bar i { width: 100% !important; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .busy.processing .bar i { animation: none; } *, .btn:active { transition: none !important; transform: none !important; } }
.status { grid-column: 1 / -1; font-size: 14px; overflow-wrap: anywhere; }
.status:empty { display: none; }
.err { color: var(--err); }
.ok { color: var(--ok); }
.all { margin-top: 12px; text-align: right; }

/* Key box */
.keybox { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.keybox summary { cursor: pointer; width: fit-content; }
.keybox form { display: flex; gap: 8px; margin-top: 8px; }
.keybox input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-family: var(--mono); font-size: 14px; }
.keybox p { margin: 6px 0 0; }

/* Real numbers under the converter */
.facts { list-style: none; display: flex; flex-wrap: wrap; margin: 56px 0 8px; padding: 22px 0 0; border-top: 1px solid var(--line); gap: 18px 0; }
.facts li { flex: 1 1 160px; display: grid; gap: 2px; padding-right: 20px; }
.facts li + li { border-left: 1px solid var(--line); padding-left: 20px; }
.facts strong { font: 800 34px/1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.facts span { color: var(--muted); font-size: 14px; }
@media (max-width: 560px) { .facts li { flex-basis: 45%; } .facts li:nth-child(3) { border-left: 0; padding-left: 0; } }

/* FAQ, related links, all conversions */
section h2.sec { font-size: 26px; margin: 48px 0 14px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 8px 0 0; max-width: 40em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.grid a { display: block; font: 13px var(--mono); color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.grid a:hover { border-color: var(--brand); color: var(--brand); }

/* Long-form pages (API, legal) */
.legal { max-width: 44em; }
.legal h2 { font-size: 22px; margin: 36px 0 8px; }
.legal li { margin: 6px 0; }
.legal pre { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow-x: auto; font-size: 13px; line-height: 1.6; }
.legal code { font-size: 0.88em; }
.muted { color: var(--muted); font-size: 14px; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 28px 0; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.plan.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan h2 { margin: 0; font-size: 17px; font-family: var(--mono); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.plan .price { font: 800 38px/1.1 var(--display); letter-spacing: -0.03em; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.plan .price small { font: 400 15px var(--body); letter-spacing: 0; color: var(--muted); }
.plan .alt { margin: 0; color: var(--muted); font-size: 14px; }
.plan ul { padding-left: 18px; margin: 10px 0 14px; font-size: 15px; flex: 1; }
.pp { min-height: 44px; }
.plan .line, .plan .period { min-height: 32px; }
.plan .line { display: flex; align-items: center; }
.period { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: var(--sunk); border-radius: 8px; width: fit-content; max-width: 100%; }
.period button { font: 500 13px var(--body); border: 0; background: none; color: var(--muted); padding: 5px 10px; border-radius: 6px; cursor: pointer; }
.period button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(24 36 92 / .12); }
.result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 16px 0; overflow-wrap: anywhere; }
.result code { display: inline-block; margin: 8px 0; padding: 6px 10px; background: var(--sunk); border-radius: 6px; font-size: 14px; }
.result .btn { margin-right: 8px; }
.result.success { color: var(--ok); }
.result.error { color: var(--err); }

/* Account */
.authbox { max-width: 400px; margin: 24px auto 56px; }
.authbox h1 { font-size: 34px; }
.authform { display: grid; gap: 12px; }
.authform label { display: grid; gap: 5px; font-size: 14px; color: var(--muted); }
.authform input { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.authform .btn { margin-top: 6px; padding: 11px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.table th { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* 404 */
.notfound { padding-block: 24px 40px; }
.notfound .code { font: 600 14px var(--mono); color: var(--muted); letter-spacing: .08em; margin: 24px 0 0; }
.notfound .btn { margin: 0 8px 8px 0; }

/* Footer and cookie notice */
footer { border-top: 1px solid var(--line); margin-top: 24px; padding-block: 22px 44px; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
footer a { color: inherit; }
footer a:hover { color: var(--text); }
footer .made { flex-basis: 100%; }
.consent { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-width: 560px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow);
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 14px; z-index: 10; }
.consent p { margin: 0; flex: 1 1 260px; color: var(--muted); }
.consent .btn { font-size: 14px; padding: 7px 12px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 16px; }
  .nav { gap: 12px; }
  .file { grid-template-columns: minmax(0, 1fr); }
  .controls { justify-content: space-between; }
  .controls select { flex: 1; min-width: 0; }
  .sub { font-size: 17px; }
}
