/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1d1a;
  --text-soft: #55564f;
  --border: #e4e3dd;
  --accent: #1f6f50;
  --accent-ink: #0f3d2c;
  --accent-soft: #e4f2ea;
  --error: #b3261e;
  --error-soft: #fbe9e7;
  --radius: 14px;
  --radius-sm: 8px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: 1.1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141613;
    --surface: #1d201c;
    --text: #f1f2ee;
    --text-soft: #b4b6ac;
    --border: #33362f;
    --accent: #3fa877;
    --accent-ink: #d7f2e4;
    --accent-soft: #1f2e26;
    --error-soft: #3a2220;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg { 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 { text-wrap: balance; line-height: 1.1; letter-spacing: -0.01em; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.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: 0 2px 10px rgba(0,0,0,.15);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 760px; margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text-soft); }

/* =============================================================
   4. Header
   ============================================================= */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem var(--gutter);
  border-bottom: 1px solid var(--border);
}
.logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.logo img { border-radius: 6px; }
.logo span { color: var(--accent); }
.header-nav { display: none; gap: 1.1rem; font-size: .9rem; font-weight: 600; }
.header-nav a:hover { color: var(--accent); }
@media (min-width: 540px) { .header-nav { display: flex; } }

/* =============================================================
   5. Hero
   ============================================================= */
.hero { padding: 2.2rem 0 1.2rem; text-align: center; }
.hero h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); max-width: 26ch; margin-inline: auto; }
.hero__kicker { color: var(--accent); font-weight: 700; letter-spacing: .02em; margin-top: .7rem; }
.hero p { color: var(--text-soft); margin-top: .6rem; max-width: 42ch; margin-inline: auto; }
.hero p.hero__kicker { max-width: none; }

/* =============================================================
   6. Tool card
   ============================================================= */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  margin-top: 1.4rem;
}
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); }
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone__icon { margin: 0 auto .6rem; color: var(--accent); }
.dropzone__title { font-weight: 700; }
.dropzone__hint { color: var(--text-soft); font-size: .9rem; margin-top: .3rem; }

.tool-controls {
  display: flex; flex-wrap: wrap; gap: 1rem;
  margin-top: 1rem; align-items: center;
}
.field { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; color: var(--text-soft); flex: 1 1 160px; }
.field select, .field input[type="range"] { width: 100%; }
select {
  font: inherit; padding: .5rem .6rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}

.file-list { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: .5rem; }
.file-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .88rem; background: var(--bg);
}
.file-row__name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row__size { color: var(--text-soft); white-space: nowrap; }
.file-row__badge { font-size: .8rem; color: var(--text-soft); white-space: nowrap; }
.file-row__badge.is-error { color: var(--error); }
.file-row__badge.is-working { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .75rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-weight: 700; font-size: .95rem;
  transition: transform .15s var(--ease-out), filter .15s var(--ease-out);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn--small { padding: .45rem .7rem; font-size: .85rem; }
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); }

.tool-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

.privacy-badge {
  display: flex; align-items: flex-start; gap: .5rem;
  margin-top: 1rem; padding: .7rem .8rem;
  background: var(--accent-soft); color: var(--accent-ink);
  border-radius: var(--radius-sm); font-size: .85rem;
}
.limits-note { color: var(--text-soft); font-size: .8rem; margin-top: .5rem; }

/* tool card states */
.tool-card[data-state="idle"] .file-list { display: none; }
.tool-card[data-state="idle"] [data-download-all] { display: none; }

/* =============================================================
   7. Ad slots
   ============================================================= */
.ad-slot {
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft); font-size: .8rem;
  margin: 1.6rem auto; max-width: 760px;
}

/* =============================================================
   8. Content sections
   ============================================================= */
.section { padding: 1.4rem 0; }
.section h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); margin-bottom: .8rem; }
.section p + p { margin-top: .8rem; }
.section p { color: var(--text-soft); }

.steps { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: 1rem; }
.step { display: flex; gap: .8rem; align-items: flex-start; }
.step__num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem;
}
.step__body h3 { font-size: 1rem; margin-bottom: .2rem; }
.step__body p { font-size: .9rem; }

.faq-list details {
  border-bottom: 1px solid var(--border);
  padding: .8rem 0;
}
.faq-list summary {
  cursor: pointer; font-weight: 700; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--accent); font-weight: 800; }
.faq-list details[open] summary::after { content: "–"; }
.faq-list p { margin-top: .5rem; font-size: .92rem; }

.credits { font-size: .78rem; color: var(--text-soft); margin-top: 1rem; }

/* =============================================================
   9. Footer
   ============================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.4rem var(--gutter) 2rem;
  color: var(--text-soft); font-size: .85rem;
  display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; justify-content: space-between;
}
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }

/* =============================================================
   10. Reveal (functional micro-motion, not gated by reduced-motion)
   ============================================================= */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
[data-reveal].is-revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* =============================================================
   11. Cookie banner
   ============================================================= */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 1rem var(--gutter);
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  transform: translateY(110%);
  transition: transform .3s var(--ease-out);
  display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between;
}
.cookie-banner.is-open { transform: translateY(0); }
.cookie-banner__text { flex: 1 1 320px; font-size: .85rem; color: var(--text-soft); }
.cookie-banner__text a { color: var(--accent); text-decoration: underline; }
.cookie-banner__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.cookie-banner__settings {
  flex: 1 0 100%; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  padding-top: .8rem; border-top: 1px solid var(--border); margin-top: .4rem;
  font-size: .85rem;
}
.cookie-banner__option { display: flex; align-items: center; gap: .4rem; }

/* =============================================================
   12. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .tool-controls { flex-wrap: nowrap; }
}
@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}
