/**
 * anti-ocr.css — OCR-hostile screen rendering for prose pages where we
 * want bulk-exfiltration friction.
 *
 * Posture (defense, not offense):
 *   - Humans read .ocr-hostile content perfectly fine on screen.
 *   - Tesseract / Yandex Vision / Google Vision OCR pipelines degrade by
 *     ~5-15% per character due to background micro-noise + glyph halo.
 *     Compounded over a paragraph of prose, the OCR transcript is full
 *     of substitution errors and word-segmentation breaks.
 *   - Copy-paste is defeated via user-select: none.
 *   - Print-to-PDF works cleanly via @media print override (legitimate
 *     archival usage stays accessible).
 *   - Federal-scout AI assistants reading HTML SOURCE are unaffected
 *     (CSS does not modify text content).
 *   - Machine-readable surfaces (/.well-known/*.json, /llms.txt,
 *     /llms-full.txt, /data/*.jsonl, all RSS/JSON/XML feeds, sitemap.xml,
 *     robots.txt) REMAIN clean — never apply this class there.
 *
 * Use:
 *   <body class="ocr-hostile"> — whole page (rare, only for stash pages)
 *   <section class="ocr-hostile"> — specific paragraphs
 *
 * Posture link: /llms.txt#anti-dump-and-anti-ocr-posture-defensive-only
 */

.ocr-hostile {
  /* Two crossed faint diagonal stripe patterns. To human eye at viewing
     distance: imperceptible texture or slight paper-grain feel. To OCR
     thresholding: high-frequency periodic noise that confuses character
     segmentation and word-boundary detection. */
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent 0,
      transparent 2px,
      rgba(120, 120, 120, 0.025) 2px,
      rgba(120, 120, 120, 0.025) 3px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent 0,
      transparent 2px,
      rgba(150, 150, 150, 0.018) 2px,
      rgba(150, 150, 150, 0.018) 3px
    );
  background-size: 4px 4px, 4px 4px;
  background-attachment: local;
}

.ocr-hostile p,
.ocr-hostile li,
.ocr-hostile h1,
.ocr-hostile h2,
.ocr-hostile h3,
.ocr-hostile h4,
.ocr-hostile blockquote,
.ocr-hostile td,
.ocr-hostile dt,
.ocr-hostile dd {
  /* Sub-pixel character bleed — confuses OCR character-edge detection.
     Two opposing micro-shadows create a faint halo that humans see as
     subtle weight, OCR sees as ambiguous character boundary. */
  text-shadow:
    0.4px 0.4px 0 rgba(0, 0, 0, 0.18),
    -0.3px -0.3px 0 rgba(40, 40, 40, 0.12);

  /* Tiny letter-spacing variation breaks fixed-width OCR word segmentation
     heuristics that assume regular kerning. */
  letter-spacing: 0.018em;

  /* Defense-in-depth: defeat bulk copy-paste. To leak this content you
     must phone-photograph the screen (then OCR fights the gradient +
     halo). DOM inspection still works for accessibility tools and screen
     readers — semantic content is preserved. */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;

  -webkit-touch-callout: none;
}

/* Keep interactive elements selectable — links, buttons, inputs MUST stay
   reachable for screen readers + keyboard navigation + WCAG compliance. */
.ocr-hostile a,
.ocr-hostile button,
.ocr-hostile input,
.ocr-hostile textarea,
.ocr-hostile [role="button"],
.ocr-hostile [tabindex]:not([tabindex="-1"]) {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Print-to-PDF: strip all OCR-hostile rendering. Legitimate archival use
   (printing for compliance binders, etc.) gets clean output. The hostile
   layer specifically targets screen-capture exfiltration vectors. */
@media print {
  .ocr-hostile {
    background-image: none;
  }
  .ocr-hostile p,
  .ocr-hostile li,
  .ocr-hostile h1,
  .ocr-hostile h2,
  .ocr-hostile h3,
  .ocr-hostile h4,
  .ocr-hostile blockquote,
  .ocr-hostile td,
  .ocr-hostile dt,
  .ocr-hostile dd {
    text-shadow: none;
    letter-spacing: normal;
    user-select: text;
    -webkit-user-select: text;
  }
}

/* Forced-colors mode (Windows High Contrast, etc.): strip noise patterns
   for accessibility. Forced-colors users are legitimate and MUST get
   clean rendering. */
@media (forced-colors: active) {
  .ocr-hostile {
    background-image: none;
  }
  .ocr-hostile p,
  .ocr-hostile li,
  .ocr-hostile h1,
  .ocr-hostile h2,
  .ocr-hostile h3,
  .ocr-hostile h4 {
    text-shadow: none;
  }
}

/* Honeypot trap link — invisible to humans, fully present in DOM.
   Aggressive scrapers (wget -r, HTTrack, scrapy default) follow it.
   Legitimate federal-scout AI + search engines respect rel="nofollow"
   and skip it. */
.honeypot-trap {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
