/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --border: #e3e6ee;
  --text: #171a23;
  --text-muted: #5b6072;
  --accent: #2f6fed;
  --accent-ink: #ffffff;
  --accent-soft: #eaf1fd;
  --success: #1c9a6c;
  --success-soft: #e7f7f0;
  --danger: #d34b43;
  --danger-soft: #fdecea;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 2px rgba(20, 24, 40, 0.04), 0 12px 32px -16px rgba(20, 24, 40, 0.12);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --surface: #171a23;
    --surface-2: #1e222d;
    --border: #2a2f3c;
    --text: #eef0f5;
    --text-muted: #99a0b4;
    --accent: #5b8bf7;
    --accent-ink: #0f1117;
    --accent-soft: #1b2740;
    --success: #35c088;
    --success-soft: #123527;
    --danger: #ef6961;
    --danger-soft: #3a1e1c;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.02em; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 860px; margin-inline: auto; padding-inline: 1.25rem; }
.skip-link {
  position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem;
  background: var(--surface); color: var(--text); z-index: 9999;
  border-radius: 8px; font-weight: 600; box-shadow: var(--shadow-card);
}
.skip-link:focus { top: 1rem; }
.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;
}

/* =============================================================
   4. Typography
   ============================================================= */
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.h1 { font-size: clamp(1.7rem, 4.6vw, 2.5rem); font-weight: 800; max-width: 20ch; margin-inline: auto; }
.lede { color: var(--text-muted); font-size: 1.05rem; max-width: 46ch; margin-inline: auto; }
.section-title { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 800; margin-bottom: .5rem; }
.section-text { color: var(--text-muted); }
.section-text p + p { margin-top: .9rem; }

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.4rem; border-radius: 999px; font-weight: 700; font-size: .98rem;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s var(--ease-out);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--accent) 75%, transparent); }
.btn-primary:active { transform: translateY(0); }
.btn-block { width: 100%; }
.btn-link { color: var(--accent); font-weight: 700; padding: .5rem; }
.btn-link:hover { text-decoration: underline; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.badge {
  display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 600;
  color: var(--text-muted); background: var(--surface-2); border-radius: 999px; padding: .4rem .85rem;
}

/* =============================================================
   6. Header
   ============================================================= */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 1.1rem; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent);
  color: var(--accent-ink); display: grid; place-items: center; flex-shrink: 0;
}
.header-note { font-size: .85rem; color: var(--text-muted); }

/* =============================================================
   7. Hero + Tool
   ============================================================= */
.hero { padding-block: 2.6rem 1.4rem; text-align: center; }
.hero-inner { display: grid; gap: .9rem; margin-bottom: 2rem; }

.tool-section { padding-bottom: 2.5rem; }
.tool-card { padding: 1.6rem; display: grid; gap: 1.1rem; }

.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius-md);
  padding: 2.6rem 1.5rem; display: grid; justify-items: center; gap: .5rem;
  text-align: center; cursor: pointer; transition: border-color .18s var(--ease-out), background .18s var(--ease-out);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon { color: var(--accent); margin-bottom: .3rem; }
.dropzone-title { font-weight: 700; font-size: 1.05rem; }
.dropzone-sub { color: var(--text-muted); font-size: .85rem; }
.dropzone-formats { color: var(--text-muted); font-size: .82rem; margin-top: .4rem; }

.file-card {
  display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem;
  background: var(--surface-2); border-radius: var(--radius-md); border: 1px solid var(--border);
}
.file-meta { flex: 1; min-width: 0; }
.file-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-sub { color: var(--text-muted); font-size: .85rem; margin-top: .1rem; }
.file-remove {
  width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
  color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0;
}
.file-remove:hover { background: var(--border); color: var(--text); }

.progress-wrap { display: grid; gap: .6rem; padding: .4rem 0; }
.progress-label { font-size: .9rem; color: var(--text-muted); text-align: center; }
.progress-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; width: 4%; background: var(--accent); border-radius: 999px; transition: width .3s var(--ease-out); }

.result-card { display: grid; justify-items: center; gap: .55rem; padding: 1.6rem 1rem; text-align: center; }
.result-icon {
  width: 52px; height: 52px; border-radius: 999px; background: var(--success-soft); color: var(--success);
  display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; margin-bottom: .3rem;
}
.result-title { font-weight: 800; font-size: 1.2rem; }
.result-filename { color: var(--text-muted); font-size: .9rem; word-break: break-word; }
.btn-download { margin-top: .5rem; font-size: 1.05rem; padding: 1rem 2rem; }

.error-card { display: grid; justify-items: center; gap: .5rem; padding: 1.4rem 1rem; text-align: center; }
.error-title { font-weight: 800; color: var(--danger); }
.error-message { color: var(--text-muted); max-width: 46ch; }

.privacy-note {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem 1rem;
  margin-top: 1.1rem; text-align: center; font-size: .85rem; color: var(--text-muted);
}
.limits-note { font-size: .8rem; color: var(--text-muted); text-align: center; margin-top: .3rem; }

/* =============================================================
   8. Ad slots
   ============================================================= */
.ad-slot {
  border: 1px dashed var(--border); border-radius: var(--radius-md); min-height: 90px;
  display: grid; place-items: center; color: var(--text-muted); font-size: .8rem;
  margin-block: 1.6rem;
}

/* =============================================================
   9. How it works / SEO / FAQ
   ============================================================= */
.section { padding-block: 2.2rem; }
.steps { display: grid; gap: 1rem; margin-top: 1.3rem; grid-template-columns: repeat(3, 1fr); }
.step { padding: 1.2rem; display: grid; gap: .5rem; }
.step-num {
  width: 30px; height: 30px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
}
.step h3 { font-size: 1rem; }
.step p { color: var(--text-muted); font-size: .9rem; }

.faq-list { display: grid; gap: .7rem; margin-top: 1.2rem; }
.faq-item { padding: 1rem 1.1rem; }
.faq-item summary {
  cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); flex-shrink: 0; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { color: var(--text-muted); margin-top: .6rem; }

.more-tools { display: grid; gap: .8rem; grid-template-columns: repeat(2, 1fr); margin-top: 1.2rem; }
.tool-chip { padding: 1rem; display: grid; gap: .2rem; }
.tool-chip strong { font-size: .95rem; }
.tool-chip span { color: var(--text-muted); font-size: .85rem; }

/* =============================================================
   10. Footer
   ============================================================= */
.site-footer { border-top: 1px solid var(--border); padding-block: 1.8rem; margin-top: 1rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-credit { font-size: .78rem; color: var(--text-muted); }

/* =============================================================
   11. No-JS fallback
   ============================================================= */
.no-js-note { display: none; }
.no-js .tool-card > *:not(.no-js-note) { display: none; }
.no-js .no-js-note { display: block; padding: 1rem; background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-md); font-weight: 600; }

/* =============================================================
   12. Responsive
   ============================================================= */
@media (max-width: 719px) {
  .steps { grid-template-columns: 1fr; }
  .more-tools { grid-template-columns: 1fr; }
  .dropzone { padding: 2rem 1rem; }
}
@media (min-width: 720px) {
  .container { padding-inline: 1.5rem; }
}
