/* EditZap design system — light, clean SaaS utility */
:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text: #0F172A;
  --muted: #475569;
  --primary: #7C3AED;
  --primary-dark: #6D28D9;
  --primary-soft: #F3EEFF;
  --accent: #FACC15;
  --success: #16A34A;
  --danger: #DC2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
  --shadow-lg: 0 4px 12px rgba(15, 23, 42, .08), 0 16px 48px rgba(124, 58, 237, .10);
}

* { margin: 0; padding: 0; 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 {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Space Grotesk', 'Inter', sans-serif; line-height: 1.2; letter-spacing: -0.02em; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
:focus-visible { outline: 3px solid rgba(124, 58, 237, .5); outline-offset: 2px; border-radius: 6px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(248, 250, 252, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.25rem; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(124, 58, 237, .35);
}
.logo-mark svg { width: 18px; height: 18px; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--text); }
.badge-private {
  display: inline-flex; align-items: center; gap: 6px;
  background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0;
  font-size: .8rem; font-weight: 600; padding: 5px 12px; border-radius: 999px;
}
.badge-private svg { width: 13px; height: 13px; }
@media (max-width: 720px) { .nav-links li.hide-mobile { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: 52px 0 30px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(124, 58, 237, .08), transparent 70%),
    radial-gradient(600px 300px at 80% 10%, rgba(250, 204, 21, .10), transparent 70%);
}
.hero h1 { font-size: clamp(2rem, 4.6vw, 3rem); font-weight: 700; max-width: 760px; margin: 0 auto 14px; position: relative; }
.hero h1 .zap { color: var(--primary); }
.hero p.sub { font-size: 1.08rem; color: var(--muted); max-width: 600px; margin: 0 auto 24px; position: relative; }
.hero-cta { display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: center; position: relative; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 1rem;
  padding: 13px 28px; border-radius: 12px; border: none; cursor: pointer;
  transition: background-color .2s, box-shadow .2s, color .2s;
  min-height: 48px;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 10px rgba(124, 58, 237, .3); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-primary:disabled { background: #C4B5FD; cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: #CBD5E1; background: #F1F5F9; }
.btn-block { width: 100%; }

/* ---------- Tool grid ---------- */
.section { padding: 56px 0; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 10px; }
.section-head p { color: var(--muted); max-width: 560px; margin: 0 auto; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: block; color: var(--text); cursor: pointer;
  box-shadow: var(--shadow); transition: box-shadow .2s, border-color .2s;
}
.tool-card:hover { box-shadow: var(--shadow-lg); border-color: #DDD6FE; color: var(--text); }
.tool-card .icon {
  width: 44px; height: 44px; border-radius: 11px; margin-bottom: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.tool-card .icon svg { width: 22px; height: 22px; }
.icon-violet { background: var(--primary-soft); color: var(--primary); }
.icon-amber { background: #FEF9C3; color: #A16207; }
.icon-sky { background: #E0F2FE; color: #0369A1; }
.icon-rose { background: #FFE4E6; color: #BE123C; }
.icon-emerald { background: #D1FAE5; color: #047857; }
.tool-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.tool-card p { font-size: .9rem; color: var(--muted); line-height: 1.5; }

/* ---------- Tool search + categories ---------- */
/* Tools section sits high on the page — keep it tight so tools are visible without scrolling */
#tools { padding-top: 8px; }
#tools .section-head { margin-bottom: 22px; }
#tools .section-head h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); margin-bottom: 6px; }
#tools .section-head p { font-size: .95rem; }

.tool-search-wrap { max-width: 460px; margin: 0 auto 18px; position: relative; }
.tool-search-wrap svg {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--muted); pointer-events: none;
}
#toolsearch {
  font: inherit; width: 100%; padding: 14px 18px 14px 46px; min-height: 50px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s;
}
#toolsearch::placeholder { color: var(--muted); }
#toolsearch:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(124, 58, 237, .14); }

/* Category filter pills */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-bottom: 26px;
}
.filter-pill {
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: 11px 22px; min-height: 44px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background-color .2s, color .2s, border-color .2s;
}
.filter-pill:hover { border-color: #CBD5E1; background: #F1F5F9; }
.filter-pill .pill-count {
  font-size: .78rem; font-weight: 600; color: var(--muted);
  background: var(--bg); border-radius: 999px; padding: 1px 8px;
  transition: background-color .2s, color .2s;
}
.filter-pill[aria-pressed="true"] {
  background: #0F172A; color: #fff; border-color: #0F172A;
}
.filter-pill[aria-pressed="true"]:hover { background: #1E293B; border-color: #1E293B; }
.filter-pill[aria-pressed="true"] .pill-count { background: rgba(255,255,255,.18); color: #fff; }

/* On phones the pills swipe sideways on one row instead of stacking into three */
@media (max-width: 720px) {
  .filters {
    flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;
    margin-left: -24px; margin-right: -24px;
    padding: 0 24px 4px;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter-pill { flex: 0 0 auto; }

  /* Tighten the top of the page so tools are reachable with almost no scrolling */
  .hero { padding: 30px 0 18px; }
  .hero h1 { font-size: clamp(1.65rem, 7.2vw, 2.05rem); margin-bottom: 10px; }
  .hero p.sub { font-size: .98rem; margin-bottom: 18px; }
  .hero-cta { gap: 10px; }
  .hero-cta .btn { padding: 11px 20px; font-size: .95rem; }
  #tools .section-head { margin-bottom: 16px; }
  #tools .section-head p { display: none; }
  .tool-search-wrap { margin-bottom: 14px; }
  .filters { margin-bottom: 20px; }
}

.tool-card.is-hidden { display: none; }
.no-results { text-align: center; color: var(--muted); padding: 20px; display: none; }
.no-results.show { display: block; }

.badge-new {
  display: inline-block; background: var(--accent); color: #713F12;
  font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle;
}

/* ---------- Feature strip ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.feature .icon { width: 44px; height: 44px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.feature .icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: .95rem; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; counter-reset: step; }
.step { text-align: center; padding: 20px; }
.step .num {
  width: 44px; height: 44px; border-radius: 999px; margin: 0 auto 14px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 1.15rem;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
}
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: .92rem; }

/* ---------- FAQ ---------- */
.faq { max-width: 720px; margin: 0 auto; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 12px;
}
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--primary); flex-shrink: 0; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin-top: 10px; font-size: .95rem; }

/* ---------- Tool page ---------- */
.tool-page { max-width: 760px; margin: 0 auto; padding: 48px 24px 64px; }
.tool-page > h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); text-align: center; margin-bottom: 10px; }
.tool-page > .sub { text-align: center; color: var(--muted); margin-bottom: 36px; font-size: 1.05rem; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); margin-bottom: 20px;
}

.dropzone {
  border: 2px dashed #C4B5FD; border-radius: var(--radius); background: var(--primary-soft);
  padding: 44px 24px; text-align: center; cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: #EDE6FF; }
.dropzone svg { width: 40px; height: 40px; color: var(--primary); margin-bottom: 12px; }
.dropzone .dz-title { font-weight: 600; font-size: 1.05rem; margin-bottom: 4px; }
.dropzone .dz-hint { color: var(--muted); font-size: .88rem; }
.dropzone input[type="file"] { display: none; }

.file-list { list-style: none; margin-top: 16px; }
.file-list li {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 8px; font-size: .92rem;
}
.file-list .f-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-list .f-size { color: var(--muted); flex-shrink: 0; }
.file-list button.f-remove {
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem;
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: background-color .15s, color .15s;
}
.file-list button.f-remove:hover { background: #FEE2E2; color: var(--danger); }

.opts { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; margin-top: 20px; }
.opt { display: flex; flex-direction: column; gap: 6px; }
.opt label { font-size: .88rem; font-weight: 600; color: var(--text); }
.opt input[type="text"], .opt input[type="number"], .opt select {
  font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); min-width: 130px; min-height: 44px;
}
.opt input:focus, .opt select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(124,58,237,.15); }
.opt-check { display: flex; align-items: center; gap: 8px; font-size: .92rem; font-weight: 500; cursor: pointer; min-height: 44px; }
.opt-check input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.opt input[type="range"] { accent-color: var(--primary); min-width: 170px; cursor: pointer; }

.actions { margin-top: 24px; }
.status { margin-top: 16px; font-size: .95rem; color: var(--muted); min-height: 1.4em; }
.status.error { color: var(--danger); font-weight: 500; }
.status.ok { color: var(--success); font-weight: 500; }
.progress { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 12px; display: none; }
.progress .bar { height: 100%; width: 0%; background: var(--primary); border-radius: 999px; transition: width .2s; }

.result { display: none; text-align: center; padding: 28px; }
.result.show { display: block; }
.result .r-icon { width: 52px; height: 52px; border-radius: 999px; background: #D1FAE5; color: var(--success); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.result .r-icon svg { width: 26px; height: 26px; }
.result h3 { margin-bottom: 6px; }
.result p { color: var(--muted); font-size: .92rem; margin-bottom: 18px; }

.seo-text { color: var(--muted); font-size: .95rem; margin-top: 36px; }
.seo-text h2 { font-size: 1.2rem; color: var(--text); margin: 22px 0 8px; }
.related { margin-top: 32px; }
.related h2 { font-size: 1.1rem; margin-bottom: 14px; }
.related-links { display: flex; flex-wrap: wrap; gap: 10px; }
.related-links a {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 16px; font-size: .88rem; font-weight: 500; color: var(--text);
  transition: border-color .2s, color .2s;
}
.related-links a:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 40px; }
.footer-inner { padding: 40px 0 32px; display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.footer-col h4 { font-size: .9rem; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--muted); font-size: .88rem; }
.footer-col a:hover { color: var(--primary); }
.footer-note { padding: 18px 0 26px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
