/* Tell website. Style: achromatic ledger (no colour in the chrome; ink and greys; colour only on the
   evidence: the heat maps on the photo, the leading answer in the split, and the status pill).
   Ground: newsprint stone instead of the default off-white.
   Grid (desktop, >= 1100px): 12 columns, one 16px gutter. The post and the test cases take 5 columns,
   the finding takes 7: 5 + 7 = 12, so both stacks land on the canvas edges. */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #f3f2ef;          /* newsprint stone, low chroma */
  --surface: #ffffff;
  --raised: #eeedea;
  --border: #e4e3df;
  --rule: #efeeeb;
  --control: #cfcdc8;
  --text: #0a0a0a;
  --muted: #5e5e5e;
  --faint: #6b6b6b;
  --primary: #141414;
  --primary-ink: #ffffff;
  --secondary: #e5e5e5;
  --positive: #2e7d32;
  --negative: #c4242a;
  --warning: #92400e;
  --hue: #1d5fbf;             /* the one chart hue: the leading answer in the split */
  --grey-1: #8a8a8a;
  --grey-2: #c9c7c2;
  --trace: #f0900c;           /* edit traces on the photo (amber reads on skies, skin and walls) */
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fff3d6; --pill-warning-ink: #7a3407;
  --pill-neutral-bg: #eeeeee; --pill-neutral-ink: #3d3d3d;

  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-title: 24px; --fs-verdict: 30px; --fs-section: 16px; --fs-body: 14px; --fs-small: 12px;
  --radius-card: 8px; --radius-control: 6px;
  --gap: 16px; --pad: 32px; --card-pad: 24px;
  --control-height: 40px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--text); font: 400 var(--fs-body)/20px var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; border-radius: 4px; }
.num, table { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; gap: 28px; max-width: 1384px; margin: 0 auto; padding: 18px var(--pad) 0; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.mark { width: 24px; height: 24px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; }
.mark circle { fill: var(--trace); stroke: none; }
.name { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.links { display: flex; gap: 22px; }
.links a { color: var(--muted); text-decoration: none; transition: color .15s ease; }
.links a:hover { color: var(--text); }
.status { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey-1); }
.status.is-ready .dot { background: var(--positive); }
.status.is-error .dot { background: var(--negative); }
.status.is-loading .dot { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- canvas and title ---------- */
.canvas { max-width: 1384px; margin: 0 auto; padding: 28px var(--pad) 0; }
.title-row { margin-bottom: 20px; }
.title-row h1 { font-size: var(--fs-title); line-height: 30px; font-weight: 650; letter-spacing: -0.015em; }
.title-row .sub { margin-top: 6px; color: var(--muted); max-width: 78ch; font-size: 15px; line-height: 22px; }

/* ---------- the working grid ---------- */
.work { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.post { grid-column: 1 / span 5; grid-row: 1; }
.finding { grid-column: 6 / span 7; grid-row: 1 / span 2; }
.kit { grid-column: 1 / span 5; grid-row: 2; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad); min-width: 0; }
.panel > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel h2 { font-size: var(--fs-section); line-height: 22px; font-weight: 600; }
.meta { color: var(--faint); font-size: var(--fs-small); }

/* ---------- the post ---------- */
.drop { position: relative; display: grid; place-items: center; min-height: 240px; border: 1px dashed var(--control); border-radius: var(--radius-card); background: var(--ground); cursor: pointer; overflow: hidden; transition: border-color .15s ease, background-color .15s ease; }
.drop:hover, .drop.is-over { border-color: var(--text); background: var(--raised); }
.drop:focus-within { outline: 2px solid var(--hue); outline-offset: 2px; }
.drop.has-image { border-style: solid; border-color: var(--border); background: var(--raised); }
.drop img { max-height: 240px; width: auto; object-fit: contain; }
.drop-empty { display: grid; justify-items: center; gap: 6px; padding: 24px; text-align: center; color: var(--muted); }
.drop-empty svg { width: 24px; height: 24px; fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.drop-empty strong { color: var(--text); font-weight: 550; font-size: 15px; }
.file-meta { margin-top: 8px; color: var(--faint); font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.field-label { display: block; margin: 20px 0 8px; font-weight: 550; }
textarea { display: block; width: 100%; min-height: 64px; resize: vertical; padding: 10px 12px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); line-height: 21px; font-size: 15px; transition: border-color .15s ease; }
textarea:hover { border-color: var(--grey-1); }
textarea:focus { outline: 1px solid var(--text); outline-offset: 0; border-color: var(--text); }
textarea::placeholder { color: #9a9894; }
.field-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; color: var(--faint); font-size: var(--fs-small); }
.form-error { margin-top: 12px; padding: 8px 12px; border-radius: var(--radius-control); background: var(--pill-negative-bg); color: var(--pill-negative-ink); }

.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; height: var(--control-height); padding: 0 18px; border: 0; border-radius: var(--radius-control); font-weight: 550; cursor: pointer; transition: background-color .15s ease, transform .12s ease, opacity .15s ease; }
.primary { width: 100%; margin-top: 16px; height: 44px; background: var(--primary); color: var(--primary-ink); font-size: 15px; }
.primary:hover { background: #2e2e2e; }
.secondary { background: var(--secondary); color: var(--text); }
.secondary:hover { background: #d9d9d9; }
.primary:active, .secondary:active { transform: scale(.98); }
.primary:disabled, .secondary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.primary.is-busy { opacity: .7; cursor: progress; }
.link-btn { padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }

.local-note { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 19px; }

/* ---------- the finding ---------- */
.verdict-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.verdict { font-size: var(--fs-verdict); line-height: 36px; font-weight: 650; letter-spacing: -0.02em; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.pill.is-authentic { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.is-manipulated { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.is-false_connection { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.verdict-sub { margin-top: 6px; color: var(--muted); font-size: 15px; line-height: 22px; }
.classes { display: grid; gap: 6px; margin-top: 14px; }
.classes div { display: grid; grid-template-columns: 6.5em 1fr; gap: 12px; }
.classes dt { font-weight: 600; }
.classes dd { color: var(--muted); }

.split { margin-top: 16px; }
.split-label { margin-bottom: 6px; color: var(--muted); font-size: 13px; line-height: 18px; }
.split.is-muted .strip span.is-top, .split.is-muted .legend li.is-top i { background: var(--muted); }
.dl { height: 8px; margin-top: 16px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.dl span { display: block; height: 100%; width: 0; background: var(--text); transition: width .2s linear; }
.strip { display: flex; gap: 2px; height: 12px; border-radius: 3px; overflow: hidden; background: var(--rule); }
.strip span { min-width: 3px; background: var(--grey-2); transition: flex-grow .5s var(--ease-out); }
.strip span.is-top { background: var(--hue); }
.strip span.is-second { background: var(--grey-1); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend li.is-top { color: var(--text); }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--grey-2); }
.legend li.is-top i { background: var(--hue); }
.legend li.is-second i { background: var(--grey-1); }
.legend b { font-weight: 600; color: var(--text); }
.next { margin-top: 16px; font-size: 15px; line-height: 22px; max-width: 70ch; }
.notes { display: grid; gap: 8px; margin-top: 12px; }
.notes li { padding: 9px 12px; border-radius: var(--radius-control); background: var(--pill-warning-bg); color: var(--pill-warning-ink); line-height: 20px; }
.verdict-block.is-loading .verdict, .verdict-block.is-loading .verdict-sub { color: var(--faint); }

.fitcheck { margin-top: 20px; padding: 14px 16px; border-radius: var(--radius-card); background: var(--raised); }
.fit-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.fit-head h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
.fit-text { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 20px; max-width: 75ch; }
.fitcheck .dl { margin-top: 10px; }
#fit-enable { margin-top: 12px; }

/* evidence board: the photo with the maps drawn on it */
.board { margin-top: 24px; }
.board-tabs { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.board-tabs [role="tab"] { position: relative; height: 40px; padding: 0; border: 0; background: none; color: var(--muted); font-weight: 500; cursor: pointer; transition: color .15s ease; }
.board-tabs [role="tab"]:hover { color: var(--text); }
.board-tabs [role="tab"][aria-selected="true"] { color: var(--text); }
.board-tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: -4px; right: -4px; bottom: -1px; height: 2px; background: var(--text); }
.strength { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; color: var(--faint); font-size: var(--fs-small); }
.strength input { width: 120px; accent-color: var(--text); }
.stage { position: relative; display: grid; place-items: center; min-height: 300px; margin-top: 12px; border-radius: var(--radius-control); background: var(--raised); overflow: hidden; }
.stage canvas { max-width: 100%; height: auto; }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: var(--faint); text-align: center; }
.map-help { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 19px; }

.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 28px; }
.sub-panel h3, .origin h3 { font-size: 15px; line-height: 22px; font-weight: 600; margin-bottom: 12px; }
.bars { display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 11.5em minmax(0, 1fr) 36px; align-items: center; gap: 12px; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.track span { display: block; height: 100%; background: var(--text); transition: width .5s var(--ease-out); }
.val { text-align: right; color: var(--muted); }
.bars li.is-empty .val { color: var(--faint); }
.hint { margin-top: 12px; color: var(--faint); font-size: var(--fs-small); line-height: 17px; }
.facts { display: grid; }
.facts li { padding: 9px 0; border-top: 1px solid var(--rule); line-height: 20px; }
.facts li:first-child { border-top: 0; padding-top: 0; }
.facts li.is-alert { color: var(--pill-negative-ink); font-weight: 550; }
.facts .fact-empty { color: var(--muted); }
.facts a { display: inline-block; margin-top: 4px; font-weight: 550; text-underline-offset: 3px; }

.origin { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--rule); }
.origin > p { color: var(--muted); }
.origin-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; margin-top: 14px; }
.ext { display: inline-flex; align-items: center; gap: 4px; font-weight: 550; text-decoration: none; }
.ext::after { content: ""; width: 12px; height: 12px; background: currentColor; -webkit-mask: var(--arrow) center / 12px no-repeat; mask: var(--arrow) center / 12px no-repeat; }
.ext:hover { text-decoration: underline; text-underline-offset: 3px; }
:root { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4 3h5v5M9 3 3 9' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.copy-msg { margin-top: 8px; color: var(--faint); font-size: var(--fs-small); min-height: 17px; }

/* ---------- test kit ---------- */
.kit-sub { color: var(--muted); margin: -6px 0 14px; }
.kit-list { display: grid; }
.kit-list li + li { border-top: 1px solid var(--rule); }
.case { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 14px; width: 100%; padding: 10px 6px; margin: 0 -6px; border: 0; border-radius: var(--radius-control); background: none; text-align: left; cursor: pointer; transition: background-color .15s ease; }
.case:hover { background: var(--raised); }
.case:active { transform: scale(.995); }
.case img { width: 52px; height: 52px; object-fit: cover; border-radius: 4px; background: var(--raised); }
.case-text { display: grid; gap: 2px; min-width: 0; }
.case-cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-truth { color: var(--faint); font-size: 13px; }
.case.is-current { background: var(--raised); }

/* ---------- about ---------- */
.about { margin-top: 72px; }
.about > h2 { font-size: 20px; line-height: 28px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 18px; }
.about h3 { font-size: 15px; line-height: 22px; font-weight: 600; margin-bottom: 6px; }
.about p { font-size: 15px; line-height: 24px; color: var(--text); max-width: 68ch; }
.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.acc-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 40px; align-items: start; }
.acc-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); border-spacing: 0; }
.acc-table th, .acc-table td { padding: 14px 20px; text-align: left; vertical-align: top; border-top: 1px solid var(--rule); }
.acc-table thead th { border-top: 0; color: var(--faint); font-size: var(--fs-small); font-weight: 500; padding-top: 12px; padding-bottom: 10px; }
.acc-table tbody th { font-weight: 550; }
.acc-table tbody th span { display: block; margin-top: 2px; color: var(--faint); font-weight: 400; font-size: 13px; }
.acc-table td { font-size: 18px; font-weight: 600; white-space: nowrap; }
.acc-table .r { text-align: right; }
.acc-notes { display: grid; gap: 14px; }
.privacy p { max-width: 80ch; }

.foot { max-width: 1384px; margin: 72px auto 0; padding: 28px var(--pad) 40px; border-top: 1px solid var(--border); color: var(--muted); display: grid; gap: 8px; }
.foot strong { color: var(--text); }
.foot .credits { font-size: var(--fs-small); line-height: 18px; max-width: 120ch; }

/* ---------- tablet: one column, the finding right after the post ---------- */
@media (max-width: 1099px) {
  .post, .finding, .kit { grid-column: 1 / -1; grid-row: auto; }
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
  .acc-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- phone ---------- */
@media (max-width: 640px) {
  :root { --pad: 16px; --card-pad: 16px; }
  .bar { padding-top: 14px; gap: 12px; }
  .links { display: none; }
  .status { font-size: 12px; }
  .canvas { padding-top: 18px; }
  .title-row h1 { font-size: 21px; line-height: 27px; }
  .title-row .sub { font-size: 14px; line-height: 21px; }
  .drop { min-height: 180px; }
  .verdict { font-size: 26px; line-height: 32px; }
  .evidence-grid { grid-template-columns: 1fr; gap: 24px; }
  .stage { min-height: 200px; }
  .strength input { width: 90px; }
  .board-tabs { gap: 4px 16px; }
  .about { margin-top: 48px; }
  .acc-table th, .acc-table td { padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
