/* вФормат — дизайн-система. Холодная светлая гамма, сигнальный синий, Unbounded для заголовков. */

@font-face {
  font-family: 'Unbounded';
  src: url('/assets/fonts/unbounded-600-cyr.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  src: url('/assets/fonts/unbounded-600-lat.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2192;
}

:root {
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --ink: #0E1B2C;
  --muted: #5A6B80;
  --accent: #1F5EFF;
  --accent-soft: #E8EEFF;
  --accent-ink: #0A3ACD;
  --ok: #12A150;
  --ok-soft: #E5F6EC;
  --warn: #B54708;
  --line: #E2E8F1;
  --shadow: 0 1px 2px rgba(14, 27, 44, .05), 0 8px 24px -12px rgba(14, 27, 44, .12);
  --r: 14px;
  --display: 'Unbounded', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1220;
    --surface: #121C2E;
    --ink: #E8EEF6;
    --muted: #93A3B8;
    --accent: #4D7FFF;
    --accent-soft: #172440;
    --accent-ink: #7FA3FF;
    --ok: #2BC46F;
    --ok-soft: #12301F;
    --line: #22304A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Авторские display:flex/grid не должны перебивать атрибут hidden */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; vertical-align: middle; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 780px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.mt { margin-top: 40px; }

h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
h1 { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 4.4vw, 44px); letter-spacing: -.01em; }
h2 { font-family: var(--display); font-weight: 600; font-size: clamp(20px, 2.6vw, 28px); margin-bottom: 16px; }
h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.accent { color: var(--accent); }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-text { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.logo-text em { font-style: normal; color: var(--accent); }
.logo-text.small { font-size: 16px; }
.site-nav { display: flex; gap: 22px; font-size: 14.5px; font-weight: 500; }
.site-nav a { color: var(--muted); white-space: nowrap; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav .nav-all { color: var(--accent-ink); }
@media (max-width: 640px) { .site-nav a:not(.nav-all) { display: none; } }

/* ---------- hero ---------- */
.hero { padding: 56px 0 40px; text-align: center; }
.hero-tool { padding-top: 24px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 12px; }
.hero-sub { max-width: 640px; margin: 14px auto 0; color: var(--muted); font-size: 17px; }
.hero-pairs { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--muted); }
.hero-pairs .hp-to { color: var(--accent); }

.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; list-style: none; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.trust li::before { content: '✓ '; color: var(--ok); font-weight: 700; }

/* ---------- converter widget ---------- */
.converter { max-width: 640px; margin: 28px auto 0; text-align: left; }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 44px 24px; cursor: pointer;
  background: var(--surface); border: 2px dashed var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); transition: border-color .2s, background .2s, transform .2s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.dz-title { font-weight: 700; font-size: 17px; }
.dz-sub { color: var(--muted); font-size: 14.5px; }
.dz-link { color: var(--accent-ink); font-weight: 600; text-decoration: underline; }
.dz-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.conv-options { display: flex; flex-wrap: wrap; gap: 16px 28px; margin-top: 14px; align-items: center; }
.opt { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.opt-label { color: var(--muted); font-weight: 600; }
.opt-label b { color: var(--ink); }
/* Сегментный переключатель */
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 2px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 3px;
}
.seg-btn {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted);
  background: transparent; border: 0; border-radius: 8px; padding: 7px 13px;
  cursor: pointer; transition: background .15s, color .15s; white-space: nowrap;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: var(--accent); color: #fff; }
.conv-options-col { flex-direction: column; align-items: flex-start; gap: 12px; }
.hero .conv-options-col, .cropper .conv-options-col, .resizer .conv-options-col { align-items: center; }
.opt { flex-wrap: wrap; justify-content: center; }

/* Ползунок качества */
.opt-q {
  -webkit-appearance: none; appearance: none;
  width: 200px; height: 6px; border-radius: 999px;
  background: var(--line); outline-offset: 4px; cursor: pointer;
}
.opt-q::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface);
  box-shadow: 0 1px 4px rgba(14, 27, 44, .3);
}
.opt-q::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface);
  box-shadow: 0 1px 4px rgba(14, 27, 44, .3);
}
.opt-q::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line); }

.conv-results { list-style: none; margin-top: 16px; display: grid; gap: 8px; }
.conv-results li {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  font-size: 14px;
}
.cr-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.cr-size { color: var(--muted); white-space: nowrap; }
.cr-save { color: var(--ok); font-weight: 700; white-space: nowrap; }
.cr-status { color: var(--muted); }
.cr-err { color: var(--warn); }
.cr-dl {
  margin-left: auto; display: inline-block; background: var(--ok-soft); color: var(--ok);
  font-weight: 700; padding: 6px 14px; border-radius: 8px; white-space: nowrap;
}
.cr-dl:hover { text-decoration: none; filter: brightness(.95); }

.conv-actions { display: flex; gap: 10px; margin-top: 14px; }
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 10px;
  padding: 11px 22px; background: var(--accent); color: #fff; transition: filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.conv-note { margin-top: 12px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- sections ---------- */
.section { padding: 48px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-sub { color: var(--muted); margin: -8px 0 20px; }

.grid-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.center-grid { justify-content: center; margin-top: 24px; }
.fmt-card {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 10px; font-weight: 700; font-size: 14.5px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.section-alt .fmt-card { background: var(--bg); }
.fmt-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); }
.fmt-card svg { color: var(--accent); flex: none; }
.fmt-to { color: var(--accent-ink); }
.fmt-compress { border-style: dashed; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.step { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.section:not(.section-alt) .step { background: var(--surface); }
.step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; margin-bottom: 12px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-family: var(--display); font-weight: 600; font-size: 15px;
}
.step p { color: var(--muted); font-size: 14.5px; }

.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.why { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.why p { color: var(--muted); font-size: 14.5px; }

.seo-p { margin-bottom: 14px; color: var(--ink); }
.seo-p + h2, .notes + h2, .fmt-about + h2, .faq + h2 { margin-top: 36px; }

.notes { list-style: none; display: grid; gap: 10px; margin: 0 0 32px; }
.notes li { background: var(--surface); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 10px 14px; font-size: 14.5px; }
.section-alt .notes li { background: var(--bg); }

.fmt-about { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 32px; }
.fa-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.fa-card p { color: var(--muted); font-size: 14.5px; }

.faq { display: grid; gap: 8px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.section-alt .faq-item { background: var(--bg); }
.faq-item summary { cursor: pointer; font-weight: 600; padding: 14px 18px; list-style: none; position: relative; padding-right: 40px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: 18px; top: 12px; font-size: 20px; color: var(--accent); transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 18px 16px; color: var(--muted); font-size: 14.5px; }

.breadcrumbs { padding-top: 16px; font-size: 13px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }

/* ---------- обрезка фото ---------- */
.cropper, .resizer { max-width: 640px; margin: 28px auto 0; text-align: left; }
.crop-stage, .resize-stage { text-align: center; }
.crop-wrap {
  position: relative; display: inline-block; overflow: hidden;
  border-radius: var(--r); box-shadow: var(--shadow); line-height: 0;
  background: var(--surface);
}
.crop-img { display: block; max-width: 100%; max-height: 60vh; user-select: none; -webkit-user-drag: none; }
.crop-box {
  position: absolute; cursor: move; touch-action: none;
  border: 2px solid #fff; outline: 1px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(10, 16, 28, .55);
}
.crop-h {
  position: absolute; width: 16px; height: 16px; box-sizing: border-box;
  background: #fff; border: 2px solid var(--accent); border-radius: 4px; touch-action: none;
}
.h-nw { left: -9px; top: -9px; cursor: nwse-resize; }
.h-ne { right: -9px; top: -9px; cursor: nesw-resize; }
.h-sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.h-se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.h-n { left: 50%; top: -9px; margin-left: -8px; cursor: ns-resize; }
.h-s { left: 50%; bottom: -9px; margin-left: -8px; cursor: ns-resize; }
.h-w { left: -9px; top: 50%; margin-top: -8px; cursor: ew-resize; }
.h-e { right: -9px; top: 50%; margin-top: -8px; cursor: ew-resize; }
.crop-dims { margin-top: 10px; font-size: 13.5px; }
.cropper .conv-options, .resizer .conv-options { justify-content: center; }
.cropper .conv-actions, .resizer .conv-actions { justify-content: center; margin-top: 16px; }

/* ---------- изменение размера ---------- */
.resize-preview-wrap { line-height: 0; }
.resize-img {
  max-width: 100%; max-height: 240px; border-radius: var(--r); box-shadow: var(--shadow);
}
.resize-orig { margin-top: 10px; font-size: 13.5px; }
.resize-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; margin-top: 14px; }
.rz-x { color: var(--muted); font-weight: 700; }
.num {
  font: inherit; font-weight: 700; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 104px;
}
.opt-check { gap: 8px; cursor: pointer; }
.opt-check input { accent-color: var(--accent); width: 16px; height: 16px; }
.resize-presets { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.chip {
  font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  background: var(--accent-soft); color: var(--accent-ink);
  border: 0; border-radius: 999px; padding: 7px 14px; transition: filter .15s;
}
.chip:hover { filter: brightness(.96); }

/* ---------- cookie-баннер и юридические страницы ---------- */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100;
  max-width: 720px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 8px 32px -8px rgba(14, 27, 44, .25);
  padding: 16px 18px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
}
.cb-text { flex: 1 1 320px; font-size: 13.5px; color: var(--muted); margin: 0; }
.cb-text a { font-weight: 600; }
.cb-actions { display: flex; gap: 8px; flex: none; }
.cb-actions .btn { padding: 9px 18px; font-size: 14px; }

.legal h2 { margin-top: 32px; }
.legal p { margin-bottom: 12px; }
.legal .notes { margin-bottom: 16px; }
.cookie-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 16px; }
.cookie-table th, .cookie-table td {
  text-align: left; padding: 10px 12px; border: 1px solid var(--line); vertical-align: top;
}
.cookie-table th { background: var(--surface); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cookie-table td:first-child { font-family: ui-monospace, Consolas, monospace; white-space: nowrap; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 40px 0 24px; margin-top: 24px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot-brand p { color: var(--muted); font-size: 13.5px; margin-top: 8px; max-width: 260px; }
.foot-h { font-family: var(--body); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.foot-col { display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.foot-col a { color: var(--ink); }
.foot-note { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
