/* ZipForge — single stylesheet
   Palette: ice #EDF1F6 / surface #FFF / ink #16243D / muted #5B6B84
   / cobalt #2454FF / saved-green #0E9F6E / line #D6DEE9 */

:root {
  --bg: #EDF1F6;
  --surface: #FFFFFF;
  --ink: #16243D;
  --muted: #5B6B84;
  --accent: #2454FF;
  --accent-dark: #1B41C4;
  --saved: #0E9F6E;
  --danger: #D93025;
  --line: #D6DEE9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 36, 61, .06), 0 8px 24px rgba(22, 36, 61, .07);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  gap: 16px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo:hover { text-decoration: none; }
.logo .mark {
  display: inline-block;
  width: 26px; height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  font-size: .8rem;
  line-height: 26px;
  text-align: center;
  font-family: var(--font-mono);
}
.main-nav { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.main-nav a { color: var(--muted); font-size: .95rem; font-weight: 500; }
.main-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.lang-switch {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: .85rem;
  color: var(--muted);
}

/* ---------- Hero / tool ---------- */
.tool-hero { padding: 44px 0 12px; text-align: center; }
.tool-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.12;
  margin: 0 0 12px;
}
.tool-hero h1 em { font-style: normal; color: var(--accent); }
.tool-hero p.lede {
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 8px;
  font-size: 1.05rem;
}

/* ---------- Drop zone (signature element) ---------- */
.chamber {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 26px auto 0;
  padding: 22px;
}
.dropzone {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 46px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  background: #F4F7FF;
}
.dropzone .dz-icon {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
}
.dropzone strong { font-size: 1.1rem; }
.dropzone p { color: var(--muted); margin: 6px 0 0; font-size: .92rem; }
.dropzone input[type="file"] { display: none; }

/* file list */
.filelist { list-style: none; margin: 18px 0 0; padding: 0; text-align: left; }
.filelist li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}
.filelist li:last-child { border-bottom: 0; }
.filelist .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist .fsize { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); }
.filelist button.remove {
  border: 0; background: none; color: var(--muted);
  cursor: pointer; font-size: 1rem; padding: 2px 6px; border-radius: 6px;
}
.filelist button.remove:hover { color: var(--danger); background: #FBEBEA; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}
.total { font-family: var(--font-mono); font-size: .88rem; color: var(--muted); }

.levels { display: flex; gap: 6px; }
.levels button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: .88rem;
  cursor: pointer;
}
.levels button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: #F0F4FF;
  font-weight: 600;
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: 13px 28px;
  cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn.secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn.secondary:hover { background: #F0F4FF; }

/* progress + result bars */
.progress { margin-top: 18px; display: none; }
.progress.active { display: block; }
.progress .bar {
  height: 10px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.progress .bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .2s ease;
}
.progress .plabel {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--muted);
  margin-top: 6px;
}

.result { margin-top: 20px; display: none; text-align: left; }
.result.active { display: block; }
.result h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 12px;
}
.sizebars { display: grid; gap: 8px; margin-bottom: 16px; }
.sizebar { display: grid; grid-template-columns: 90px 1fr 110px; gap: 10px; align-items: center; }
.sizebar .lbl { font-size: .85rem; color: var(--muted); }
.sizebar .track { background: var(--bg); border-radius: 6px; height: 16px; overflow: hidden; }
.sizebar .track > span { display: block; height: 100%; border-radius: 6px; }
.sizebar.before .track > span { background: var(--muted); width: 100%; }
.sizebar.after .track > span { background: var(--saved); }
.sizebar .val { font-family: var(--font-mono); font-size: .82rem; text-align: right; }
.savings {
  color: var(--saved);
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: .95rem;
  margin: 0 0 16px;
}
.result .actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* unzip table */
.ziptable { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: .93rem; }
.ziptable th {
  text-align: left;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
  padding: 8px 6px;
}
.ziptable td { padding: 9px 6px; border-bottom: 1px solid var(--line); }
.ziptable td.sz { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); white-space: nowrap; }
.ziptable a.dl { font-weight: 600; font-size: .88rem; }

.error-note {
  display: none;
  margin-top: 16px;
  background: #FBEBEA;
  color: var(--danger);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .93rem;
}
.error-note.active { display: block; }

/* trust strip */
.trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 34px 0 0;
}
.trust div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.trust strong { display: block; font-family: var(--font-display); font-size: 1rem; margin-bottom: 4px; }
.trust span { color: var(--muted); font-size: .88rem; }
@media (max-width: 640px) { .trust { grid-template-columns: 1fr; } }

/* ---------- Content sections ---------- */
.content { padding: 44px 0 20px; }
.content h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -.02em;
  margin: 38px 0 14px;
}
.content h3 { font-size: 1.12rem; margin: 26px 0 8px; }
.content p, .content li { color: #33415C; }
.content .card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 30px;
  margin-top: 18px;
}

/* FAQ */
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 10px;
  padding: 0 18px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 15px 0;
  list-style: none;
  position: relative;
}
.faq summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  color: var(--accent);
  font-family: var(--font-mono);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 16px; }

/* ---------- Blog ---------- */
.post-list { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 16px; }
.post-list li {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 26px;
}
.post-list h2, .post-list h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.25rem; }
.post-list p { margin: 0; color: var(--muted); font-size: .95rem; }
.post-meta { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); display: block; margin-top: 10px; }

article.post { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 34px; margin: 34px 0; }
article.post h1 { font-family: var(--font-display); font-size: clamp(1.6rem, 3.5vw, 2.2rem); letter-spacing: -.02em; line-height: 1.18; margin: 0 0 8px; }
article.post h2 { font-family: var(--font-display); font-size: 1.4rem; margin: 32px 0 12px; }
article.post h3 { font-size: 1.1rem; margin: 24px 0 8px; }
article.post p, article.post li { color: #33415C; }
article.post table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .93rem; }
article.post th, article.post td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
article.post th { background: var(--bg); font-size: .85rem; }
@media (max-width: 640px) { article.post { padding: 26px 20px; } }

/* CTA box in articles */
.cta-box {
  background: #F0F4FF;
  border: 1px solid #C9D6FF;
  border-radius: 10px;
  padding: 18px 22px;
  margin: 26px 0;
}
.cta-box p { margin: 0 0 12px; }

/* ---------- Forms ---------- */
form.contact { display: grid; gap: 14px; max-width: 560px; }
form.contact label { font-weight: 600; font-size: .92rem; }
form.contact input, form.contact textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  font: inherit;
  background: var(--surface);
}
form.contact input:focus, form.contact textarea:focus { border-color: var(--accent); outline: none; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 60px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 34px 0;
  font-size: .9rem;
  color: var(--muted);
}
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* util */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); border: 0;
}
