:root {
    --paper:        #ede1c7;
    --paper-deep:   #d4c4a0;
    --paper-fold:   #c2b08a;
    --ink:          #1a1612;
    --ink-soft:     #3a342a;
    --ink-faint:    #6c5f4a;
    --stamp:        #a01f2e;
    --stamp-deep:   #6c1521;
    --stamp-blue:   #1d3866;
    --highlight:    #f3d666;
    --redact:       #1a1612;
    --top-secret:   #b8242e;
    --margin-rule:  #b89568;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    background: #1c1a17;
    color: var(--ink);
    font-family: 'Special Elite', 'Courier New', monospace;
    overflow-x: hidden;
    line-height: 1.55;
  }
  /* ───────── Paper texture ───────── */
  .paper {
    position: relative;
    background:
      radial-gradient(ellipse 800px 200px at 12% 8%, rgba(120, 90, 40, 0.08), transparent 70%),
      radial-gradient(ellipse 400px 600px at 92% 35%, rgba(80, 50, 20, 0.10), transparent 70%),
      radial-gradient(ellipse 1200px 400px at 50% 100%, rgba(40, 20, 10, 0.12), transparent 70%),
      linear-gradient(180deg, #ede1c7 0%, #e5d6b7 50%, #ddc9a4 100%);
    color: var(--ink);
  }
  /* Subtle paper-grain via SVG noise */
  .paper::before {
    content: '';
    position: absolute; inset: 0;
    pointer-events: none;
    opacity: 0.18;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.42  0 0 0 0 0.32  0 0 0 0 0.18  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  }
  /* Margin rule (typewriter-style left margin line) */
  .page {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    padding: 72px 76px 96px 110px;
  }
  .page::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 84px;
    width: 1px;
    background: var(--margin-rule);
    opacity: 0.45;
  }
  /* Punch holes on the left edge */
  .holes {
    position: absolute;
    top: 0; bottom: 0;
    left: 24px;
    width: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 40px 0;
  }
  .holes span {
    display: block;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #1c1a17;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
  }
  /* Coffee stain ring */
  .coffee {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(circle at center, transparent 56%, rgba(98, 60, 20, 0.18) 60%, rgba(98, 60, 20, 0.32) 67%, transparent 73%);
    filter: blur(0.5px);
    transform: rotate(-15deg);
  }
  /* ───────── Stamps ───────── */
  .stamp {
    font-family: 'Stardos Stencil', monospace;
    font-weight: 700;
    color: var(--stamp);
    border: 4px solid var(--stamp);
    padding: 6px 16px 4px;
    letter-spacing: 4px;
    display: inline-block;
    text-transform: uppercase;
    transform: rotate(-3deg);
    opacity: 0.86;
    box-shadow: inset 0 0 0 1px rgba(160, 31, 46, 0.4);
    background: rgba(237, 225, 199, 0.1);
    text-shadow: 1px 0 0 rgba(160, 31, 46, 0.3);
  }
  .stamp.big { font-size: 38px; padding: 12px 24px 10px; }
  .stamp.mid { font-size: 22px; }
  .stamp.small { font-size: 13px; padding: 4px 10px 2px; letter-spacing: 3px; border-width: 2px; }
  .stamp.blue { color: var(--stamp-blue); border-color: var(--stamp-blue); }
  .stamp.faded { opacity: 0.55; transform: rotate(-7deg); }
  .stamp.angled-right { transform: rotate(4deg); }
  /* Ink smudge effect */
  .stamp::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: inherit;
    opacity: 0.05;
    filter: blur(2px);
    pointer-events: none;
  }
  /* ───────── Cover / classification bar ───────── */
  .classification-bar {
    background: var(--top-secret);
    color: #f7e9c2;
    font-family: 'Stardos Stencil', monospace;
    text-align: center;
    padding: 6px 0 4px;
    font-size: 14px;
    letter-spacing: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.4);
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
  }
  /* ───────── Cover page ───────── */
  .cover {
    min-height: 100vh;
    display: flex; flex-direction: column;
    justify-content: center;
  }
  .agency-mark {
    text-align: center;
    margin-bottom: 36px;
  }
  .agency-mark .logo {
    width: 84px; height: 84px;
    margin: 0 auto 14px;
    border: 3px solid var(--ink);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 38px;
    font-weight: 700;
    position: relative;
  }
  .agency-mark .logo::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid var(--ink);
    border-radius: 50%;
  }
  .agency-mark h1 {
    font-family: 'Cinzel', serif;
    font-size: 26px;
    letter-spacing: 6px;
    font-weight: 700;
  }
  .agency-mark .tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 4px;
    color: var(--ink-soft);
    margin-top: 6px;
  }
  .cover-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 40px;
    margin: 48px 0 32px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
  }
  .cover-meta dt {
    color: var(--ink-faint);
    letter-spacing: 2px;
    font-size: 10px;
    margin-bottom: 2px;
  }
  .cover-meta dd {
    color: var(--ink);
    font-weight: 500;
    font-size: 13px;
  }
  .cover-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(48px, 7vw, 84px);
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
    margin: 40px 0 12px;
  }
  .cover-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    color: var(--ink-soft);
    letter-spacing: 2px;
    text-transform: uppercase;
  }
  .cover-stamps {
    position: absolute;
    right: 60px;
    top: 80px;
    display: flex; flex-direction: column;
    gap: 24px;
    align-items: flex-end;
  }
  /* ───────── Photo card ───────── */
  .photo-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    margin-top: 56px;
    padding-top: 32px;
    border-top: 2px solid var(--ink);
  }
  .photo-frame {
    position: relative;
    aspect-ratio: 3/4;
    background: #2a2520;
    border: 8px solid #f3e3bf;
    box-shadow:
      0 12px 24px rgba(0,0,0,0.35),
      0 2px 4px rgba(0,0,0,0.5),
      inset 0 0 0 1px rgba(255,255,255,0.2);
    transform: rotate(-1.2deg) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transform-style: preserve-3d;
    transition: transform 140ms ease-out;
    will-change: transform;
    overflow: hidden;
  }
  .photo-frame-wrap { perspective: 1000px; }
  .photo-frame::before {
    /* simulated grainy b&w portrait */
    content: '';
    position: absolute; inset: 0;
    background:
      radial-gradient(ellipse 60% 55% at 50% 38%, rgba(220,210,180,0.85), rgba(220,210,180,0.55) 40%, transparent 60%),
      radial-gradient(ellipse 36% 14% at 50% 78%, rgba(40,32,22,0.8), transparent 70%),
      linear-gradient(180deg, #5a4f42 0%, #34291e 60%, #1f1a14 100%);
    filter: contrast(1.1) brightness(0.92);
  }
  .photo-frame::after {
    /* targeting crosshair */
    content: '';
    position: absolute; inset: 0;
    background:
      linear-gradient(transparent calc(50% - 0.5px), rgba(255,210,90,0.65) calc(50% - 0.5px), rgba(255,210,90,0.65) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
      linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(255,210,90,0.65) calc(50% - 0.5px), rgba(255,210,90,0.65) calc(50% + 0.5px), transparent calc(50% + 0.5px));
    pointer-events: none;
  }
  .photo-frame .reticle {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 64px; height: 64px;
    border: 1.5px solid rgba(255,210,90,0.85);
    border-radius: 50%;
    box-shadow: 0 0 0 14px rgba(255,210,90,0.10);
  }
  .photo-frame .corner {
    position: absolute;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,210,90,0.85);
  }
  .photo-frame .corner.tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
  .photo-frame .corner.tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
  .photo-frame .corner.bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
  .photo-frame .corner.br { bottom: 12px; right: 12px; border-left: none; border-top: none; }
  .photo-cap {
    position: absolute;
    bottom: -28px; left: 8px; right: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--ink-faint);
    letter-spacing: 1.5px;
    text-align: center;
  }
  .subject-block dl {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 4px 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13.5px;
  }
  .subject-block dt {
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 11px;
    padding-top: 2px;
  }
  .subject-block dd { color: var(--ink); }

  /* ───────── Mask gallery (evidence strip) ───────── */
  .mask-strip { margin-top: 40px; }
  .mask-strip-head {
    display: flex; align-items: baseline; justify-content: space-between;
    border-bottom: 1px solid var(--ink-faint, #6f5e3f);
    padding-bottom: 6px; margin-bottom: 8px;
  }
  .mask-strip-title { font-family: 'Stardos Stencil', monospace; font-size: 12px; letter-spacing: 3px; color: var(--stamp, #b22222); }
  .mask-strip-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 1.5px; color: var(--ink-faint, #6f5e3f); }
  .mask-strip-rail { display: flex; gap: 18px; overflow-x: auto; padding: 16px 2px 18px; scrollbar-width: thin; }
  .mask-link { text-decoration: none; flex: 0 0 auto; }
  .mask-card {
    position: relative; flex: 0 0 auto;
    width: 96px; height: 120px;
    background: #2a2520;
    border: 4px solid #f3e3bf;
    box-shadow: 0 6px 14px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.15);
    transform: rotate(var(--rot, 0deg));
    transition: transform 140ms ease, box-shadow 140ms ease;
    overflow: hidden;
  }
  .mask-link:hover .mask-card { transform: rotate(0deg) translateY(-4px) scale(1.05); box-shadow: 0 12px 22px rgba(0,0,0,0.5); z-index: 3; }
  .mask-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: sepia(0.35) contrast(1.05) brightness(0.96); }
  .mask-card.broken .mask-photo { display: none; }
  .mask-grain { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255,240,200,0.06), rgba(20,16,10,0.30)); mix-blend-mode: multiply; }
  .mask-tape {
    position: absolute; top: -9px; left: 50%; transform: translateX(-50%) rotate(-2deg);
    z-index: 4; background: #0d0d0d; color: #cdbf9c;
    font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: 0.5px;
    padding: 2px 6px; max-width: 116px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    box-shadow: 0 1px 3px rgba(0,0,0,0.6);
  }
  .mask-glyph { display: inline-block; min-width: 14px; margin-right: 4px; color: var(--hi, #f3d666); font-weight: 600; }
  .mask-card.uncaptured {
    background: transparent; border: 2px dashed #6b5a3d; box-shadow: none;
    display: flex; align-items: center; justify-content: center; opacity: 0.5;
  }
  .mask-missing { font-family: 'IBM Plex Mono', monospace; font-size: 8px; letter-spacing: 1px; color: #6b5a3d; text-align: center; line-height: 1.4; }

  /* ───────── Identity verdict (unverified / possible namesake) ───────── */
  .verdict-unverified { margin-top: 28px; padding: 16px 0 0; border-top: 1px dashed var(--stamp, #b22222); }
  .verdict-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
  .verdict-stamp {
    font-family: 'Stardos Stencil', monospace; font-size: 13px; letter-spacing: 3px; color: var(--stamp, #b22222);
    border: 2px solid var(--stamp, #b22222); padding: 4px 10px 2px; transform: rotate(-3deg);
    background: rgba(176, 34, 34, 0.06);
  }
  .verdict-note { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 1px; color: var(--ink-faint, #6f5e3f); max-width: 640px; line-height: 1.5; }
  .verdict-note strong { color: var(--stamp, #b22222); font-weight: 600; }
  .verdict-label { font-family: 'Stardos Stencil', monospace; font-size: 11px; letter-spacing: 3px; margin: 0 0 10px; }
  .verdict-label.confirmed-label { color: #1f7a3a; }
  .verdict-unverified .card { opacity: 0.72; filter: saturate(0.7); border-style: dashed; }
  @media (prefers-reduced-motion: no-preference) {
    .verdict-unverified.in-view .verdict-stamp { animation: verdict-slam 520ms cubic-bezier(0.2, 1.6, 0.4, 1) both; }
    .verdict-unverified.in-view .card { animation: verdict-rise 460ms cubic-bezier(0.2, 1.4, 0.4, 1) both; }
    .verdict-unverified.in-view .card:nth-child(2) { animation-delay: 70ms; }
    .verdict-unverified.in-view .card:nth-child(3) { animation-delay: 140ms; }
    @keyframes verdict-slam { 0% { transform: rotate(-3deg) scale(2.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: rotate(-3deg) scale(1); opacity: 1; } }
    @keyframes verdict-rise { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  }
  @media (max-width: 640px) {
    .mask-card { width: 78px; height: 98px; }
    .mask-strip-rail { gap: 12px; }
  }

  /* ───────── Section headers ───────── */
  .section { padding-top: 64px; }
  .section-head {
    display: flex; align-items: center; gap: 16px;
    border-top: 2px solid var(--ink);
    border-bottom: 1px dashed var(--ink-faint);
    padding: 10px 0 8px;
    margin-bottom: 28px;
  }
  .section-head .num {
    font-family: 'Stardos Stencil', monospace;
    background: var(--ink);
    color: var(--paper);
    padding: 4px 10px;
    font-size: 16px;
    letter-spacing: 2px;
  }
  .section-head h2 {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    letter-spacing: 4px;
    text-transform: uppercase;
    flex: 1;
  }
  .section-head .meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 2px;
  }

  /* ───────── Grids ───────── */
  .grid { display: grid; gap: 14px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }

  .card {
    background: rgba(243, 227, 191, 0.55);
    border: 1px solid var(--ink-faint);
    padding: 12px 14px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12.5px;
    position: relative;
  }
  .card .k {
    color: var(--ink-faint);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 9.5px;
    margin-bottom: 4px;
  }
  .card .v { color: var(--ink); font-size: 13px; font-weight: 500; word-break: break-word; }
  .card .src {
    margin-top: 8px;
    font-size: 9px;
    color: var(--ink-faint);
    letter-spacing: 1px;
    text-transform: uppercase;
    border-top: 1px dotted var(--ink-faint);
    padding-top: 4px;
  }
  .card .conf {
    position: absolute;
    top: 8px; right: 10px;
    font-size: 9px;
    color: var(--ink-faint);
    letter-spacing: 1px;
  }

  /* Sensitive (redacted) bar */
  .redact {
    background: var(--redact);
    color: var(--redact);
    padding: 2px 8px;
    user-select: none;
    cursor: pointer;
    border-radius: 1px;
    position: relative;
    transition: all 0.2s;
  }
  .redact::after {
    content: 'CLICK TO REVEAL · LOGGED';
    position: absolute;
    inset: 0;
    color: rgba(255, 210, 90, 0.7);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 8.5px;
    letter-spacing: 1.5px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
  }
  .redact.revealed {
    background: rgba(245, 215, 110, 0.45);
    color: var(--ink);
    user-select: text;
  }
  .redact.revealed::after { content: ''; }

  /* ───────── Missing-data redaction (gov-doc heavy bar) ─────────
     Distinct from .redact (which is sensitive-public + click-to-reveal):
     this one means "we have no record at all yet" — pure heavy black bar,
     not clickable, no overlay text. Mimics literal FOIA-style redaction. */
  .nodata {
    display: inline-block;
    background:
      linear-gradient(180deg, #050505 0%, #1a1612 50%, #050505 100%);
    height: 1.05em;
    vertical-align: -2px;
    min-width: 80px;
    border-radius: 1px;
    box-shadow:
      inset 0 0 0 1px rgba(0,0,0,0.9),
      0 1px 0 rgba(0,0,0,0.5),
      0 -1px 0 rgba(255,255,255,0.05);
    position: relative;
    /* slight ink-bleed unevenness on the edges */
    filter: contrast(1.05);
  }
  .nodata::before {
    /* faint asymmetric edge to mimic permanent-marker bleed */
    content: '';
    position: absolute;
    top: -1px; bottom: -1px;
    left: -1px; right: -2px;
    background: inherit;
    opacity: 0.5;
    filter: blur(0.6px);
    z-index: -1;
  }
  .nodata.w-xs { min-width: 50px; }
  .nodata.w-sm { min-width: 90px; }
  .nodata.w-md { min-width: 160px; }
  .nodata.w-lg { min-width: 240px; }
  .nodata.w-xl { min-width: 340px; }
  .nodata.w-full { width: 100%; min-width: 0; }
  /* Tiny grey footer note explaining WHY a bar is there. */
  .nodata-note {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    color: var(--ink-faint);
    letter-spacing: 1.2px;
    margin-top: 4px;
    text-transform: uppercase;
    opacity: 0.7;
  }

  .sensitive-banner {
    background: repeating-linear-gradient(45deg, rgba(160,31,46,0.12), rgba(160,31,46,0.12) 10px, transparent 10px, transparent 20px);
    border: 1.5px dashed var(--stamp);
    padding: 8px 14px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--stamp);
    margin: 18px 0;
    text-transform: uppercase;
  }

  /* ───────── Lists ───────── */
  .entries { display: flex; flex-direction: column; gap: 6px; font-family: 'IBM Plex Mono', monospace; font-size: 13px; }
  .entries .row {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 16px;
    padding: 6px 0;
    border-bottom: 1px dotted rgba(0,0,0,0.18);
  }
  .entries .row .y { color: var(--ink-faint); }
  .entries .row .t { color: var(--ink); }
  .entries .row .m { color: var(--ink-faint); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }

  /* ───────── Quote / narrative ───────── */
  .narrative {
    background: rgba(247, 233, 194, 0.6);
    border-left: 4px solid var(--stamp);
    padding: 22px 24px;
    font-family: 'Special Elite', monospace;
    font-size: 15px;
    line-height: 1.85;
    position: relative;
    font-style: normal;
  }
  .narrative::before {
    content: 'SUBJECT PROFILE — PSYCHOLOGICAL';
    position: absolute;
    top: -12px; left: 16px;
    background: var(--paper);
    padding: 0 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--stamp);
    letter-spacing: 2px;
  }
  .narrative-meta {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-top: 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
  }
  .chip {
    background: var(--ink);
    color: var(--paper);
    padding: 3px 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 10px;
  }
  .chip.gold { background: var(--highlight); color: var(--ink); }
  .chip.outline { background: transparent; color: var(--ink); border: 1px solid var(--ink); }

  /* ───────── Footer / appendix ───────── */
  .appendix { font-family: 'IBM Plex Mono', monospace; font-size: 11px; }
  .appendix table { width: 100%; border-collapse: collapse; }
  .appendix td, .appendix th { padding: 6px 8px; border-bottom: 1px dotted rgba(0,0,0,0.2); text-align: left; }
  .appendix th { font-size: 10px; letter-spacing: 1.5px; color: var(--ink-faint); }

  /* ───────── Reticle background ornament ───────── */
  .crosshair-bg {
    position: absolute;
    top: 200px;
    right: -120px;
    width: 360px; height: 360px;
    pointer-events: none;
    opacity: 0.07;
    background:
      radial-gradient(circle at center, transparent 49%, rgba(160,31,46,1) 49%, rgba(160,31,46,1) 50%, transparent 50%),
      radial-gradient(circle at center, transparent 39%, rgba(160,31,46,1) 39%, rgba(160,31,46,1) 40%, transparent 40%),
      radial-gradient(circle at center, transparent 29%, rgba(160,31,46,1) 29%, rgba(160,31,46,1) 30%, transparent 30%),
      linear-gradient(0deg, transparent calc(50% - 1px), rgba(160,31,46,1) calc(50% - 1px), rgba(160,31,46,1) calc(50% + 1px), transparent calc(50% + 1px)),
      linear-gradient(90deg, transparent calc(50% - 1px), rgba(160,31,46,1) calc(50% - 1px), rgba(160,31,46,1) calc(50% + 1px), transparent calc(50% + 1px));
  }

  /* Bottom classification bar */
  .footer-bar {
    background: var(--top-secret);
    color: #f7e9c2;
    font-family: 'Stardos Stencil', monospace;
    text-align: center;
    padding: 4px 0;
    font-size: 12px;
    letter-spacing: 8px;
    margin-top: 48px;
  }

  /* ───────── Gate + Modal (AUTHORIZE REVEAL) ───────── */
  .gate {
    position: relative;
    margin: 56px 0;
    padding: 48px 40px;
    border: 3px solid var(--stamp);
    background:
      repeating-linear-gradient(
        45deg,
        rgba(160, 31, 46, 0.07),
        rgba(160, 31, 46, 0.07) 12px,
        rgba(160, 31, 46, 0.0) 12px,
        rgba(160, 31, 46, 0.0) 24px
      );
    text-align: center;
  }
  .gate::before, .gate::after {
    content: '';
    position: absolute;
    left: 8px; right: 8px;
    height: 6px;
    background: repeating-linear-gradient(90deg, var(--stamp), var(--stamp) 12px, transparent 12px, transparent 24px);
  }
  .gate::before { top: -3px; }
  .gate::after { bottom: -3px; }
  .gate .gate-stamp {
    display: inline-block;
    font-family: 'Stardos Stencil', monospace;
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--stamp);
    border: 2px solid var(--stamp);
    padding: 4px 12px 3px;
    margin-bottom: 20px;
    transform: rotate(-1deg);
  }
  .gate h3 {
    font-family: 'Stardos Stencil', monospace;
    font-size: clamp(34px, 5vw, 52px);
    letter-spacing: 8px;
    color: var(--ink);
    margin-bottom: 16px;
    line-height: 1;
  }
  .gate p {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12.5px;
    color: var(--ink-soft);
    letter-spacing: 0.6px;
    line-height: 1.7;
    max-width: 640px;
    margin: 0 auto 28px;
  }
  .gate .req {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    letter-spacing: 1.6px;
    color: var(--ink-faint);
    margin-bottom: 24px;
    text-transform: uppercase;
  }
  .gate .req span::before { content: '▸ '; color: var(--stamp); }
  .gate-btn {
    display: inline-block;
    background: var(--ink);
    color: var(--paper);
    border: none;
    padding: 16px 32px 14px;
    font-family: 'Stardos Stencil', monospace;
    font-size: 16px;
    letter-spacing: 4px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow:
      0 4px 0 var(--stamp-deep),
      0 6px 12px rgba(0,0,0,0.3);
  }
  .gate-btn:hover {
    background: var(--stamp);
    transform: translateY(-1px);
    box-shadow:
      0 5px 0 var(--stamp-deep),
      0 8px 16px rgba(0,0,0,0.35);
  }
  .gate-btn:active {
    transform: translateY(3px);
    box-shadow:
      0 1px 0 var(--stamp-deep),
      0 2px 6px rgba(0,0,0,0.4);
  }

  /* Modal */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 6, 4, 0.86);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
  }
  .modal-overlay.show { display: flex; }
  .modal {
    background: var(--paper);
    border: 3px solid var(--stamp);
    max-width: 560px;
    width: 100%;
    padding: 36px 36px 28px;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  }
  .modal::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid var(--stamp);
    pointer-events: none;
  }
  .modal-classification {
    text-align: center;
    background: var(--top-secret);
    color: #f7e9c2;
    font-family: 'Stardos Stencil', monospace;
    margin: -36px -36px 24px;
    padding: 6px 0 4px;
    font-size: 11px;
    letter-spacing: 6px;
  }
  .modal h4 {
    font-family: 'Stardos Stencil', monospace;
    font-size: 24px;
    letter-spacing: 5px;
    text-align: center;
    color: var(--stamp);
    margin-bottom: 6px;
    text-transform: uppercase;
  }
  .modal .sub {
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    color: var(--ink-faint);
    letter-spacing: 2px;
    margin-bottom: 22px;
    text-transform: uppercase;
  }
  .modal label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--ink-soft);
    margin: 16px 0 6px;
    text-transform: uppercase;
  }
  .modal select, .modal textarea, .modal input[type=text] {
    width: 100%;
    background: rgba(0,0,0,0.04);
    border: 1px solid var(--ink-soft);
    padding: 10px 12px;
    font-family: 'Special Elite', monospace;
    font-size: 14px;
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s;
  }
  .modal textarea { resize: vertical; min-height: 80px; }
  .modal select:focus, .modal textarea:focus, .modal input:focus {
    border-color: var(--stamp);
  }
  .modal .ack {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 18px 0 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-soft);
    letter-spacing: 0.4px;
    line-height: 1.5;
  }
  .modal .ack input { margin-top: 3px; accent-color: var(--stamp); }
  .modal .buttons {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    justify-content: flex-end;
  }
  .modal .btn {
    font-family: 'Stardos Stencil', monospace;
    font-size: 13px;
    letter-spacing: 3px;
    padding: 10px 20px 8px;
    border: 2px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    transition: all 0.12s;
  }
  .modal .btn:hover { background: var(--ink); color: var(--paper); }
  .modal .btn-primary {
    background: var(--stamp);
    color: var(--paper);
    border-color: var(--stamp-deep);
  }
  .modal .btn-primary:hover { background: var(--stamp-deep); color: #fff; }
  .modal .btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--stamp);
  }

  /* Revealed content */
  .gated-content { display: none; animation: ink-reveal 0.7s ease-out; }
  .gated-content.revealed { display: block; }
  @keyframes ink-reveal {
    0%   { opacity: 0; filter: blur(8px); transform: translateY(8px); }
    100% { opacity: 1; filter: blur(0); transform: translateY(0); }
  }

  /* Audit banner after reveal */
  .audit-banner {
    display: none;
    background: rgba(29, 56, 102, 0.08);
    border-left: 4px solid var(--stamp-blue);
    border-top: 1px solid var(--stamp-blue);
    border-bottom: 1px solid var(--stamp-blue);
    padding: 14px 18px;
    margin: 32px 0 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11.5px;
    color: var(--ink-soft);
    letter-spacing: 0.4px;
  }
  .audit-banner.show { display: block; }
  .audit-banner .label {
    color: var(--stamp-blue);
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-right: 12px;
  }
  .audit-banner .id {
    color: var(--ink);
    font-weight: 600;
    background: rgba(29, 56, 102, 0.12);
    padding: 2px 6px;
  }

  /* Print friendliness */
  @media print {
    body { background: white; }
    .stamp { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  }

  @media (max-width: 720px) {
    .page { padding: 56px 20px 80px 44px; }
    .page::before { left: 28px; }
    .holes { left: 8px; }
    .photo-card { grid-template-columns: 1fr; gap: 48px; }
    .cover-stamps { position: static; flex-direction: row; flex-wrap: wrap; margin-bottom: 32px; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .cover-meta { grid-template-columns: 1fr 1fr; }
    .cover-title { font-size: 32px; letter-spacing: 4px; }
    .cover-subtitle { font-size: 13px; }
    .section { padding: 20px 0; }
    .section-head { flex-wrap: wrap; gap: 8px; }
    .section-head h2 { font-size: 20px; }
    .quick-contact { margin: 24px 0; padding: 14px 16px 18px; }
    .quick-contact-grid { grid-template-columns: 1fr; }
    .contact-chip { padding: 8px 10px; }
    .classification-bar { font-size: 9px; letter-spacing: 2px; }
    .gate { padding: 28px 18px; }
    .audit-banner { font-size: 10px; padding: 10px 14px; flex-wrap: wrap; gap: 6px; }
  }
  @media (max-width: 420px) {
    .page { padding: 44px 14px 64px 32px; }
    .page::before { left: 20px; }
    .holes { display: none; }
    .cover-meta { grid-template-columns: 1fr; }
    .cover-title { font-size: 26px; letter-spacing: 3px; }
    .signal-row { grid-template-columns: 1fr; gap: 4px; }
    .signal-source { justify-self: end; }
  }
  /* ───────── Quick Contact card (above the gate) ───────── */
  .quick-contact {
    margin: 32px 8px 24px;
    padding: 18px 22px 22px;
    background: rgba(243, 227, 191, 0.55);
    border: 1.5px solid var(--ink);
    border-left: 6px solid var(--stamp);
    position: relative;
  }
  .quick-contact-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 14px;
    border-bottom: 1px dashed var(--ink-faint);
    padding-bottom: 8px;
  }
  .quick-contact-stamp {
    font-family: 'Stardos Stencil', monospace;
    font-size: 14px;
    letter-spacing: 4px;
    color: var(--stamp);
    text-transform: uppercase;
  }
  .quick-contact-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 1.5px;
    text-transform: uppercase;
  }
  .quick-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
  }
  .contact-chip {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 12px;
    background: var(--paper);
    border: 1px solid var(--ink-faint);
    border-left: 3px solid var(--stamp-blue);
    text-decoration: none;
    color: var(--ink);
    font-family: 'IBM Plex Mono', monospace;
    transition: transform 80ms ease, border-color 80ms ease, background 80ms ease;
  }
  .contact-chip:hover {
    transform: translate(-1px, -1px);
    border-color: var(--ink);
    background: rgba(243, 227, 191, 0.85);
    box-shadow: 2px 2px 0 var(--ink);
  }
  .contact-chip:active { transform: translate(0, 0); box-shadow: none; }
  .contact-icon { font-size: 18px; line-height: 1; margin-bottom: 4px; }
  .contact-label {
    font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--ink-faint);
  }
  .contact-value {
    font-size: 12.5px;
    color: var(--ink);
    word-break: break-all;
    overflow-wrap: anywhere;
  }
  .quick-contact-empty {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px; color: var(--ink-faint);
    letter-spacing: 1px;
    margin: 4px 0 0;
  }
  .quick-contact-empty code {
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 6px;
    border-radius: 2px;
  }
  .quick-contact-notes {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--ink-faint);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-style: italic;
    color: var(--ink-faint);
  }

  /* ───────── 70s film portrait treatment (the face must still be readable) ───────── */
  .photo-frame.has-photo {
    background: #2a1b0e;
    overflow: hidden;
  }
  .photo-frame.has-photo .reticle { display: none; }
  .portrait {
    position: absolute;
    inset: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    object-fit: cover;
    /* Subtle Kodak-Portra cast — preserves face readability */
    filter:
      sepia(0.18)
      saturate(0.92)
      contrast(1.08)
      brightness(1.0)
      hue-rotate(-3deg);
    z-index: 0;
  }
  /* Light film grain — kept low so the face wins */
  .portrait-grain {
    position: absolute;
    inset: 8px;
    background-image:
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='9'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.48  0 0 0 0 0.36  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.18'/></svg>");
    background-size: 240px 240px;
    mix-blend-mode: overlay;
    pointer-events: none;
    opacity: 0.4;
    z-index: 1;
  }
  /* Soft vignette + warm cast — never dark enough to hide the face */
  .portrait-vignette {
    position: absolute;
    inset: 8px;
    background:
      radial-gradient(ellipse at 50% 42%,
        rgba(255, 220, 160, 0.08) 0%,
        transparent 50%,
        rgba(40, 18, 8, 0.32) 100%),
      linear-gradient(170deg, rgba(255, 200, 130, 0.05), rgba(80, 30, 10, 0.08) 100%);
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 2;
  }
  /* Very subtle scan-print lines */
  .portrait-scanlines {
    position: absolute;
    inset: 8px;
    background:
      repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.025) 0px,
        rgba(0, 0, 0, 0.025) 1px,
        transparent 1px,
        transparent 5px);
    mix-blend-mode: overlay;
    pointer-events: none;
    opacity: 0.6;
    z-index: 3;
  }
  /* Corner brackets on top */
  .photo-frame.has-photo .corner { z-index: 4; }

  /* ───────── Empty-state portrait (no photo on file) ───────── */
  .photo-frame.no-photo {
    background:
      linear-gradient(135deg, #f0dcb0 0%, #d4ba7e 100%),
      radial-gradient(ellipse at center, rgba(0,0,0,0.05), transparent);
    overflow: hidden;
  }
  .photo-frame.no-photo .reticle { opacity: 0.3; }
  .portrait-empty {
    position: absolute;
    inset: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    z-index: 2;
  }
  .portrait-empty-initials {
    font-family: 'Cinzel', serif;
    font-size: 88px;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--ink);
    line-height: 0.85;
    opacity: 0.42;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.08);
  }
  .portrait-empty-label {
    font-family: 'Stardos Stencil', monospace;
    font-size: 11px;
    letter-spacing: 4px;
    color: var(--stamp);
    border: 2px solid var(--stamp);
    padding: 4px 12px 2px;
    background: rgba(243, 227, 191, 0.7);
  }
  .portrait-empty-hint {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 1.2px;
    color: var(--ink-faint);
    opacity: 0.7;
  }

  /* Override the built-in fake-gradient placeholder when we know we have a
     real photo OR are showing the explicit empty-state — otherwise it
     renders the dark face-blob from the old placeholder design. */
  .photo-frame.has-photo::before,
  .photo-frame.has-photo::after,
  .photo-frame.no-photo::before,
  .photo-frame.no-photo::after {
    content: none !important;
    display: none !important;
  }

  /* Signals strip — "Recent changes" delta at top of dossier */
  .signals-strip {
    margin: 32px 0 24px;
    padding: 18px 22px;
    background: rgba(255, 248, 220, 0.42);
    border-top: 2px solid var(--stamp-blue, #2b3a67);
    border-bottom: 2px solid var(--stamp-blue, #2b3a67);
    font-family: 'IBM Plex Mono', monospace;
  }
  .signals-strip-title {
    margin: 0 0 12px;
    font-family: 'Stardos Stencil', 'IBM Plex Mono', monospace;
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--stamp-blue, #2b3a67);
  }
  .signal-rows {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .signal-row {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dotted var(--ink-faint, #b8a98a);
    font-size: 13px;
    line-height: 1.4;
  }
  .signal-row:last-child { border-bottom: none; }
  .signal-kind {
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--ink-faint, #6f5e3f);
    align-self: center;
  }
  .signal-headline { color: var(--ink, #1d150a); }
  .signal-source {
    font-size: 11px;
    color: var(--stamp-blue, #2b3a67);
    text-decoration: underline dotted;
    text-underline-offset: 2px;
    align-self: center;
  }
  .signal-row.new {
    position: relative;
    background: rgba(220, 50, 50, 0.06);
  }
  .signal-row.new::before {
    content: 'NEW';
    position: absolute;
    left: -38px;
    top: 8px;
    font-family: 'Stardos Stencil', monospace;
    font-size: 9px;
    letter-spacing: 2px;
    color: #b22222;
    border: 1px solid #b22222;
    padding: 1px 4px;
    transform: rotate(-3deg);
  }
  .signals-empty {
    font-style: italic;
    color: var(--ink-faint, #6f5e3f);
    text-align: center;
    border: none;
    background: transparent;
  }
  @media (max-width: 480px) {
    .signal-row { grid-template-columns: 70px 1fr; }
    .signal-source { grid-column: 2; justify-self: end; }
    .signal-row.new::before { left: 0; top: -12px; }
  }

  /* Person-to-person edges — "Connected to" subsection in §04 */
  .edges-list { margin: 14px 0; display: flex; flex-direction: column; gap: 6px; }
  .edge-row {
    display: grid;
    grid-template-columns: 130px auto 1fr auto;
    gap: 12px;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px dotted var(--ink-faint, #b8a98a);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
  }
  .edge-row:last-child { border-bottom: none; }
  .edge-kind {
    font-family: 'Stardos Stencil', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--ink-faint, #6f5e3f);
  }
  .edge-target {
    color: var(--stamp-blue, #2b3a67);
    text-decoration: underline dotted;
    text-underline-offset: 2px;
    font-weight: 500;
  }
  .edge-target-unlinked {
    color: var(--ink-faint, #6f5e3f);
    font-style: italic;
  }
  .edge-evidence {
    color: var(--ink-faint, #6f5e3f);
    font-size: 11px;
    line-height: 1.4;
  }
  .edge-source {
    color: var(--stamp-blue, #2b3a67);
    font-size: 11px;
    text-decoration: underline dotted;
  }
  .section-subhead {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    letter-spacing: 3px;
    margin: 18px 0 8px;
    color: var(--ink-faint, #6f5e3f);
  }
  @media (max-width: 720px) {
    .edge-row { grid-template-columns: 100px 1fr; gap: 6px; }
    .edge-evidence { grid-column: 1 / -1; padding-left: 100px; }
    .edge-source { grid-column: 1 / -1; padding-left: 100px; }
  }
