
  :root {
    --bg: #0f0f0f;
    --bg-elev: #161616;
    --bg-elev-2: #1d1d1d;
    --border: #2a2a2a;
    --border-strong: #3a3a3a;
    --text: #f2f2f2;
    --text-dim: #a8a8a8;
    --text-faint: #6b6b6b;
    --accent: #c0392b;
    --accent-hover: #d04434;
    --accent-dim: #8a2a20;
    --danger: #c0392b;
    --success: #2e7d52;
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  a { color: var(--accent); text-decoration: none; }
  a:hover { color: var(--accent-hover); text-decoration: underline; }

  .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

  /* ---------- Layout ---------- */
  .container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
  }

  /* ---------- Header ---------- */
  header.site {
    border-bottom: 1px solid var(--border);
    padding: 22px 0;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
  }
  header.site .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .logo-mark {
    width: 36px;
    height: 36px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 18px;
    border-radius: 3px;
    letter-spacing: -0.5px;
  }
  .brand h1 {
    font-size: 22px;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.3px;
  }
  .brand .tag {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 2px;
    font-family: 'JetBrains Mono', monospace;
  }
  .privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim);
    background: var(--bg-elev);
  }
  .privacy-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    box-shadow: 0 0 8px #4caf50;
  }

  /* ---------- Hero ---------- */
  .hero {
    padding: 56px 0 28px;
    text-align: center;
  }
  .hero h2 {
    font-size: clamp(32px, 5vw, 52px);
    margin: 0 0 16px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.05;
  }
  .hero h2 .accent { color: var(--accent); }
  .hero p.sub {
    font-size: 18px;
    color: var(--text-dim);
    max-width: 640px;
    margin: 0 auto;
  }

  /* ---------- App ---------- */
  .app {
    margin: 32px 0 64px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    border-radius: 4px;
    overflow: hidden;
  }

  .dropzone {
    padding: 80px 24px;
    text-align: center;
    border: 2px dashed var(--border-strong);
    margin: 32px;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
  }
  .dropzone:hover, .dropzone.drag {
    border-color: var(--accent);
    background: rgba(192, 57, 43, 0.04);
  }
  .dropzone .big {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
  }
  .dropzone .small {
    color: var(--text-dim);
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
  }
  .dropzone .icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border: 2px solid var(--accent);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 700;
  }

  /* ---------- Toolbar ---------- */
  .toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev-2);
  }
  .toolbar .group {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .toolbar .spacer { flex: 1; }
  .toolbar .filename {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
  }
  .page-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text);
    padding: 0 8px;
    min-width: 80px;
    text-align: center;
  }

  button {
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-strong);
    background: var(--bg-elev);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.12s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }
  button:hover:not(:disabled) {
    border-color: var(--text-dim);
    background: #222;
  }
  button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
  }
  button.primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
  }
  button.ghost-danger {
    color: #e88;
    border-color: var(--border-strong);
  }
  button.ghost-danger:hover:not(:disabled) {
    border-color: var(--accent);
    color: #fff;
    background: rgba(192, 57, 43, 0.15);
  }

  /* ---------- Canvas viewer ---------- */
  .viewer {
    background: #050505;
    padding: 28px;
    min-height: 480px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
  }
  .canvas-wrap {
    position: relative;
    display: inline-block;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    line-height: 0;
  }
  .canvas-wrap canvas {
    display: block;
    max-width: 100%;
    height: auto;
  }
  #pdfCanvas { background: #fff; }
  #overlayCanvas {
    position: absolute;
    top: 0; left: 0;
    cursor: crosshair;
    touch-action: none;
  }
  .viewer-empty {
    color: var(--text-faint);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    padding: 80px 20px;
    text-align: center;
  }

  /* ---------- Status bar ---------- */
  .statusbar {
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-elev-2);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
  }
  .statusbar .ok { color: #4caf50; }
  .statusbar .working { color: #f0b232; }
  .statusbar .err { color: var(--accent); }

  /* ---------- Sections ---------- */
  section.block {
    padding: 64px 0;
    border-top: 1px solid var(--border);
  }
  section.block h3 {
    font-size: 28px;
    margin: 0 0 8px;
    font-weight: 800;
    letter-spacing: -0.5px;
  }
  section.block .lede {
    color: var(--text-dim);
    margin: 0 0 36px;
    font-size: 16px;
    max-width: 640px;
  }

  /* ---------- How it works ---------- */
  .steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .step {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 28px 24px;
    background: var(--bg-elev);
  }
  .step .num {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: 1px;
  }
  .step h4 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
  }
  .step p {
    margin: 0;
    color: var(--text-dim);
    font-size: 14px;
  }

  /* ---------- Privacy callout ---------- */
  .privacy-callout {
    border: 1px solid var(--accent-dim);
    border-left: 4px solid var(--accent);
    padding: 28px 32px;
    background: rgba(192, 57, 43, 0.05);
    border-radius: 4px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
  }
  .privacy-callout .pcicon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 2px solid var(--accent);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
  }
  .privacy-callout h4 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
  }
  .privacy-callout p {
    margin: 0;
    color: var(--text-dim);
    font-size: 14px;
  }

  /* ---------- FAQ ---------- */
  .faq {
    display: grid;
    gap: 12px;
  }
  details.faq-item {
    border: 1px solid var(--border);
    background: var(--bg-elev);
    border-radius: 4px;
    overflow: hidden;
  }
  details.faq-item summary {
    cursor: pointer;
    padding: 18px 22px;
    font-weight: 600;
    font-size: 16px;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
  }
  details.faq-item summary::-webkit-details-marker { display: none; }
  details.faq-item summary::after {
    content: "+";
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
  }
  details.faq-item[open] summary::after { content: "−"; }
  details.faq-item .faq-body {
    padding: 0 22px 20px;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.65;
  }

  /* ---------- Footer ---------- */
  footer.site {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    color: var(--text-faint);
    font-size: 14px;
  }
  footer.site .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
  }
  footer.site .flinks {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
  }
  footer.site .flinks a {
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
  }
  footer.site .flinks a:hover {
    color: var(--accent);
    text-decoration: none;
  }
  footer.site .copyright {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
  }

  /* ---------- Progress overlay ---------- */
  .progress-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 18px;
    backdrop-filter: blur(4px);
  }
  .progress-overlay.show { display: flex; }
  .progress-overlay .pbox {
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 32px 40px;
    text-align: center;
    min-width: 320px;
  }
  .progress-overlay .pbar {
    width: 100%;
    height: 6px;
    background: var(--bg-elev-2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 16px;
  }
  .progress-overlay .pbar > div {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.2s;
  }
  .progress-overlay .ptext {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 12px;
  }

  /* ---------- Responsive ---------- */
  @media (max-width: 720px) {
    .steps { grid-template-columns: 1fr; }
    .hero { padding: 32px 0 12px; }
    .dropzone { margin: 16px; padding: 48px 16px; }
    section.block { padding: 48px 0; }
    .toolbar { padding: 12px; }
    .viewer { padding: 12px; }
    .privacy-callout { flex-direction: column; gap: 14px; padding: 20px; }
    header.site { padding: 16px 0; }
    .brand h1 { font-size: 18px; }
    .brand .tag { display: none; }
  }

/* Landing / legal pages (extends homepage styles) */
a.brand {
  text-decoration: none;
  color: inherit;
}
a.brand:hover {
  text-decoration: none;
  color: inherit;
}

.page-hero {
  padding: 40px 0 12px;
}
.page-hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  margin: 0 0 12px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.page-hero .lede {
  color: var(--text-dim);
  font-size: 18px;
  margin: 0;
  max-width: 720px;
}

section.block .prose-tight p {
  color: var(--text-dim);
  margin: 0 0 18px;
  max-width: 720px;
}
section.block .prose-tight h2 {
  font-size: 24px;
  margin: 28px 0 12px;
  font-weight: 800;
}
section.block .prose-tight ul {
  color: var(--text-dim);
  margin: 0 0 18px;
  padding-left: 1.4em;
}
section.block .step h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.tool-anchor {
  scroll-margin-top: 88px;
}
