/* Drafting-table look: warm paper, ink, one vermilion accent. Square anchor nodes (the handles you see when
   editing a vector path) are the recurring motif. System fonts only: no font download, fast first paint. */
:root {
  --paper: #f4efe6;
  --paper-2: #ebe4d7;
  --ink: #1d1b18;
  --ink-2: #5d574e;
  --line: #cfc6b6;
  --accent: #ff5a2b;
  --sans: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --check: repeating-conic-gradient(#e2dccf 0 25%, #f8f5ef 0 50%) 0 0 / 18px 18px;
  --check-dark: repeating-conic-gradient(#2a2724 0 25%, #1d1b18 0 50%) 0 0 / 18px 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.55 var(--sans); }
a { color: inherit; }
[hidden] { display: none !important; }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; max-width: 1160px; margin: 0 auto; padding: 20px 24px; }
.mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; text-decoration: none; }
.mark svg { width: 30px; height: 30px; fill: var(--ink); color: var(--accent); }
.privacy { font-size: 14px; color: var(--ink-2); }
.privacy::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; background: var(--accent); vertical-align: 2px; }

main { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.hero { padding: 40px 0 24px; text-align: center; }
h1 { font-size: clamp(44px, 8vw, 92px); line-height: 0.95; letter-spacing: -0.045em; font-weight: 800; margin: 0 0 20px; }
.lede { max-width: 34em; margin: 0 auto 36px; color: var(--ink-2); font-size: 19px; }

.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 720px; margin: 0 auto;
  padding: 64px 24px; border: 1.5px solid var(--ink); background: var(--check); cursor: pointer; transition: background-color .2s, transform .2s; }
.drop::before { content: ""; position: absolute; inset: 0; background: rgba(244, 239, 230, .82); }
.drop > * { position: relative; }
.drop.over { transform: scale(1.01); }
.drop.over::before { background: rgba(255, 90, 43, .12); }
.drop-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.drop-hint { font-size: 14px; color: var(--ink-2); }
.corner { position: absolute !important; width: 11px; height: 11px; background: var(--paper); border: 1.5px solid var(--ink); }
.tl { top: -6px; left: -6px; } .tr { top: -6px; right: -6px; } .bl { bottom: -6px; left: -6px; } .br { bottom: -6px; right: -6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px; border: 1.5px solid var(--ink);
  background: transparent; color: var(--ink); font: 600 16px var(--sans); text-decoration: none; cursor: pointer; border-radius: 0; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a0d07; }
.btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.btn:focus-visible, .link:focus-visible, .samples button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.samples { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 22px; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; }
.samples button { width: 52px; height: 52px; padding: 5px; border: 1px solid var(--line); background: var(--check); cursor: pointer; }
.samples img { width: 100%; height: 100%; object-fit: contain; }

.result { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; padding: 32px 0; align-items: start; }
.stage { position: relative; aspect-ratio: 4 / 3; background: var(--check); border: 1.5px solid var(--ink); overflow: hidden; touch-action: pan-y; }
.stage img { position: absolute; inset: 24px; width: calc(100% - 48px); height: calc(100% - 48px); object-fit: contain; }
/* The SVG side has its own opaque checkerboard: a paper-less SVG (sketch, diagram) must not show the original through it. */
.after { position: absolute; inset: 0; padding: 24px; background: var(--check); clip-path: inset(0 0 0 var(--split, 50%)); }
.after svg { width: 100%; height: 100%; display: block; }
.stage::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; }
#split { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3; }
.handle { position: absolute; top: 50%; left: var(--split, 50%); width: 16px; height: 16px; margin: -8px 0 0 -8px; background: var(--paper);
  border: 2px solid var(--ink); pointer-events: none; z-index: 2; }
#split:focus-visible ~ .handle { outline: 3px solid var(--accent); outline-offset: 2px; }
.tag { position: absolute; bottom: 10px; padding: 2px 8px; font: 600 12px var(--mono); background: var(--ink); color: var(--paper); z-index: 2; }
.tag.left { left: 10px; } .tag.right { right: 10px; background: var(--accent); color: #1a0d07; }

/* Trace animation: a plotter line sweeps while the worker refines; each improved SVG fades in behind it. */
.sweep { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; }
.stage.busy .sweep { opacity: 1; }
.sweep::before { content: ""; position: absolute; top: 0; bottom: 0; width: 34%; left: -34%;
  background: linear-gradient(90deg, transparent, rgba(255, 90, 43, .18)); border-right: 2px solid var(--accent); animation: sweep 1.6s cubic-bezier(.6, 0, .4, 1) infinite; }
@keyframes sweep { to { left: 100%; } }
.stage.busy .after svg path { animation: draw .6s ease-out both; }
@keyframes draw { from { opacity: 0; } }
.phase { margin: 10px 0 0; font: 14px var(--mono); color: var(--ink-2); min-height: 1.5em; }

.panel { display: flex; flex-direction: column; gap: 22px; }
.score { display: flex; align-items: baseline; gap: 8px; padding-bottom: 14px; border-bottom: 1.5px solid var(--ink); }
.score-num { font: 700 64px/1 var(--mono); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.score-unit { font-size: 16px; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 10px; margin: 0; }
.stats dt { font-size: 13px; color: var(--ink-2); }
.stats dd { margin: 0; font: 600 15px var(--mono); font-variant-numeric: tabular-nums; }
.actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.settings { border: 1px solid var(--line); padding: 14px 16px 16px; margin: 0; display: grid; gap: 12px; }
.settings legend { padding: 0 6px; font-weight: 600; }
.settings label { display: grid; grid-template-columns: 1fr auto; font-size: 15px; }
.settings output { font: 600 14px var(--mono); }
.settings input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; justify-self: start; text-align: left; }

.ad { display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); color: var(--ink-2); font: 12px var(--mono); }
.ad::after { content: "Ad " attr(data-size); } /* placeholder until the ad network snippet goes in */
.ad-wide { max-width: 728px; height: 90px; margin: 24px auto 64px; }
.ad-box { width: 300px; max-width: 100%; height: 250px; }

.how, .faq { max-width: 720px; margin: 0 auto 64px; }
h2 { font-size: 34px; letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 22px; }
.how ol { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 18px; }
.how li { counter-increment: s; position: relative; padding-left: 52px; }
.how li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 34px; height: 34px; display: grid; place-items: center;
  border: 1.5px solid var(--ink); font: 700 15px var(--mono); }
details { border-top: 1px solid var(--line); padding: 14px 0; }
details:last-child { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::after { content: "+"; font: 600 20px/1 var(--mono); color: var(--accent); }
details[open] summary::after { content: "\2212"; }
details p { margin: 10px 0 0; color: var(--ink-2); }

.foot { max-width: 1160px; margin: 0 auto; padding: 24px; border-top: 1.5px solid var(--ink); font-size: 14px; color: var(--ink-2); }

@media (max-width: 860px) {
  body { font-size: 16px; }
  .bar { flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 18px; }
  main { padding: 0 18px; }
  .hero { padding-top: 20px; text-align: left; }
  .lede { margin-left: 0; }
  .drop { padding: 44px 18px; }
  .samples { justify-content: flex-start; }
  .samples span { flex-basis: 100%; }
  .result { grid-template-columns: 1fr; gap: 22px; padding-top: 12px; }
  .stage img { inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); }
  .after { padding: 12px; }
  .ad-wide { height: 50px; max-width: 320px; }
  .ad-wide::after { content: "Ad 320 x 50"; }
  .ad-box { margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .sweep::before, .stage.busy .after svg path { animation: none; }
}

.stage.dark, .stage.dark .after { background: var(--check-dark); }
.settings label.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.settings label.check input { width: 18px; height: 18px; accent-color: var(--accent, #ff5a2b); margin: 0; }

.types { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; }
.types a { text-decoration: none; color: var(--ink-2); padding: 2px 0; border-bottom: 1.5px solid transparent; }
.types a:hover, .types a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.soon { display: inline-block; margin: 8px 0 40px; padding: 14px 22px; border: 1.5px solid var(--ink); font: 700 15px var(--mono); }
.settings select { width: 100%; padding: 6px 8px; font: inherit; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); }
