/* ============================================================
   PDFVELO — Design tokens
   Palette: paper / ink / stamp-red / slate / line
   Type: Archivo (display, condensed-ish grotesk) + Inter (body) + JetBrains Mono (data)
   ============================================================ */

:root {
  --paper: #FAF8F4;
  --paper-dim: #F1EDE4;
  --ink: #1C1B19;
  --ink-soft: #38352F;
  --stamp: #B23A2E;
  --stamp-dark: #8E2C22;
  --stamp-tint: #F4E3DF;
  --slate: #6B6862;
  --line: #E3DFD6;
  --line-strong: #CFC9BB;
  --ok: #3E6B4F;
  --ok-tint: #E3ECE5;

  --font-display: 'Archivo', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --radius-sm: 3px;
  --radius-md: 6px;
  --shadow-card: 0 1px 0 var(--line-strong), 0 8px 24px -16px rgba(28,27,25,0.25);
  --max-w: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.04; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.15; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--ink-soft); }

.mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stamp);
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--stamp);
  border-color: var(--stamp);
  color: var(--paper);
}
.btn-primary:hover { background: var(--stamp-dark); border-color: var(--stamp-dark); }
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--stamp);
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.brand .mark {
  width: 30px; height: 30px;
  background: var(--ink);
  border-radius: var(--radius-sm);
  position: relative;
  flex-shrink: 0;
}
.brand .mark::before {
  content: "";
  position: absolute;
  inset: 7px 7px 9px 7px;
  border: 1.5px solid var(--paper);
  border-top-width: 2px;
}
.brand .mark::after {
  content: "";
  position: absolute;
  left: 7px; right: 11px; top: 14px;
  height: 1.5px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--paper);
}
.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-links a { color: var(--ink-soft); }
.nav-links a:hover { color: var(--stamp); }
.nav-cta { display: flex; gap: 12px; align-items: center; }
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--line);
}
.hero .eyebrow { margin-bottom: 14px; display: block; }
.hero h1 { max-width: 720px; }
.hero .sub {
  max-width: 560px;
  font-size: 1.1rem;
  margin-top: 18px;
  color: var(--slate);
}
.trust-row {
  display: flex;
  gap: 22px;
  margin-top: 28px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
}
.trust-row span { display: flex; align-items: center; gap: 6px; }
.trust-row .dot { width: 6px; height: 6px; background: var(--ok); border-radius: 50%; flex-shrink: 0; }

/* ---------- Dropzone (signature element) ---------- */
.dropzone {
  position: relative;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--paper-dim);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone.drag {
  border-color: var(--stamp);
  background: var(--stamp-tint);
}
.dropzone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dz-icon {
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  position: relative;
}
.dz-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
}
.dz-icon::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 16px; height: 16px;
  margin: -11px 0 0 -8px;
  border-left: 2px solid var(--stamp);
  border-bottom: 2px solid var(--stamp);
  transform: rotate(135deg);
}
.dz-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }
.dz-sub { color: var(--slate); font-size: 0.88rem; margin: 0; }
.dz-formats { font-family: var(--font-mono); font-size: 0.72rem; color: var(--line-strong); margin-top: 14px; }

/* Stamp success animation */
.stamp-result {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  border: 2px solid var(--ok);
  border-radius: var(--radius-md);
  background: var(--ok-tint);
  animation: stamp-in 0.35s cubic-bezier(.2,1.4,.4,1);
}
@keyframes stamp-in {
  0% { transform: scale(1.4) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.stamp-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  border: 1.5px solid var(--ok);
  color: var(--ok);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  flex-shrink: 0;
  transform: rotate(-3deg);
}

/* ---------- File list ---------- */
.file-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}
.file-row .fname { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fsize { font-family: var(--font-mono); color: var(--slate); font-size: 0.78rem; }
.file-row .handle { color: var(--line-strong); cursor: grab; font-family: var(--font-mono); user-select: none; }
.file-row button.remove {
  background: none; border: none; cursor: pointer;
  color: var(--slate); font-size: 1.1rem; line-height: 1; padding: 2px 6px;
}
.file-row button.remove:hover { color: var(--stamp); }

/* ---------- Tool workspace ---------- */
.tool-section { padding: 48px 0; }
.tool-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 36px;
}
.tool-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.progress-bar {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 18px;
  display: none;
}
.progress-bar > div {
  height: 100%;
  background: var(--stamp);
  width: 0%;
  transition: width 0.2s ease;
}

/* ---------- Tool grid (homepage) ---------- */
.section { padding: 64px 0; }
.section-head { margin-bottom: 36px; max-width: 600px; }
.section-head .eyebrow { display: block; margin-bottom: 10px; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.tool-tab {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 22px 20px 20px;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.tool-tab:hover { border-top-color: var(--stamp); transform: translateY(-2px); }
.tool-tab .tag {
  position: absolute;
  top: -3px; right: 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 0 0 3px 3px;
}
.tool-tab .icon-glyph {
  width: 30px; height: 30px;
  margin-bottom: 14px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  position: relative;
}
.tool-tab h3 { margin-bottom: 6px; font-size: 1.02rem; }
.tool-tab p { font-size: 0.85rem; margin-bottom: 0; color: var(--slate); }

/* ---------- Why / features ---------- */
.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.feature-row .feature { border-top: 1px solid var(--line); padding-top: 20px; }
.feature .num { font-family: var(--font-mono); color: var(--stamp); font-size: 0.78rem; margin-bottom: 10px; display: block; }

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 1rem;
  gap: 16px;
}
.faq-q .plus { font-family: var(--font-mono); color: var(--stamp); flex-shrink: 0; transition: transform 0.15s ease; }
.faq-item.open .plus { transform: rotate(45deg); }
.faq-a { display: none; padding-top: 10px; max-width: 680px; }
.faq-item.open .faq-a { display: block; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-dim);
  padding: 52px 0 28px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 36px;
}
.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 14px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-grid a { font-size: 0.88rem; color: var(--ink-soft); }
.footer-grid a:hover { color: var(--stamp); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--slate);
}
.footer-bottom .legal-links { display: flex; gap: 18px; }

/* ---------- Misc ---------- */
.badge-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  border: 1px solid var(--line-strong);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: var(--slate);
}

.related-tools { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.related-tools a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border: 1px solid var(--line-strong);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
}
.related-tools a:hover { border-color: var(--stamp); color: var(--stamp); }

.error-msg {
  display: none;
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--stamp-tint);
  border: 1px solid var(--stamp);
  border-radius: var(--radius-sm);
  color: var(--stamp-dark);
  font-size: 0.88rem;
}

.privacy-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 22px;
  padding: 14px 16px;
  background: var(--paper-dim);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--slate);
}
.privacy-note .lock { font-family: var(--font-mono); color: var(--ok); flex-shrink: 0; }

.options-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.opt-group label.opt-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 8px;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.seg button {
  background: var(--paper);
  border: none;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  color: var(--slate);
  border-right: 1px solid var(--line-strong);
}
.seg button:last-child { border-right: none; }
.seg button.active { background: var(--ink); color: var(--paper); }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.thumb {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  padding: 8px;
  text-align: center;
  cursor: grab;
}
.thumb canvas { width: 100%; border: 1px solid var(--line); border-radius: 2px; }
.thumb .pno { font-family: var(--font-mono); font-size: 0.7rem; color: var(--slate); margin-top: 6px; }
.thumb .del {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: var(--slate);
}
.thumb .del:hover { color: var(--stamp); border-color: var(--stamp); }
.thumb.rot-90 canvas { transform: rotate(90deg); }
.thumb.rot-180 canvas { transform: rotate(180deg); }
.thumb.rot-270 canvas { transform: rotate(270deg); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav-links { gap: 16px; font-size: 0.85rem; }
}

@media (max-width: 860px) {
  .feature-row { grid-template-columns: 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 720px) {
  .nav-links, .nav-cta .btn-ghost { display: none; }
  .menu-toggle { display: block; }
  .hero { padding: 40px 0 36px; }
  .tool-card { padding: 22px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
