/* PDF Dark Mode — site styles. Dark, Apple-like, mobile-first, no frameworks. */

:root {
  --bg: #0b0b0d;
  --bg-soft: #131316;
  --card: #17171b;
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f2f2f5;
  --text-dim: #a7a7b0;
  --accent: #6e6ef2;
  --accent-hover: #8282f5;
  --accent-soft: rgba(110, 110, 242, 0.14);
  --good: #30d158;
  --radius: 16px;
  --max: 980px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 11, 13, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--card-border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 56px;
}

.brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.brand span { color: var(--accent); }

.site-nav { margin-left: auto; display: flex; gap: 4px; }

.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14.5px;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.site-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* ---------- hero ---------- */

.hero { padding: 56px 0 8px; text-align: center; }

.hero h1 {
  font-size: clamp(30px, 5.4vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  font-weight: 800;
}

.hero .sub {
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 10px;
}

/* ---------- tool ---------- */

.tool-section { padding: 26px 0 10px; }

.tool {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 42px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone .dz-title { font-size: 19px; font-weight: 650; margin-bottom: 6px; }

.dropzone .dz-hint { color: var(--text-dim); font-size: 14.5px; }

.tool-controls { margin-top: 20px; display: none; }
.tool-controls.active { display: block; }

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.controls-row label { font-size: 14px; color: var(--text-dim); }

select, input[type="color"] {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
}

select { padding: 9px 12px; min-width: 210px; }

input[type="color"] {
  width: 44px;
  height: 38px;
  padding: 3px;
  cursor: pointer;
}

.custom-colors { display: none; }
.custom-colors.active { display: block; flex-basis: 100%; width: 100%; margin-top: 4px; }

.swatch-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.swatch-caption { width: 84px; font-size: 13px; color: var(--text-dim); }

.swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0;
  cursor: pointer;
  transition: transform 0.1s;
}

.swatch:hover { transform: scale(1.12); }
.swatch.active { outline: 2px solid var(--accent); outline-offset: 1px; }

.swatch-any { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-left: 6px; }
.swatch-any input[type="color"] { width: 34px; height: 28px; }

.contrast-hint { display: block; font-size: 12.5px; color: #ffcc66; margin-top: 2px; }

.keep-images {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
}

.keep-images input { accent-color: var(--accent); width: 16px; height: 16px; }
.keep-images.disabled { opacity: 0.45; cursor: not-allowed; }

.sample-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.sample-chips-label { font-size: 13px; color: var(--text-dim); }

.chip {
  background: var(--bg-soft);
  color: var(--text-dim);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.chip:hover { color: var(--text); border-color: var(--accent); }
.chip:disabled { opacity: 0.5; cursor: default; }

/* ---------- before/after compare (homepage) ---------- */

.compare-section { padding: 34px 0 4px; }

.compare {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  background: var(--bg-soft);
}

.compare canvas.compare-bottom { display: block; width: 100%; height: auto; }
.compare canvas.compare-top { position: absolute; inset: 0; width: 100%; height: 100%; }

.compare-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  color: var(--text-dim);
  font-size: 14px;
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.compare-divider::after {
  content: "◂ ▸";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  color: #111;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.compare-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.compare-tag {
  position: absolute;
  top: 10px;
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  pointer-events: none;
}

.compare-tag.before { left: 10px; }
.compare-tag.after { right: 10px; }

.compare-caption {
  text-align: center;
  color: var(--text-dim);
  font-size: 13.5px;
  margin-top: 10px;
}

.preview-box {
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

#preview-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.preview-caption { color: var(--text-dim); font-size: 13px; margin-top: 10px; }

.actions-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 13px 26px;
  font-size: 16px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: #3a3a44; color: #8a8a93; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--card-border);
}
.btn-ghost:hover { color: var(--text); }

.status-line { font-size: 14px; color: var(--text-dim); min-height: 1.4em; margin: 10px 0 0; }
.status-line.error { color: #ff6961; }
.status-line.good { color: var(--good); }

.privacy-note {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 14px;
}

/* ---------- trust row ---------- */

.trust-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 22px 0 6px;
}

.trust-item {
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px 18px;
}

.trust-item h3 { margin: 0 0 6px; font-size: 15.5px; }
.trust-item p { margin: 0; font-size: 14px; color: var(--text-dim); }

/* ---------- content sections ---------- */

.content-section { padding: 34px 0 4px; max-width: 780px; }

.content-section h2 {
  font-size: clamp(22px, 3.4vw, 30px);
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

.content-section h3 { font-size: 19px; margin: 26px 0 8px; }

.content-section p { color: var(--text-dim); margin: 0 0 14px; }

.content-section ul { color: var(--text-dim); padding-left: 22px; }
.content-section li { margin-bottom: 8px; }

.content-section strong { color: var(--text); }

.content-section a { color: var(--accent); }
.content-section a:hover { color: var(--accent-hover); }

.content-section code {
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 14px;
}

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 16px;
  color: var(--text-dim);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps strong { color: var(--text); }

/* ---------- FAQ ---------- */

.faq { padding: 34px 0 10px; max-width: 780px; }

.faq h2 { font-size: clamp(22px, 3.4vw, 30px); margin: 0 0 16px; }

.faq details {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}

.faq summary {
  cursor: pointer;
  padding: 15px 18px;
  font-weight: 600;
  font-size: 15.5px;
  list-style: none;
  position: relative;
  padding-right: 44px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 14px;
  font-size: 20px;
  color: var(--text-dim);
  transition: transform 0.15s;
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq details p { padding: 0 18px 16px; margin: 0; color: var(--text-dim); font-size: 15px; }
.faq details a { color: var(--accent); }

/* ---------- related / CTA ---------- */

.related-links { padding: 30px 0 10px; }
.related-links .wrap-inner {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  align-items: center;
  justify-content: space-between;
}
.related-links p { margin: 0; font-weight: 600; }
.related-links a { color: var(--accent); text-decoration: none; }
.related-links a:hover { text-decoration: underline; }

/* ---------- comparison table ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.compare-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  font-size: 14.5px;
}

.compare-table th, .compare-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border);
  vertical-align: top;
}

.compare-table thead th { color: var(--text); font-weight: 650; white-space: nowrap; }
.compare-table tbody th { color: var(--text); font-weight: 600; }
.compare-table td { color: var(--text-dim); }

.compare-table tr.highlight th, .compare-table tr.highlight td { background: var(--accent-soft); }
.compare-table tr.highlight th:first-child { border-radius: 8px 0 0 8px; }
.compare-table tr.highlight td:last-child { border-radius: 0 8px 8px 0; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 54px;
  border-top: 1px solid var(--card-border);
  padding: 26px 0 40px;
  color: var(--text-dim);
  font-size: 14px;
}

.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-left: auto; }
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------- small screens ---------- */

@media (max-width: 560px) {
  .site-header .wrap { gap: 8px; }
  .site-nav a { padding: 6px 7px; font-size: 13.5px; }
  .hero { padding-top: 40px; }
  .tool { padding: 16px; }
  .dropzone { padding: 34px 12px; }
  select { min-width: 0; flex: 1; }
}
