:root {
  --bg: #0b0c10;
  --bg-soft: #12141a;
  --panel: #15171f;
  --panel-2: #1b1e28;
  --border: #262a36;
  --border-soft: #20242f;
  --text: #eef1f6;
  --text-dim: #9aa3b2;
  --muted: #6b7280;
  --accent: #7c9cff;
  --accent-2: #a78bfa;
  --accent-soft: rgba(124, 156, 255, 0.12);
  --good: #4ade80;
  --bad: #f87171;
  --warn: #fbbf24;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --wrap: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
a { color: inherit; }

/* Ambient background */
.bg-grid {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 400px at 15% -5%, rgba(124, 156, 255, 0.13), transparent 60%),
    radial-gradient(700px 500px at 95% 0%, rgba(167, 139, 250, 0.10), transparent 55%),
    var(--bg);
}
.bg-grid::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 70%);
  opacity: 0.3;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  max-width: var(--wrap); margin: 0 auto;
  padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0b0c10;
}
.brand-name { font-size: 17px; letter-spacing: -0.01em; }
.header-nav { display: flex; align-items: center; gap: 18px; }
.header-nav a { color: var(--text-dim); text-decoration: none; font-size: 14px; font-weight: 500; }
.header-nav a:hover { color: var(--text); }
.badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim);
  background: var(--panel); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 48px 0 32px; }
.hero.compact { padding: 28px 0 20px; }
.hero h1 {
  font-size: clamp(28px, 4.8vw, 44px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08;
  background: linear-gradient(180deg, #fff, #b9c1d4); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { max-width: 580px; margin: 15px auto 0; color: var(--text-dim); font-size: 17px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Ad slots ---------- */
.ad-slot {
  margin: 22px auto; max-width: 970px; min-height: 92px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, var(--panel) 0 12px, var(--bg-soft) 12px 24px);
  border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--muted);
}
.ad-slot.ad-rect { max-width: 336px; min-height: 280px; }
.ad-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ad-slot .ad-hint { font-size: 12px; margin-top: 4px; }
/* Live native-ad container — clean, no placeholder striping */
.ad-native { margin: 24px auto; max-width: 970px; min-height: 90px; }
.ad-native .ad-label { display: block; text-align: center; margin-bottom: 8px; }

/* ---------- Converter panel ---------- */
.converter {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm); background: var(--panel-2);
  padding: 40px 24px; text-align: center; cursor: pointer; outline: none;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.dragover { transform: scale(1.005); }
.dz-icon {
  display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--border); color: var(--accent);
}
.dz-title { font-size: 17px; font-weight: 600; }
.dz-title span { color: var(--text-dim); font-weight: 400; }
.dz-hint { margin-top: 6px; font-size: 12.5px; color: var(--muted); }

.controls {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; margin-top: 18px; padding: 16px 18px;
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.control { display: flex; flex-direction: column; gap: 8px; }
.control label { font-size: 13px; font-weight: 500; color: var(--text-dim); }
.quality-control { flex: 1; min-width: 160px; }
.control-actions { flex-direction: row; gap: 10px; margin-left: auto; align-items: center; }

.target-select {
  appearance: none; font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--text);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa3b2' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 34px 10px 14px; cursor: pointer; min-width: 130px;
}
.target-select:hover { border-color: var(--accent); }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--border); cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); }

.btn {
  font-family: var(--font); font-size: 14px; font-weight: 600; padding: 11px 20px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, filter .15s ease, background .15s, border-color .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0b0c10; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn-ghost { background: var(--panel); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-text { background: transparent; color: var(--text-dim); padding: 8px 4px; }
.btn-text:hover { color: var(--bad); }

/* combined pdf result */
.combined-result { margin-top: 16px; }
.combined-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px;
  background: rgba(74, 222, 128, 0.08); border: 1px solid rgba(74, 222, 128, 0.3); border-radius: var(--radius-sm);
}

/* file cards */
.file-list { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.file-card {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--panel-2);
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm); animation: rise .25s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--bg); border: 1px solid var(--border); flex-shrink: 0; }
.thumb.placeholder { display: grid; place-items: center; color: var(--muted); font-size: 11px; font-weight: 700; }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.arrow { color: var(--accent); }
.size-new { color: var(--good); }
.err-text { color: var(--bad); }
.status { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status.queued { background: var(--border); color: var(--text-dim); }
.status.done { background: rgba(74, 222, 128, 0.14); color: var(--good); }
.status.error { background: rgba(248, 113, 113, 0.14); color: var(--bad); }
.file-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--text-dim); cursor: pointer; transition: color .15s, border-color .15s; }
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn.download:hover { color: var(--good); border-color: var(--good); }
.icon-btn.remove:hover { color: var(--bad); border-color: var(--bad); }
.spinner { width: 15px; height: 15px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.converter-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; min-height: 24px; gap: 12px; }
.foot-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.foot-note svg { color: var(--good); }
.muted { color: var(--muted); }

/* ---------- Hub ---------- */
.hub-searchbar { margin: 8px 0 24px; }
.hub-search {
  width: 100%; font-family: var(--font); font-size: 15px; color: var(--text);
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px;
}
.hub-search:focus { outline: none; border-color: var(--accent); }
.hub-search::placeholder { color: var(--muted); }
.hub-groups { display: flex; flex-direction: column; gap: 30px; }
.hub-group-title { font-size: 14px; font-weight: 600; color: var(--text-dim); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.conv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.conv-card {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  transition: border-color .15s, transform .15s, background .15s;
}
.conv-card:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--panel-2); }
.conv-pair { display: flex; align-items: center; gap: 8px; }
.conv-arrow { color: var(--muted); display: inline-flex; }
.conv-name { font-size: 14px; font-weight: 500; color: var(--text); }
.hub-empty { color: var(--text-dim); text-align: center; padding: 40px 0; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim); }
.tag-jpg { color: #fca5a5; border-color: rgba(252,165,165,.3); background: rgba(252,165,165,.08); }
.tag-png { color: #93c5fd; border-color: rgba(147,197,253,.3); background: rgba(147,197,253,.08); }
.tag-webp { color: #6ee7b7; border-color: rgba(110,231,183,.3); background: rgba(110,231,183,.08); }
.tag-heic { color: #c4b5fd; border-color: rgba(196,181,253,.3); background: rgba(196,181,253,.08); }
.tag-avif { color: #f9a8d4; border-color: rgba(249,168,212,.3); background: rgba(249,168,212,.08); }
.tag-gif { color: #fcd34d; border-color: rgba(252,211,77,.3); background: rgba(252,211,77,.08); }
.tag-pdf { color: #fca5a5; border-color: rgba(252,165,165,.3); background: rgba(252,165,165,.08); }
.tag-ico { color: #7dd3fc; border-color: rgba(125,211,252,.3); background: rgba(125,211,252,.08); }
.tag-svg { color: #fdba74; border-color: rgba(253,186,116,.3); background: rgba(253,186,116,.08); }
.tag-tiff { color: #a5b4fc; border-color: rgba(165,180,252,.3); background: rgba(165,180,252,.08); }
.tag-bmp { color: #d1d5db; border-color: rgba(209,213,219,.3); background: rgba(209,213,219,.08); }

/* ---------- Content sections (how-to, faq, related) ---------- */
.section { margin-top: 44px; }
.section h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 16px; }
.section h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.prose p { color: var(--text-dim); margin-bottom: 14px; }
.prose a { color: var(--accent); text-decoration: none; }
.prose a:hover { text-decoration: underline; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { padding: 20px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); position: relative; }
.step::before {
  counter-increment: step; content: counter(step); display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px; margin-bottom: 10px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0b0c10;
}
.step p { font-size: 13.5px; color: var(--text-dim); }

.faq-item { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--panel); margin-bottom: 10px; overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 16px 18px; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--accent); font-size: 20px; font-weight: 400; }
.faq-item[open] summary::after { content: '−'; }
.faq-item .faq-a { padding: 0 18px 16px; color: var(--text-dim); font-size: 14.5px; }

.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.related-grid a {
  padding: 12px 14px; text-decoration: none; font-size: 13.5px; font-weight: 500; color: var(--text-dim);
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 8px; transition: color .15s, border-color .15s;
}
.related-grid a:hover { color: var(--text); border-color: var(--accent); }

/* feature cards (home) */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.feature { padding: 22px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.feature h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.feature p { font-size: 13.5px; color: var(--text-dim); }

/* legal / prose pages */
.legal { max-width: 760px; }
.legal h1 { font-size: 30px; margin-bottom: 8px; letter-spacing: -0.02em; }
.legal h2 { font-size: 19px; margin: 26px 0 10px; }
.legal p, .legal li { color: var(--text-dim); margin-bottom: 12px; }
.legal ul { padding-left: 22px; }
.legal .updated { color: var(--muted); font-size: 13px; margin-bottom: 24px; }

/* footer */
.site-footer { border-top: 1px solid var(--border-soft); margin-top: 60px; padding: 32px 24px; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--text-dim); text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-note { font-size: 13px; color: var(--muted); }

/* responsive */
@media (max-width: 720px) {
  .features, .steps { grid-template-columns: 1fr; }
  .controls { flex-direction: column; align-items: stretch; }
  .control-actions { margin-left: 0; }
  .control-actions .btn { flex: 1; }
  .target-select { width: 100%; }
  .header-nav a { display: none; }
  .header-nav .badge { display: inline-flex; }
}
