/* SignalClean — hand-written CSS, no framework, no build step.
 *
 * Minimal single-column page. Ink on paper, one accent colour, used only for
 * the "verified clean" state. Light and dark come from the same tokens.
 * Fonts are the device's own: no font files are downloaded (repo rule).
 *
 * Class names under "results" are generated by assets/app.js — keep them.
 */

:root {
  --paper: #f4f3ee;
  --surface: #fbfaf7;
  --ink: #141413;
  --ink-2: #4a4945;
  --ink-3: #6a6963;
  --line: #d9d7cf;     /* decorative rules only */
  --edge: #87857e;     /* edge of an interactive control: >= 3:1 on paper and surface */
  --accent: #0b7a3e;   /* verified clean — the only accent */
  --bad: #b42318;      /* errors and failed verification (app.js reads this) */
  --hatch: rgba(20, 20, 19, 0.06);
  --press: #ecebe4;    /* pressed surface: touch feedback */

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display",
          "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --measure: 760px;
  --gutter: 24px;
  --radius: 6px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111110;
    --surface: #191918;
    --ink: #ededea;
    --ink-2: #b4b3ad;
    --ink-3: #8f8e88;
    --line: #2d2c2a;
    --edge: #6b6a65;
    --accent: #4cc38a;
    --bad: #ff8073;
    --hatch: rgba(237, 237, 234, 0.07);
    --press: #232321;
  }
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;   /* replaced by :active styles below */
}

::selection { background: var(--ink); color: var(--paper); }

h1, h2, p, ol { margin: 0; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.bar,
main > section,
.foot {
  max-width: var(--measure);
  margin-inline: auto;
  /* clear the notch / rounded corners on phones held sideways */
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.dropzone, .mini-btn, .faq summary { touch-action: manipulation; }

/* ------------------------------------------------------------------- bar */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.mark {
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
}
.bar-note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ hero */

.hero { padding-top: clamp(40px, 9vh, 104px); }

h1 {
  font-size: clamp(1.875rem, 8.6vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 700;
  text-wrap: balance;
}
.lede {
  margin-top: 22px;
  max-width: 34em;
  font-size: 1.125rem;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* -------------------------------------------------------------- dropzone */

.dropzone {
  margin-top: 40px;
  padding: 44px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}
@media (hover: hover) {
  .dropzone:hover { border-color: var(--ink); }
}
.dropzone:active { border-color: var(--ink); background-color: var(--press); }
.dropzone.drag {
  border-color: var(--ink);
  background-image: repeating-linear-gradient(-45deg, var(--hatch) 0 1px, transparent 1px 9px);
}
.dz-icon { color: var(--ink); }
.dz-title { margin-top: 12px; font-weight: 600; font-size: 1.0625rem; }
.dz-touch { display: none; }

/* Phones and tablets: there is nothing to drag, so the zone says "Choose
   files" and shows it as a button. The whole zone stays the tap target. */
@media (hover: none) and (pointer: coarse) {
  .dz-fine { display: none; }
  .dz-touch {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 26px;
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--paper);
  }
  .dropzone:active .dz-touch { background: var(--ink-2); }
}
.dz-sub span { display: block; }
.dz-sub {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
}
.link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------- results */
/* Markup comes from renderCard() / renderError() in assets/app.js.        */

.results {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-card {
  padding: 16px 18px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: rise 0.28s var(--ease) both;
  scroll-margin-top: 16px;
}
.fc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}
.fc-name { font-weight: 600; overflow-wrap: anywhere; }
.fc-meta { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.fc-status {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}
.st-tags  { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.st-clean { color: var(--accent); }
.st-error { color: var(--bad); }

.signal-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}
.signal-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.sig-kind {
  flex: 0 0 76px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
.k-c2pa, .k-ai-flag { color: var(--ink); font-weight: 700; }
.signal-list li > span:last-child { min-width: 0; }
.sig-label { color: var(--ink); overflow-wrap: anywhere; }
.sig-detail { color: var(--ink-3); font-size: 13px; overflow-wrap: anywhere; }

.fc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 14px;
}
.mini-btn {
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.mini-btn.primary { background: var(--ink); color: var(--paper); }
@media (hover: hover) {
  .mini-btn:hover { background: var(--press); }
  .mini-btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
}
.mini-btn:active { background: var(--press); }
.mini-btn.primary:active { background: var(--ink-2); border-color: var(--ink-2); }
.mini-btn:disabled { opacity: 0.55; cursor: progress; }
.removed-note { font-size: 13px; color: var(--accent); }

/* ----------------------------------------------------------------- facts */

.facts { margin-top: 88px; }
.facts ol {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  border-top: 2px solid var(--ink);
}
.facts li { padding-top: 16px; }
.num { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.facts h2 { margin-top: 10px; font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; }
.facts p { margin-top: 6px; font-size: 0.9375rem; color: var(--ink-2); }

/* ----------------------------------------------------- limit + questions */

.limit, .faq { margin-top: 72px; }

.limit h2, .faq h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.limit p {
  margin-top: 18px;
  max-width: 36em;
  font-size: 1.125rem;
  text-wrap: pretty;
}

.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding-block: 8px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: 0 0 auto;
  font-family: var(--mono);
  font-weight: 400;
  color: var(--ink-3);
}
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 18px; max-width: 38em; color: var(--ink-2); }

/* ---------------------------------------------------------------- footer */

.foot {
  margin-top: 88px;
  padding-top: 28px;
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
  /* a rule the width of the text column, not the padded box */
  background: linear-gradient(var(--line), var(--line)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat;
  font-size: 13px;
  color: var(--ink-3);
}
.foot p + p { margin-top: 6px; }

/* ---------------------------------------------------------------- motion */

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.hero > * { animation: rise 0.5s var(--ease) both; }
.hero > .lede { animation-delay: 60ms; }
.hero > .dropzone { animation-delay: 120ms; }
.hero > .results { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- narrow */

@media (max-width: 640px) {
  :root { --gutter: 16px; }

  /* the tool sits higher: headline, one sentence, then the button */
  .bar { padding-block: 16px; }
  .hero { padding-top: clamp(20px, 5vh, 48px); }
  .lede { margin-top: 16px; font-size: 1.0625rem; }
  .dropzone { margin-top: 24px; padding: 28px 16px; }

  /* nothing on a phone smaller than 12px */
  .dz-sub { font-size: 13px; }
  .fc-meta { font-size: 12.5px; }
  .sig-kind { font-size: 12px; flex-basis: auto; }
  .sig-detail { font-size: 13.5px; }

  /* result cards: stacked rows, full-width thumb-sized buttons */
  .file-card { padding: 14px 14px 16px; }
  .fc-status { margin-left: 0; }
  .signal-list li { flex-direction: column; gap: 2px; }
  .fc-actions { flex-direction: column; align-items: stretch; }
  .mini-btn { min-height: 48px; font-size: 15px; }

  .facts { margin-top: 64px; }
  .facts ol { grid-template-columns: 1fr; gap: 0; }
  .facts li + li { border-top: 1px solid var(--line); margin-top: 18px; }
  .limit, .faq { margin-top: 56px; }
  .limit p { font-size: 1.0625rem; }
  .foot { margin-top: 64px; }
}

@media (max-width: 359px) {
  .bar-note { display: none; }
}

/* Phones held sideways (short and wide): headline left, button right, so
   the tool is still on the first screen. Results span both columns. */
@media (max-height: 500px) and (min-width: 560px) {
  .bar { padding-block: 10px; }
  .hero {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    column-gap: 28px;
    align-items: center;
    padding-top: 8px;
  }
  .hero h1 { grid-column: 1; font-size: clamp(1.75rem, 5vw, 2.75rem); }
  .hero .lede { grid-column: 1; margin-top: 12px; font-size: 0.9375rem; }
  .hero .dropzone { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; padding: 22px 16px; }
  .hero .results { grid-column: 1 / -1; }
}
