/* aiwatermarking.org
 *
 * Hand-written, no build step, no webfonts, no external requests. Tokens are
 * CSS custom properties; the light palette is defined on bare :root so a page
 * always has a complete palette, and only the tokens that change are redefined
 * for dark. Dark is reachable two ways — the OS preference and an explicit
 * data-theme — and the explicit choice has to win in both directions, which is
 * why the media query is guarded against data-theme="light".
 *
 * Every class in here is used. check_site.py fails the build on a class that is
 * referenced in HTML but never defined; the reverse is caught by review.
 */

:root {
  --paper: #FCFCFD;
  --raise: #FFFFFF;
  --ink: #14161A;
  --muted: #5F6673;
  --rule: #E2E4EA;
  --accent: #1B4FD8;
  --accent-soft: #EEF2FE;
  --warn: #8A5300;
  --warn-soft: #FFF6E5;
  --good: #0B6B4F;
  --good-soft: #E8F6F0;
  --bad: #A32020;
  --bad-soft: #FDEDED;
  --shadow: 0 1px 2px rgba(20, 22, 26, .06), 0 8px 24px rgba(20, 22, 26, .05);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E0F13;
    --raise: #16181E;
    --ink: #EDEEF2;
    --muted: #9BA3B2;
    --rule: #272B34;
    --accent: #7EA6FF;
    --accent-soft: #171E2E;
    --warn: #E8B060;
    --warn-soft: #241C0C;
    --good: #5FD3AC;
    --good-soft: #0D211B;
    --bad: #F08A8A;
    --bad-soft: #251314;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

:root[data-theme="dark"] {
  --paper: #0E0F13;
  --raise: #16181E;
  --ink: #EDEEF2;
  --muted: #9BA3B2;
  --rule: #272B34;
  --accent: #7EA6FF;
  --accent-soft: #171E2E;
  --warn: #E8B060;
  --warn-soft: #241C0C;
  --good: #5FD3AC;
  --good-soft: #0D211B;
  --bad: #F08A8A;
  --bad-soft: #251314;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* ---------- top banner ---------- */

.topbanner {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--rule);
  padding: 8px 20px;
  text-align: center;
  font-size: 14px;
}
.topbanner-text { color: var(--ink); }
.topbanner a { font-weight: 600; }

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
  white-space: nowrap;
}
.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 14.5px;
  margin-right: auto;
}
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); font-weight: 600; }

.theme-toggle {
  width: 30px; height: 30px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--raise);
  cursor: pointer;
  padding: 0;
  flex: none;
}
.theme-toggle::after {
  content: "";
  display: block;
  width: 12px; height: 12px;
  margin: auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ink) 0 50%, transparent 50% 100%);
  border: 1.5px solid var(--ink);
}

/* ---------- layout ---------- */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 40px 20px 8px;
}
.wide { max-width: 1080px; }

h1 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  letter-spacing: -.025em;
  margin: 0 0 16px;
}
h2 {
  font-size: clamp(20px, 3vw, 25px);
  line-height: 1.25;
  letter-spacing: -.015em;
  margin: 44px 0 12px;
}
h3 { font-size: 18px; margin: 28px 0 8px; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 6px; }
strong { font-weight: 650; }

/* The answer-first paragraph. Every page opens with one: the direct answer in
 * two or three sentences, before any context. This is what gets quoted. */
.answer {
  font-size: 19px;
  line-height: 1.55;
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 16px;
  margin: 0 0 28px;
}

.lede { color: var(--muted); font-size: 18px; margin: -6px 0 26px; }

.note {
  background: var(--raise);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 20px 0;
  font-size: 15.5px;
}
.note-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.note-good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.note p:last-child { margin-bottom: 0; }
.note-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ---------- citations ---------- */

.cite {
  font-size: 12px;
  vertical-align: super;
  line-height: 0;
  text-decoration: none;
  padding: 0 1px;
  font-weight: 600;
}
.sources { margin-top: 48px; border-top: 1px solid var(--rule); padding-top: 8px; }
.src-list { font-size: 14.5px; color: var(--muted); }
.src-list li { margin-bottom: 10px; }
.src-meta { display: block; font-size: 13px; }
.src-primary {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  color: var(--good);
  background: var(--good-soft);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
}

.verified {
  margin: 40px 0 24px;
  font-size: 13.5px;
  color: var(--muted);
  border-top: 1px dashed var(--rule);
  padding-top: 12px;
}

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; margin: 20px 0; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14.5px;
  min-width: 720px;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}
th {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 2px solid var(--rule);
  white-space: nowrap;
}
tbody tr:hover { background: var(--raise); }

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.pill-live { background: var(--good-soft); color: var(--good); }
.pill-partial { background: var(--accent-soft); color: var(--accent); }
.pill-announced { background: var(--warn-soft); color: var(--warn); }
.pill-none { background: var(--bad-soft); color: var(--bad); }
.pill-unverified {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--rule);
}

/* ---------- cross promotion ---------- */

.promo {
  background: var(--raise);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 36px 0;
  box-shadow: var(--shadow);
}
.promo-kicker {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 4px;
}
.promo-title { font-size: 19px; margin: 0 0 6px; }
.promo-title a { text-decoration: none; }
.promo-title a:hover { text-decoration: underline; }
.promo-body { font-size: 15px; margin: 0 0 12px; color: var(--muted); }
.promo-foot { margin: 0; display: flex; align-items: center; gap: 12px; }
.promo-cta {
  display: inline-block;
  background: var(--accent);
  color: var(--paper);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  border-radius: 8px;
  padding: 7px 14px;
}
.promo-cta:hover { filter: brightness(1.08); }
.promo-medium { font-size: 13px; color: var(--muted); }

/* ---------- scanner ---------- */

.scan-box { margin: 24px 0; }
.scan-input {
  width: 100%;
  min-height: 190px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  padding: 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--raise);
  color: var(--ink);
  resize: vertical;
}
.scan-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.scan-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; align-items: center; }
.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  border-radius: 9px;
  padding: 9px 16px;
  border: 1px solid var(--rule);
  background: var(--raise);
  color: var(--ink);
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--paper); border-color: transparent; }
.btn:hover { filter: brightness(1.06); }
.scan-hint { font-size: 13.5px; color: var(--muted); }

.result { margin-top: 20px; }
.result-head {
  font-size: 18px;
  font-weight: 650;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
}
.result-clean { background: var(--good-soft); color: var(--good); }
.result-found { background: var(--warn-soft); color: var(--warn); }

.finding-list { list-style: none; padding: 0; font-size: 15px; }
.finding-list li {
  border: 1px solid var(--rule);
  border-radius: 9px;
  padding: 10px 13px;
  margin-bottom: 8px;
  background: var(--raise);
}
.finding-count { font-family: var(--mono); font-weight: 700; color: var(--accent); }
.finding-cp { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.vis {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 2;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 14px;
  background: var(--raise);
  max-height: 340px;
  overflow: auto;
}
.mark {
  background: var(--warn);
  color: var(--paper);
  border-radius: 3px;
  padding: 1px 3px;
  font-size: 11px;
  font-weight: 700;
}

.drop {
  border: 2px dashed var(--rule);
  border-radius: 12px;
  padding: 26px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  background: var(--raise);
}
.drop.over { border-color: var(--accent); color: var(--accent); }

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

.site-foot {
  border-top: 1px solid var(--rule);
  background: var(--raise);
  margin-top: 56px;
  padding: 36px 20px 44px;
}
.foot-apps, .foot-meta { max-width: 1080px; margin: 0 auto; }
.foot-apps h2 { font-size: 15px; margin: 0 0 14px; letter-spacing: 0; }
.foot-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.foot-list li { font-size: 14.5px; margin: 0; }
.foot-list a { font-weight: 650; text-decoration: none; }
.foot-list a:hover { text-decoration: underline; }
.foot-medium {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-left: 7px;
}
.foot-desc { display: block; color: var(--muted); font-size: 13.5px; }
.foot-meta { border-top: 1px solid var(--rule); padding-top: 18px; font-size: 14px; }
.foot-fine { color: var(--muted); font-size: 13px; max-width: var(--measure); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding-top: 28px; }
  .nav { gap: 13px; font-size: 13.5px; }
}

/* ---------- diagrams (inline SVG, theme-aware) ---------- */

.diagram {
  margin: 24px auto;
  max-width: 560px;
}
.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--sans);
}
.diagram figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}
.dg-card { fill: var(--raise); stroke: var(--rule); stroke-width: 1; }
.dg-ink { fill: var(--ink); }
.dg-muted { fill: var(--muted); }
.dg-accent { fill: var(--accent); }
.dg-good { fill: var(--good); }
.dg-bad { fill: var(--bad); }
.dg-warn { fill: var(--warn); }
.dg-line { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.dg-arrowhead { fill: var(--muted); }
.dg-rule-line { stroke: var(--rule); stroke-width: 1.5; }
.dg-bar { fill: var(--muted); opacity: .55; }
.dg-bar-ghost { fill: var(--muted); opacity: .18; }
.dg-bar-accent { fill: var(--accent); opacity: .85; }
.dg-curve-muted { fill: none; stroke: var(--muted); stroke-width: 2; }
.dg-curve-accent { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.dg-pixels { fill: var(--paper); stroke: var(--rule); stroke-width: 1; }
.dg-manifest { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }

/* ---------- news ---------- */

.news-list { list-style: none; padding: 0; margin: 24px 0 0; }
.news-list li { margin: 0 0 26px; padding: 0 0 22px; border-bottom: 1px solid var(--rule); }
.news-list li:last-child { border-bottom: 0; }
.news-list h3 { margin: 4px 0 6px; font-size: 19px; line-height: 1.3; }
.news-list h3 a { color: var(--ink); text-decoration: none; }
.news-list h3 a:hover { color: var(--accent); }
.news-list p { margin: 0; color: var(--muted); font-size: 15px; }
.news-date, .dateline { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.dateline { margin: -14px 0 22px; }
