/* Paperbench design system: neutral surfaces, one accent, no gradients. */
/* Dark only. Type: Manrope, extra-bold lowercase headlines with tight tracking. */
:root {
  --bg: #000; --surface: #111112; --surface-2: #19191b;
  --ink: #fff; --muted: rgba(255, 255, 255, .6); --line: #3a3a3d; --line-soft: #262628;
  --accent: #0071e3; --accent-hover: #0a7cf0; --accent-text: #2997ff;
  --ok: #30d158; --err: #ff453a;
  --nav: rgba(0, 0, 0, .72);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .7);
  --r: 18px; --r-sm: 12px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 16px/1.5 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.1; text-wrap: balance; }
h1, h2, h3, .zero, .btn, .brand { text-transform: lowercase; }
h1:focus { outline: none; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px; border: 0; border-radius: 980px; cursor: pointer;
  font: inherit; font-weight: 700; background: var(--accent); color: #fff;
  transition: background .15s, transform .1s, opacity .15s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 34px; padding: 0 16px; font-size: 14px; }
.link-arrow::after { content: " ›"; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 20; background: var(--nav); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line-soft); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.nav nav { display: flex; align-items: center; gap: 24px; }
.nav nav a:not(.btn) { color: var(--ink); font-size: 14px; opacity: .8; }
.nav nav a:not(.btn):hover, .nav nav a[aria-current] { opacity: 1; text-decoration: none; }
@media (max-width: 560px) { .nav nav { gap: 16px; } .nav .hide-sm { display: none; } }

/* Hero */
.hero { text-align: center; padding-block: 88px 56px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--muted); margin-bottom: 20px; }
.eyebrow .icon { width: 16px; height: 16px; }
.hero h1 { font-size: clamp(40px, 7.2vw, 76px); font-weight: 800; letter-spacing: -.04em; line-height: 1; max-width: 14ch; margin: 0 auto; }
.hero .lede { font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); max-width: 44ch; margin: 22px auto 0; }
.hero .cta { display: flex; gap: 20px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 32px; }

/* Hero mock: illustrates on-device processing */
.mock { max-width: 460px; margin: 56px auto 0; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); box-shadow: var(--shadow-lg); text-align: left; overflow: hidden; }
.mock-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.mock-row { display: flex; gap: 14px; align-items: center; padding: 20px; }
.file-ic { display: grid; place-items: center; width: 44px; height: 54px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line-soft); font-size: 11px; font-weight: 800; color: var(--err); flex: none; }
.mock-row > div { flex: 1; min-width: 0; }
.mock-row b { display: block; font-size: 15px; font-weight: 600; }
.mock-row small { color: var(--muted); font-size: 13px; }
.bar { height: 4px; border-radius: 4px; background: var(--line-soft); margin-top: 10px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 4px; transform-origin: left; animation: fill 3.2s ease-in-out infinite; }
@keyframes fill { 0% { transform: scaleX(0); } 70%, 100% { transform: scaleX(1); } }
.mock-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-soft); font-size: 14px; font-weight: 500; color: var(--ok); background: var(--surface-2); }
.mock-foot .icon { width: 18px; height: 18px; }

/* Sections */
.section { padding-block: 80px; }
.section.alt { background: var(--surface-2); }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 800; letter-spacing: -.04em; }
.section-head p { color: var(--muted); font-size: 19px; margin: 14px auto 0; max-width: 48ch; }

/* Tool grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { display: block; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 24px; color: var(--ink); transition: transform .2s, box-shadow .2s, border-color .2s; }
a.card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line); }
.tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 11%, transparent); color: var(--accent-text); margin-bottom: 16px; }
.card h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.card p { color: var(--muted); font-size: 15px; margin-top: 6px; }
.card .go { display: inline-block; margin-top: 14px; font-size: 15px; color: var(--accent-text); }

/* Features and steps */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }
.cols h3 { font-size: 20px; font-weight: 700; margin: 14px 0 8px; }
.cols p { color: var(--muted); font-size: 16px; }
.cols .icon { width: 28px; height: 28px; color: var(--accent-text); }
.step-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; }
.zero { font-size: clamp(56px, 11vw, 120px); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.band { text-align: center; }
.band h2 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; }
.band p { color: var(--muted); margin: 12px auto 24px; max-width: 46ch; }

/* Tool pages */
.page { max-width: 680px; margin: 0 auto; padding: 36px 20px 96px; }
.back { display: inline-block; font-size: 15px; margin-bottom: 28px; }
.page-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 28px; }
.page-head .tile { margin: 4px 0 0; flex: none; }
.page-head h1 { font-size: clamp(30px, 5vw, 40px); font-weight: 800; letter-spacing: -.04em; }
.page-head p { color: var(--muted); margin-top: 8px; }
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); }
.local { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 16px; justify-content: center; }
.local .icon { width: 14px; height: 14px; }

/* Drop zone: the real file input covers it, so click, keyboard and drag-and-drop are all native */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 32px 20px; border: 1.5px dashed var(--line); border-radius: var(--r-sm); background: var(--surface-2); transition: border-color .15s, background .15s; cursor: pointer; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop .icon { width: 30px; height: 30px; color: var(--accent-text); }
.drop-title { font-weight: 600; }
.drop-title u { color: var(--accent-text); text-decoration: none; }
.drop-hint { font-size: 14px; color: var(--muted); }
.drop-files { font-size: 14px; font-weight: 500; color: var(--ok); overflow-wrap: anywhere; }
.drop:hover, .drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)); }
.drop:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.drop.has-files { border-style: solid; border-color: var(--ok); }
.pro-tag { color: var(--accent-text); font-weight: 500; }

/* Forms */
.field { margin-top: 18px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 16px; }
label, .label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=number], select {
  width: 100%; min-height: 44px; padding: 0 14px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
}
input:focus-visible, select:focus-visible { outline-offset: 0; border-color: var(--accent); border-radius: var(--r-sm); }
.actions { display: flex; gap: 12px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.status { font-size: 15px; color: var(--muted); white-space: pre-line; margin-top: 14px; min-height: 1.5em; }
.status.err { color: var(--err); }
canvas { display: block; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); touch-action: none; }
#sig-pad { width: 100%; cursor: crosshair; }
#sig-preview { cursor: crosshair; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 760px; margin: 0 auto; }
.plan { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 32px; display: flex; flex-direction: column; }
.plan.pro { border: 2px solid var(--accent); padding: 31px; }
.plan h2 { font-size: 22px; font-weight: 600; }
.price { font-size: 44px; font-weight: 800; letter-spacing: -.04em; margin-top: 16px; line-height: 1; }
.price small { font-size: 16px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan .sub { color: var(--muted); font-size: 15px; margin-top: 8px; min-height: 1.5em; }
.plan ul { list-style: none; padding: 0; margin: 24px 0 28px; display: grid; gap: 12px; flex: 1; }
.plan li { display: flex; gap: 10px; font-size: 16px; }
.plan li .icon { width: 20px; height: 20px; color: var(--ok); margin-top: 2px; }
.faq { max-width: 680px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq summary { cursor: pointer; padding: 20px 28px 20px 0; font-weight: 600; font-size: 18px; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 2px; top: 16px; font-size: 24px; font-weight: 300; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding: 0 0 20px; }

/* Prose (privacy) */
.prose h1 { font-size: clamp(34px, 5vw, 48px); font-weight: 800; letter-spacing: -.04em; }
.prose h2 { font-size: 22px; font-weight: 600; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--muted); }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 20px; margin: 8px 0 0; display: grid; gap: 6px; }

/* Dialog */
dialog { width: min(460px, calc(100vw - 32px)); padding: 28px; border: 1px solid var(--line-soft); border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(0, 0, 0, .45); backdrop-filter: blur(4px); }
dialog[open] { animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }
dialog h2 { font-size: 26px; font-weight: 800; }
dialog p { color: var(--muted); margin-top: 10px; font-size: 16px; }
.x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.x:hover { color: var(--ink); }
.hint { font-size: 13px; }

/* Toasts */
.toasts { position: fixed; top: 16px; left: 0; right: 0; z-index: 2147483647; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(420px, 100%); padding: 11px 16px 11px 12px; border-radius: 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-soft); box-shadow: var(--shadow-lg); font-size: 15px; font-weight: 500; line-height: 1.35; cursor: pointer; animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.25); transition: opacity .2s, transform .2s; }
.toast.out { opacity: 0; transform: translateY(-8px) scale(.96); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(.94); } }
.toast-icon { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.toast-icon svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.toast.success .toast-icon { background: var(--ok); animation: icon-pop .3s .1s cubic-bezier(.2, .9, .3, 1.6) backwards; }
.toast.error .toast-icon { background: var(--err); animation: icon-pop .3s .1s cubic-bezier(.2, .9, .3, 1.6) backwards; }
.toast.loading .toast-icon { border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes icon-pop { from { transform: scale(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
footer { border-top: 1px solid var(--line-soft); padding: 32px 0 48px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
footer nav { display: flex; gap: 20px; }
footer a { color: var(--muted); }

@media (max-width: 640px) { .section { padding-block: 56px; } .hero { padding-block: 56px 40px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

/* Motion: quiet and short. All of it is switched off by the reduced-motion rule above. */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
.view:not([hidden]) { animation: fade .35s ease; }                       /* page change */
.hero > *, .page > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) backwards; }  /* staggered entrance */
.hero > :nth-child(2), .page > :nth-child(2) { animation-delay: .07s; }
.hero > :nth-child(3), .page > :nth-child(3) { animation-delay: .14s; }
.hero > :nth-child(4), .page > :nth-child(4) { animation-delay: .21s; }
.hero > :nth-child(5) { animation-delay: .32s; }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease var(--d, 0s), transform .6s cubic-bezier(.2, .7, .2, 1) var(--d, 0s); }  /* scroll reveal, set by app.js */
.reveal.in { opacity: 1; transform: none; }
.tile, .drop .icon, .link-arrow::after { transition: transform .25s cubic-bezier(.2, .7, .2, 1); }
.link-arrow::after { display: inline-block; }
a.card:hover .tile { transform: scale(1.08); }
a.card:hover .link-arrow::after, a.link-arrow:hover::after { transform: translateX(3px); }
.drop:hover .icon, .drop.over .icon { transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }


/* Speed stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 0; }
.stats > div { border: 1px solid var(--line-soft); border-radius: var(--r); padding: 28px; background: var(--surface); }
.stats dd { margin: 0; font-size: clamp(48px, 7vw, 72px); font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stats dt { color: var(--muted); margin-top: 12px; }
.stats-note { color: var(--muted); font-size: 13px; text-align: center; max-width: 60ch; margin: 20px auto 0; }
.stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }

/* Finished screen: replaces the form once a file has been saved */
.panel.is-done > :not(.done) { display: none; }
.done { text-align: center; padding: 20px 0 8px; animation: rise .5s cubic-bezier(.2, .7, .2, 1); }
.done-check { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #000; animation: icon-pop .45s .1s cubic-bezier(.2, .9, .3, 1.6) backwards; }
.done-check svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.done h2 { font-size: 26px; font-weight: 800; letter-spacing: -.04em; margin-top: 18px; }
.done p { color: var(--muted); margin-top: 10px; white-space: pre-line; overflow-wrap: anywhere; }
.done .actions { justify-content: center; }
.done-check.neutral { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

/* Three steps: same card style as the tool grid, small step label, arrows between cards */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.steps li { position: relative; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 24px; transition: border-color .2s, transform .2s; }
.steps li:hover { border-color: var(--line); transform: translateY(-3px); }
.step-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.step-top .tile { margin: 0; }
.step-num { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums; }
.steps h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: 15px; }
@media (min-width: 900px) {
  .steps li:not(:last-child)::after { content: "›"; position: absolute; right: -23px; top: 50%; transform: translateY(-50%); z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 16px; line-height: 1; padding-bottom: 2px; }
}
