/* =========================================================================
 * Private PDF Compressor — styles. Animated modern UI.
 * All motion disabled under prefers-reduced-motion.
 * ========================================================================= */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --ink: #141a2e;
  --ink-soft: #4b5573;
  --ink-faint: #8a93ad;
  --line: #e2e7f2;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef0ff;
  --ok: #0f9d58;
  --ok-soft: #e5f6ec;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --err: #dc2626;
  --err-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(20, 26, 46, 0.08);
  --shadow-lg: 0 18px 50px rgba(79, 70, 229, 0.16);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.05rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow);
}
.brand-mark svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  padding: 8px 12px; border-radius: 10px; transition: background 0.18s, color 0.18s;
}
.nav a:hover, .nav a:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }

/* ---------------- hero ---------------- */
.hero {
  padding: 64px 0 28px;
  background:
    radial-gradient(600px 300px at 15% 0%, rgba(79, 70, 229, 0.10), transparent 60%),
    radial-gradient(700px 320px at 90% 10%, rgba(124, 58, 237, 0.10), transparent 60%);
}
.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 14px; max-width: 20ch;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 62ch; margin: 0 0 18px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.trust-row li {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: 0.86rem; font-weight: 600; color: var(--ink-soft);
  box-shadow: 0 2px 8px rgba(20, 26, 46, 0.05);
}
.trust-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }

/* ---------------- tool card ---------------- */
.tool-section { padding: 10px 0 40px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: clamp(18px, 3vw, 34px);
}

/* presets */
.preset-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 8px;
}
.preset {
  position: relative; display: block; cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 12px; background: var(--surface);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.preset:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.preset input { position: absolute; opacity: 0; pointer-events: none; }
.preset .p-name { font-weight: 800; font-size: 0.98rem; display: flex; align-items: center; gap: 8px; }
.preset .p-tag {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--brand-soft); color: var(--brand); border-radius: 6px; padding: 2px 7px;
}
.preset .p-desc { font-size: 0.84rem; color: var(--ink-soft); margin-top: 4px; }
.preset:has(input:checked) {
  border-color: var(--brand);
  background: linear-gradient(180deg, #fafaff, var(--surface));
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.14);
}
.preset:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.preset .p-check {
  position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); display: grid; place-items: center;
  opacity: 0; transform: scale(0.4); transition: opacity 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.preset:has(input:checked) .p-check { opacity: 1; transform: scale(1); }
.preset .p-check svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3.4; fill: none; }

.advanced { margin: 6px 0 4px; border: 1px dashed var(--line); border-radius: var(--radius); padding: 4px 14px; }
.advanced summary { cursor: pointer; font-weight: 700; font-size: 0.92rem; padding: 10px 0; color: var(--ink-soft); }
.advanced summary:hover { color: var(--ink); }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 6px 0 14px; }
.adv-grid label { display: block; font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); }
.adv-grid output { font-weight: 800; color: var(--ink); }
.adv-grid input[type="range"] { width: 100%; accent-color: var(--brand); }
.adv-grid select {
  width: 100%; margin-top: 6px; padding: 9px 10px; border-radius: 10px;
  border: 1px solid var(--line); font: inherit; background: var(--surface);
}
.adv-note { font-size: 0.82rem; color: var(--ink-faint); grid-column: 1 / -1; margin: 0; }

/* exact-size controls */
.exact-controls {
  border: 2px solid var(--brand-soft); background: linear-gradient(180deg, #fafaff, var(--surface));
  border-radius: var(--radius); padding: 16px 18px 14px; margin: 4px 0 8px;
}
.exact-label { font-weight: 800; margin: 0 0 10px; font-size: 0.95rem; }
.target-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.chip {
  font: inherit; font-weight: 700; font-size: 0.92rem; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink-soft);
  border-radius: 999px; padding: 8px 18px;
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.18s;
}
.chip:hover { transform: translateY(-1px); border-color: var(--brand); color: var(--ink); }
.chip:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.chip[aria-pressed="true"] {
  border-color: var(--brand); background: var(--brand); color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}
.exact-custom { display: block; font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); }
.exact-custom input {
  display: block; width: 180px; margin-top: 6px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); font: inherit; background: var(--surface);
}
.exact-custom input[aria-invalid="true"] { border-color: var(--err); }
.exact-err { color: var(--err); font-size: 0.84rem; font-weight: 600; margin: 6px 0 0; min-height: 1.2em; }
.exact-err:empty { display: none; }
.exact-note { font-size: 0.84rem; color: var(--ink-soft); margin: 8px 0 0; }

/* achieved-vs-target badge on result cards */
.fc-target {
  display: inline-block; font-weight: 700; font-size: 0.9rem;
  border-radius: 8px; padding: 5px 12px; margin: 2px 0 10px;
}
.fc-target.met { color: var(--ok); background: var(--ok-soft); }
.fc-target.miss { color: var(--warn); background: var(--warn-soft); }

/* dropzone */
.dropzone {
  margin-top: 14px;
  border: 2.5px dashed #c3c9e8; border-radius: var(--radius);
  background: linear-gradient(180deg, #fafbff, var(--surface-2));
  padding: clamp(28px, 5vw, 54px) 20px;
  text-align: center; cursor: pointer;
  transition: border-color 0.22s, background 0.22s, transform 0.22s, box-shadow 0.22s;
  position: relative; overflow: hidden;
}
.dropzone::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(420px 200px at 50% 0%, rgba(79, 70, 229, 0.14), transparent 70%);
  transition: opacity 0.25s;
}
.dropzone:hover { border-color: var(--brand); }
.dropzone:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.dropzone.dragover {
  border-color: var(--brand); border-style: solid;
  background: linear-gradient(180deg, #f2f3ff, #e9ebff);
  transform: scale(1.012);
  box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.12), var(--shadow-lg);
  animation: dz-pulse 1.1s ease-in-out infinite;
}
.dropzone.dragover::before { opacity: 1; }
@keyframes dz-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10), var(--shadow-lg); }
  50% { box-shadow: 0 0 0 10px rgba(79, 70, 229, 0.16), var(--shadow-lg); }
}
.dz-icon {
  width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dropzone.dragover .dz-icon { transform: translateY(-6px) scale(1.08) rotate(-4deg); }
.dz-icon svg { width: 30px; height: 30px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dz-title { font-size: 1.15rem; font-weight: 800; margin: 0 0 4px; }
.dz-sub { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 14px; }
.dz-sub kbd {
  font-family: inherit; font-size: 0.78rem; background: var(--surface);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 0.95rem;
  border: none; border-radius: 12px; padding: 12px 22px; cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.32);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(79, 70, 229, 0.4); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: #e3e8f5; }
.btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------------- file cards ---------------- */
.file-list { display: grid; gap: 14px; margin-top: 22px; }
.file-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(16px) scale(0.99);
  animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--stagger, 0ms);
}
@keyframes card-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.fc-top { display: flex; align-items: center; gap: 14px; }
.fc-icon {
  width: 46px; height: 46px; flex: none; border-radius: 12px;
  background: var(--err-soft); display: grid; place-items: center; position: relative;
}
.fc-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--err); stroke-width: 1.8; }
.fc-icon .fc-pdf { font-size: 7px; font-weight: 800; fill: var(--err); stroke: none; font-family: var(--font); }
.fc-meta { min-width: 0; flex: 1; }
.fc-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-size { font-size: 0.85rem; color: var(--ink-faint); }
.fc-remove {
  flex: none; width: 34px; height: 34px; border-radius: 10px; border: none;
  background: transparent; color: var(--ink-faint); font-size: 1.3rem; cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.fc-remove:hover { background: var(--err-soft); color: var(--err); }

.fc-work { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.fc-stage { font-size: 0.9rem; color: var(--ink-soft); font-weight: 600; }

.ring { width: 52px; height: 52px; flex: none; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.ring-fg {
  fill: none; stroke: url(#ringGrad); stroke: var(--brand); stroke-width: 7; stroke-linecap: round;
  transition: stroke-dashoffset 0.3s ease;
}

.fc-result { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.fc-nums { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 10px; }
.fc-before { color: var(--ink-faint); text-decoration: line-through; font-size: 0.95rem; }
.fc-after { font-size: 1.25rem; font-weight: 800; }
.fc-saved {
  font-weight: 800; color: var(--ok); background: var(--ok-soft);
  border-radius: 8px; padding: 3px 10px; font-size: 0.95rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.fc-saved.zero { color: var(--warn); background: var(--warn-soft); }
.fc-note { font-size: 0.85rem; color: var(--ink-soft); margin: 6px 0 0; }

.bar-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; margin: 5px 0; font-size: 0.8rem; color: var(--ink-faint); }
.bar-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-fill.after { background: linear-gradient(90deg, #0f9d58, #34d399); }
.bar-fill.full { background: var(--line); }

.fc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: center; }
.check {
  width: 26px; height: 26px; flex: none;
}
.check circle { fill: var(--ok); opacity: 0; animation: pop-in 0.35s ease forwards; }
.check path {
  fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 30; stroke-dashoffset: 30;
  animation: draw-check 0.5s 0.15s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
@keyframes draw-check { to { stroke-dashoffset: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }

.fc-error {
  margin-top: 14px; background: var(--err-soft); border: 1px solid #f5c2c2;
  color: #7f1d1d; border-radius: 12px; padding: 12px 14px; font-size: 0.9rem;
  display: flex; gap: 10px; align-items: flex-start;
}
.fc-error .e-icon { flex: none; font-weight: 800; }

/* batch bar */
.batch-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 20px; padding: 16px 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, #1e1b4b, #312e81); color: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
}
.batch-bar.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.batch-bar .bb-text { font-weight: 700; }
.batch-bar .bb-text small { display: block; font-weight: 500; color: #c7d2fe; font-size: 0.82rem; }
.batch-bar .btn-ghost { background: rgba(255, 255, 255, 0.14); color: #fff; }
.batch-bar .btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.24); }

/* ---------------- privacy panel ---------------- */
.privacy { padding: 30px 0; }
.privacy-card {
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  color: #e2e8f0; border-radius: 22px; padding: clamp(20px, 3.5vw, 36px);
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.privacy-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(500px 240px at 85% 10%, rgba(124, 58, 237, 0.28), transparent 65%);
}
.privacy-card h2 { margin: 0 0 8px; font-size: 1.4rem; color: #fff; }
.privacy-card p { color: #cbd5e1; max-width: 70ch; }
.net-meter {
  display: inline-flex; align-items: center; gap: 10px; margin: 14px 0;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px; padding: 10px 16px; font-weight: 700;
}
.net-meter .pulse { width: 10px; height: 10px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.18); animation: glow 2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0.08); } }
.net-meter b { color: #fff; font-size: 1.15rem; }
.verify-steps { margin: 8px 0 0; padding-left: 20px; color: #cbd5e1; }
.verify-steps li { margin: 6px 0; }
.verify-steps kbd {
  font-family: inherit; font-size: 0.78rem; background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; padding: 1px 7px; color: #fff;
}

/* ---------------- content / SEO ---------------- */
.content { padding: 26px 0 10px; }
.content h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin: 34px 0 10px; }
.content h3 { font-size: 1.1rem; margin: 22px 0 6px; }
.content p, .content li { color: var(--ink-soft); }
.content p { max-width: 72ch; }
.prose-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 16px 0; }
.prose-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.prose-card h3 { margin: 0 0 6px; font-size: 1rem; color: var(--ink); }
.prose-card p { margin: 0; font-size: 0.9rem; }
.faq { margin: 10px 0 0; }
.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 10px; padding: 4px 16px;
}
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.faq summary:hover { color: var(--brand); }
.faq details p { margin: 0 0 14px; font-size: 0.94rem; }

/* ---------------- footer ---------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 40px; color: var(--ink-faint); font-size: 0.86rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.site-footer a { color: var(--ink-soft); }

/* ---------------- a11y ---------------- */
.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;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 10px;
  text-decoration: none; font-weight: 700; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------------- responsive ---------------- */
@media (max-width: 640px) {
  .nav { display: none; }
  .adv-grid { grid-template-columns: 1fr; }
  .fc-actions .btn { flex: 1; }
  .batch-bar { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .file-card { opacity: 1; transform: none; }
  .dropzone.dragover { animation: none; }
  .check path { stroke-dashoffset: 0; }
  .check circle { opacity: 1; }
}
