:root {
  --bg: #0f1221;
  --bg-soft: #171a2e;
  --card: #1c2039;
  --card-2: #232845;
  --line: #2c3357;
  --text: #e8eaf6;
  --muted: #9aa0c3;
  --primary: #6c8bff;
  --primary-2: #8a6cff;
  --ok: #3ddc97;
  --err: #ff6b6b;
  --radius: 16px;
  --shadow-soft: 0 8px 30px rgba(0,0,0,.28);
  --shadow-card: 0 24px 70px rgba(0,0,0,.42);
  --glow: 0 8px 24px rgba(108,139,255,.40);
}

* { box-sizing: border-box; }

.hidden { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(900px 480px at 85% -8%, rgba(138,108,255,.22) 0%, transparent 60%),
    radial-gradient(900px 520px at 8% 0%, rgba(108,139,255,.16) 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero, .card, .tools, .how, .faq, .prose, .related { animation: rise .5s ease both; }
  .card { animation-delay: .05s; }
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(15,18,33,.72); backdrop-filter: blur(10px); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.logo {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 11px; background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}
.logo svg { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.2rem; }
.brand-domain { font-size: .72rem; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 20px; }
.nav a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.nav a:hover { color: var(--text); }
.lang-switch {
  border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px;
  font-weight: 700; font-size: .8rem; letter-spacing: .03em;
}
.lang-switch:hover { border-color: var(--primary); color: #fff !important; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.04); color: var(--muted);
  border: 1px solid var(--line); padding: 5px 13px 5px 11px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; letter-spacing: .01em;
}
.badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 3px rgba(61,220,151,.18);
}

main { max-width: 900px; margin: 0 auto; padding: 36px 20px 64px; }

.hero { text-align: center; margin: 14px 0 34px; }
.hero h1 {
  font-size: 2.4rem; margin: 0 0 16px; line-height: 1.3; letter-spacing: -.02em;
  padding: .08em 0;  /* room so gradient-clipped glyphs aren't cut off top/bottom */
  background: linear-gradient(120deg, #fff 0%, #cfd6ff 45%, var(--primary) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero .sub { color: var(--muted); margin: 0 auto; max-width: 640px; font-size: 1.04rem; line-height: 1.6; }
.trust { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; font-size: .85rem; }
.trust span {
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  color: var(--muted); padding: 6px 14px; border-radius: 999px;
}

.card {
  position: relative;
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-card); scroll-margin-top: 90px;
}
/* subtle highlight line along the top edge */
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
}

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 44px 20px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
.dropzone:hover, .dropzone:focus { border-color: var(--primary); background: rgba(108,139,255,.07); outline: none; transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.dropzone.dragover { border-color: var(--primary); background: rgba(108,139,255,.16); transform: scale(1.01); }
.dz-icon { font-size: 2.8rem; transition: transform .2s; }
.dropzone:hover .dz-icon { transform: translateY(-3px) scale(1.06); }
.dz-title { font-size: 1.18rem; font-weight: 600; margin: 10px 0 14px; }
.dz-hint { margin: 0; }
.dz-limits { color: var(--muted); font-size: .85rem; margin-top: 14px; }

.btn {
  border: none; border-radius: 11px; padding: 11px 22px; font: inherit; font-weight: 600;
  cursor: pointer; transition: transform .12s ease, opacity .2s, box-shadow .2s, border-color .2s; color: #fff;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: var(--glow); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(108,139,255,.55); }
.btn.primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.small { padding: 7px 15px; font-size: .85rem; }
.btn.ghost { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--primary); color: #fff; }

/* Download button — distinct "success / ready" action (muted green) */
.btn.download {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, #2c9d72, #1c8160);
  box-shadow: 0 5px 14px rgba(40,140,100,.20);
  text-decoration: none;
}
.btn.download:hover { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(40,140,100,.30); }
.btn.download svg { display: block; }

.file-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.file-item:hover { border-color: rgba(108,139,255,.5); box-shadow: var(--shadow-soft); }
.file-thumb {
  width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--bg);
  display: grid; place-items: center; font-size: 1.4rem; flex: 0 0 auto;
}
.file-meta { flex: 1; min-width: 0; }
.file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub { color: var(--muted); font-size: .82rem; }

.row-convert { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.row-arrow { color: var(--muted); }
.row-target, .row-target-fixed {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 10px; font: inherit; font-size: .88rem; min-width: 140px;
}
.row-target-fixed { display: inline-block; text-align: center; }
select.row-target { accent-color: var(--primary); cursor: pointer; }

.file-status { min-width: 90px; text-align: right; }
.status-ok { color: var(--ok); }
.status-err { color: var(--err); font-size: .82rem; }
.status-pending { color: var(--muted); font-size: .85rem; }
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--primary);
  border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress { display: inline-block; width: 60px; height: 6px; border-radius: 99px; background: var(--line); vertical-align: middle; overflow: hidden; }
.progress-bar { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .15s linear; }
.progress-pct { color: var(--muted); font-size: .8rem; margin-left: 8px; vertical-align: middle; }
.remove-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; flex: 0 0 auto; }
.remove-btn:hover { color: var(--err); }

/* ---- IP checker ---- */
.card + .card { margin-top: 20px; }
.ip-hero { text-align: center; padding: 8px 0; }
.ip-hero-label { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.ip-hero-value { font-size: 2rem; font-weight: 700; margin: 8px 0 4px; word-break: break-all; font-variant-numeric: tabular-nums; }
.ip-hero-geo { color: var(--muted); margin-bottom: 16px; }
.ip-section-title { font-size: 1.05rem; margin: 0 0 14px; }
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .92rem; }
.kv th { color: var(--muted); font-weight: 500; width: 38%; white-space: nowrap; }
.kv td { color: var(--text); word-break: break-word; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: none; }
.kv-empty { color: var(--muted); }
.ip-note { color: var(--muted); font-size: .82rem; text-align: center; margin: 22px auto 0; max-width: 640px; }

.actions { display: flex; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.how, .faq { margin-top: 48px; scroll-margin-top: 90px; }
.how h2, .faq h2, .tools h2 { text-align: center; margin-bottom: 24px; font-size: 1.5rem; letter-spacing: -.01em; }
.how h2::after, .faq h2::after, .tools h2::after {
  content: ""; display: block; width: 54px; height: 3px; margin: 12px auto 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; text-align: center; transition: transform .15s, border-color .15s; }
.step:hover { transform: translateY(-3px); border-color: var(--primary); }
.step-num {
  width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 10px;
  display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
}
.step h3 { margin: 0 0 6px; font-size: 1rem; }
.step p { margin: 0; color: var(--muted); font-size: .88rem; }

.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 10px; transition: border-color .15s, background .15s;
}
.faq details[open] { border-color: var(--primary); background: var(--card-2); }
.faq summary {
  cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary);
  transition: transform .2s; flex: 0 0 auto;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin: 12px 0 2px; line-height: 1.6; }

footer { text-align: center; color: var(--muted); padding: 26px; border-top: 1px solid var(--line); font-size: .85rem; margin-top: 40px; }

/* ---- Tool landing pages ---- */
.breadcrumbs {
  max-width: 920px; margin: 24px auto 6px; padding: 0 20px;
  display: flex; align-items: center; gap: 9px; font-size: .84rem;
}
.breadcrumbs a {
  color: var(--muted); text-decoration: none; padding: 4px 4px; border-radius: 6px;
  transition: color .15s;
}
.breadcrumbs a:hover { color: var(--text); }
.bc-sep { color: var(--muted); opacity: .45; }
.bc-current {
  color: var(--text); font-weight: 600;
  background: var(--card-2); border: 1px solid var(--line);
  padding: 4px 12px; border-radius: 999px;
}

.prose { max-width: 920px; margin: 6px auto 0; padding: 0 20px; color: var(--muted); line-height: 1.7; }
.prose p { margin: 0 0 14px; }

.related { max-width: 920px; margin: 30px auto 0; padding: 0 20px; }
.related h2 { font-size: 1.15rem; margin-bottom: 14px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.related-card {
  display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text); text-decoration: none; font-size: .92rem;
  transition: border-color .15s, transform .15s, box-shadow .15s, background .15s;
}
.related-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-soft); background: var(--card-2); }

/* GIF background ("футаж") controls */
.tool-options {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin: 14px 0 4px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card-2); font-size: .9rem;
}
.tool-options .opt-title { font-weight: 600; color: var(--muted); }
.opt-color { display: inline-flex; align-items: center; gap: 8px; }
.opt-color input[type="color"] {
  width: 36px; height: 28px; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: none; cursor: pointer;
}
.opt-color input[type="color"]:disabled { opacity: .4; cursor: not-allowed; }
.opt-presets { display: inline-flex; gap: 6px; }
.swatch {
  width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--line);
  cursor: pointer; padding: 0;
}
.swatch:hover { border-color: var(--primary); }
.opt-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* Converter grid on the homepage */
.tools { max-width: 920px; margin: 36px auto 0; padding: 0 20px; }
.tools h2 { margin-bottom: 22px; }
.tool-group { margin-bottom: 26px; }
.tool-group h3 {
  font-size: 1rem; color: var(--text); margin: 0 0 12px; font-weight: 700;
  display: flex; align-items: center; gap: 9px;
}
.tool-group h3::before {
  content: ""; width: 4px; height: 16px; border-radius: 99px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}
.tool-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 10px; }
.tool-links a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--card); color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 500;
  transition: border-color .15s, transform .15s, box-shadow .15s, background .15s;
}
.tool-links a::after { content: "→"; color: var(--muted); transition: transform .15s, color .15s; }
.tool-links a:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-soft); background: var(--card-2); }
.tool-links a:hover::after { transform: translateX(3px); color: var(--primary); }

.logo { box-shadow: var(--glow); }

footer { background: rgba(0,0,0,.18); }

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .nav a { display: none; }
  .file-item { flex-wrap: wrap; }
  .row-convert { order: 3; width: 100%; }
  .row-target { flex: 1; }
  .file-status { order: 4; min-width: auto; }
  main { padding-top: 24px; }
}

/* ---- SEO content pages: blog, formats, article, API ---- */
.post-list { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.post-card { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 14px; transition: border-color .15s, transform .15s; }
.post-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.post-card h2 { font-size: 1.2rem; margin: 0 0 8px; }
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: #fff; }
.post-lead { color: var(--muted); margin: 0 0 10px; line-height: 1.6; }
.post-meta { color: var(--muted); font-size: .85rem; }
.post-meta a { color: var(--primary); text-decoration: none; }

.article { max-width: 760px; }
.article h1 { color: var(--text); font-size: 1.9rem; line-height: 1.25; margin: 6px 0 12px; }
.article h2 { color: var(--text); font-size: 1.3rem; margin: 28px 0 10px; }
.article .lead { color: var(--text); font-size: 1.08rem; margin: 0 0 18px; }
.article ul { margin: 0 0 16px; padding-left: 22px; }
.article li { margin: 6px 0; }
.article .ext { color: var(--muted); font-weight: 400; font-size: 1.1rem; }
.article pre { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; overflow-x: auto; margin: 0 0 16px; }
.article pre code { color: var(--text); font-size: .88rem; line-height: 1.5; }
.article :not(pre) > code { background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 6px; font-size: .9em; color: var(--text); }

.format-facts { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px;
  margin: 0 0 18px; background: var(--card); }
.format-facts dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin-top: 8px; }
.format-facts dt:first-child { margin-top: 0; }
.format-facts dd { margin: 2px 0 0; color: var(--text); }
.format-card { flex-direction: column; align-items: flex-start; gap: 4px; }
.format-name { font-weight: 700; color: var(--text); }
.format-sum { font-size: .85rem; color: var(--muted); line-height: 1.4; }

.back-link { max-width: 760px; margin: 24px auto 0; padding: 0 20px; }
.back-link a { color: var(--primary); text-decoration: none; }
.footer-nav { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.footer-nav a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.footer-nav a:hover { color: var(--text); }
