@font-face {
  font-family: 'Bricolage';
  src: url('fonts/bricolage.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --paper: #EEF1F4;
  --sheet: #FFFFFF;
  --ink: #1B1F27;
  --ink-2: #505A6B;
  --line: #D6DCE4;
  --mark: #FFE45C;
  --mark-ink: #1B1F27;
  --clean: #0B7A66;
  --error: #B42318;
  --focus: #2B6BE8;
  --radius: 14px;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14171C;
    --sheet: #1C2028;
    --ink: #E8EBF0;
    --ink-2: #9BA5B5;
    --line: #2E3540;
    --mark: #F2D64B;
    --clean: #45C9AA;
    --error: #FF8A80;
    --focus: #7FA8FF;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 'Bricolage', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-optical-sizing: auto;
}
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

main, .top, .foot { width: min(100% - 32px, 760px); margin-inline: auto; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; letter-spacing: -0.01em; }
.top-nav { display: flex; gap: 20px; font-size: 0.94rem; color: var(--ink-2); }
.top-nav a { text-decoration: none; }
.top-nav a:hover { color: var(--ink); text-decoration: underline; }

/* Hero */
.hero { padding: 56px 0 28px; }
h1 {
  margin: 0 0 20px;
  font-size: clamp(2.5rem, 7.4vw, 4.6rem);
  line-height: 0.98;
  font-weight: 760;
  letter-spacing: -0.035em;
  max-width: 11ch;
  text-wrap: balance;
}
.lede { margin: 0; font-size: 1.16rem; color: var(--ink-2); max-width: 58ch; }

/* Drop zone */
.drop {
  position: relative;
  margin-top: 8px;
  padding: 44px 28px;
  background: var(--sheet);
  border: 2px dashed color-mix(in srgb, var(--ink) 35%, transparent);
  border-radius: 22px;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.drop:hover { border-color: var(--ink); }
.drop.over { border-style: solid; border-color: var(--ink); background: color-mix(in srgb, var(--mark) 22%, var(--sheet)); }
.drop-title { margin: 0 0 14px; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 680; letter-spacing: -0.02em; line-height: 1.1; }
.drop-sub { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--ink-2); }
.drop-formats { margin: 18px 0 0; font-size: 0.88rem; color: var(--ink-2); }

.promises { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; font-size: 0.93rem; color: var(--ink-2); }
.promises strong { display: block; color: var(--ink); font-weight: 650; }

/* Load from link */
.url-form { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); cursor: default; }
.url-form label { display: block; font-weight: 620; margin-bottom: 8px; font-size: 0.95rem; }
.url-row { display: flex; gap: 8px; }
.url-row input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 14px;
  font: 400 0.95rem var(--mono); color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 12px;
}
.url-row input:focus { border-color: var(--ink); outline: none; }
.url-msg { margin: 8px 0 0; font-size: 0.9rem; color: var(--ink-2); min-height: 0; }
.url-msg:empty { display: none; }
.url-msg.err { color: var(--error); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 12px;
  font-weight: 620; font-size: 0.98rem; text-decoration: none;
  cursor: pointer; white-space: nowrap;
}
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-mark { background: var(--mark); color: var(--mark-ink); }
.btn-mark:hover { filter: brightness(0.96); }
.btn-ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); min-height: 38px; padding: 0 14px; font-size: 0.92rem; }
.btn-line:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn:disabled { opacity: .5; cursor: progress; }

/* Section headings */
h2 { font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 16px; font-weight: 700; }

/* Report rows (used by sample and file details) */
.sheet { background: var(--sheet); border-radius: var(--radius); }
.rows { margin: 0; }
.row { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row dt { color: var(--ink-2); font-size: 0.93rem; overflow-wrap: anywhere; }
.row dd { margin: 0; min-width: 0; }
.val { position: relative; font-family: var(--mono); font-size: 0.88rem; overflow-wrap: anywhere; white-space: pre-wrap; }
mark {
  color: var(--mark-ink);
  background: linear-gradient(transparent 6%, var(--mark) 6%, var(--mark) 94%, transparent 94%);
  padding: 0 3px; margin: 0 -3px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Redaction: bars sweep across each value once metadata is removed */
.redacted .val { color: transparent; }
.redacted .val mark { color: transparent; background: none; }
.redacted .val::after {
  content: '';
  position: absolute; left: -2px; right: -2px; top: 0.12em; bottom: 0.12em;
  background: var(--ink);
  border-radius: 2px;
  transform-origin: left center;
  animation: redact .32s cubic-bezier(.3, .7, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.redacted.still .val::after { animation: none; }
@keyframes redact { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Sample */
.sample { margin-top: 64px; }
.sample .report { padding: 10px 24px 20px; }
.sample-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sample-note { margin: 0; color: var(--ink-2); font-size: 0.95rem; }

/* Files */
.files { margin-top: 48px; }
.files-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.options { font-size: 0.93rem; color: var(--ink-2); }
.options summary { cursor: pointer; padding: 6px 0; }
.options-body { display: grid; gap: 10px; padding: 10px 0 16px; }
.options label { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); cursor: pointer; }
.options input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }

.file-list { list-style: none; margin: 0; padding: 0; background: var(--sheet); border-radius: var(--radius); }
.file { padding: 20px 22px; border-top: 1px solid var(--line); }
.file:first-child { border-top: 0; }
.file-main { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: start; }
.thumb {
  width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  background: var(--paper); display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 650; color: var(--ink-2);
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.name { margin: 0; font-weight: 640; overflow-wrap: anywhere; line-height: 1.3; }
.sub { margin: 2px 0 0; font-size: 0.88rem; color: var(--ink-2); }
.status { margin: 8px 0 0; font-size: 0.95rem; }
.file[data-state="clean"] .status, .file[data-state="none"] .status { color: var(--clean); font-weight: 600; }
.file[data-state="error"] .status { color: var(--error); }
.file[data-state="reading"] .status { color: var(--ink-2); }

.chips { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 0.8rem; font-weight: 620; padding: 3px 9px; border-radius: 6px; background: var(--mark); color: var(--mark-ink); }
.file[data-state="clean"] .chip { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); text-decoration: line-through; text-decoration-thickness: 2px; }

.file-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.file-actions .btn { min-height: 38px; font-size: 0.92rem; }
.icon-btn { width: 38px; height: 38px; border: 0; background: transparent; color: var(--ink-2); border-radius: 10px; cursor: pointer; font-size: 1.3rem; line-height: 1; align-self: end; }
.icon-btn:hover { color: var(--ink); background: var(--paper); }

.toggle-details { margin-top: 12px; background: none; border: 0; padding: 4px 0; color: var(--ink); font-weight: 600; font-size: 0.93rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.details { margin-top: 12px; padding: 4px 0 0 80px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.search {
  flex: 1 1 200px; min-height: 38px; padding: 0 12px; font: inherit; font-size: 0.93rem;
  color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px;
}
.search:focus { border-color: var(--ink); outline: none; }
.part { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 2px; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.part span { font-size: 0.85rem; font-weight: 500; color: var(--ink-2); }
.grp { margin-top: 8px; border-bottom: 1px solid var(--line); }
.grp > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; cursor: pointer; list-style: none;
  font-size: 0.9rem; font-weight: 680; color: var(--ink);
}
.grp > summary::-webkit-details-marker { display: none; }
.grp > summary::before { content: '+'; width: 1em; color: var(--ink-2); font-weight: 500; }
.grp[open] > summary::before { content: '\2212'; }
.grp > summary span:first-of-type { flex: 1; }
.grp .count { font-size: 0.8rem; font-weight: 500; color: var(--ink-2); }
.grp .rows { padding-bottom: 8px; }
.grp.kept > summary { color: var(--clean); }
.no-match { color: var(--ink-2); font-size: 0.93rem; }
.options label.off { opacity: 0.45; }
.opt-strong { font-weight: 600; }
code { font-family: var(--mono); font-size: 0.88em; }
.grp.kept .row dd { color: var(--ink-2); font-size: 0.93rem; }
.verify-line { margin: 4px 0 0; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--clean) 12%, transparent); color: var(--clean); font-weight: 600; font-size: 0.93rem; }
.notes { margin: 14px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 0.9rem; }

/* Bottom action bar */
.bar {
  position: sticky; bottom: 0; z-index: 5;
  width: min(100% - 16px, 800px); margin: 24px auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 12px 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--ink); color: var(--paper);
  border-radius: 18px 18px 0 0;
}
.bar-text { margin: 0; font-weight: 560; }
.bar-actions { display: flex; gap: 8px; }

/* How it works */
.how { margin-top: 80px; padding-top: 32px; border-top: 1px solid var(--line); }
.qa { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 18px 0; border-top: 1px solid var(--line); }
.qa:first-of-type { border-top: 0; }
.qa h3 { margin: 0; font-size: 1.02rem; font-weight: 650; line-height: 1.35; }
.qa p { margin: 0; color: var(--ink-2); max-width: 60ch; }

.foot { padding: 48px 0 40px; font-size: 0.88rem; color: var(--ink-2); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot p { margin: 0; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .top-nav a:first-child { display: none; }
  .hero { padding: 36px 0 22px; }
  .drop { padding: 30px 20px; }
  .promises { grid-template-columns: 1fr; gap: 10px; }
  .file { padding: 18px 16px; }
  .file-main { grid-template-columns: 52px 1fr; }
  .thumb { width: 52px; height: 52px; }
  .file-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .file-actions .btn { flex: 1; }
  .icon-btn { order: 9; }
  .details { padding-left: 0; }
  .url-row .btn { padding: 0 14px; }
  .row { grid-template-columns: 1fr; gap: 2px; }
  .qa { grid-template-columns: 1fr; gap: 6px; }
  .bar { width: 100%; border-radius: 16px 16px 0 0; }
  .bar-actions { width: 100%; }
  .bar-actions .btn-mark { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .redacted .val::after { animation: none; }
}
