/* wrongperson-site — Declassified aesthetic.
   Tokens mirror app/Sources/Views/Atoms/DeclassifiedTheme.swift exactly.
   Component shapes mirror app/Sources/Views/Atoms/DossierAtoms.swift. */

:root {
  /* iOS Dossier.paper      (0.957, 0.937, 0.902) */
  --paper:          #F4EFE6;
  /* iOS Dossier.paperEdge  (0.890, 0.860, 0.812) */
  --paper-edge:     #E3DBCF;
  /* iOS Dossier.ink        (0.102, 0.094, 0.078) */
  --ink:            #1A1814;
  /* iOS Dossier.inkMuted   (0.376, 0.345, 0.290) */
  --ink-muted:      #60584A;
  /* iOS Dossier.inkFaint   (0.620, 0.580, 0.514) */
  --ink-faint:      #9E9483;
  /* iOS Dossier.redact     (0.063, 0.055, 0.039) */
  --redact:         #100E0A;
  /* iOS Dossier.highlight  (0.973, 0.898, 0.663) */
  --highlight:      #F8E5A9;
  /* iOS Dossier.stampReady    (0.00, 0.69, 0.52) */
  --stamp-ready:    #00B085;
  /* iOS Dossier.stampReview   (0.82, 0.58, 0.20) */
  --stamp-review:   #D19433;
  /* iOS Dossier.stampRestrict (0.71, 0.30, 0.30) */
  --stamp-restrict: #B54D4D;

  /* Typography — match iOS Dossier.display / .body / .mono / .stamp.
     SF Pro / New York / SF Mono are Apple-system on iOS; on web we fall
     back to system equivalents in the same family. */
  --serif: ui-serif, 'New York', 'Times New Roman', Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, 'SF Mono', Menlo, Consolas, 'Roboto Mono', monospace;

  /* iOS Dossier.pageMargin = 20 */
  --page-margin: 20px;
  /* iOS Dossier.folioRadius = 4 */
  --r-folio: 4px;
  /* iOS Dossier.cardRadius = 6 */
  --r-card:  6px;
  /* iOS Dossier.stampRotation = -3 */
  --stamp-rot: -3deg;

  --max-width: 720px;
}

@media (min-width: 768px)  { :root { --page-margin: 40px; --max-width: 760px; } }
@media (min-width: 1024px) { :root { --page-margin: clamp(40px, 5vw, 80px); } }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper grain — same idea as the iOS PaperGrain Canvas overlay, baked
   into the body background via an inline SVG noise pattern. Subtle. */
body {
  min-height: 100dvh;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(26,24,20,0.035) 31px,
      rgba(26,24,20,0.035) 32px
    ),
    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  0 0 0 0 0  0 0 0 0 0  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-attachment: fixed, fixed;
}

/* ---- Classification banner ---- */
.classification {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink);
  /* dashed border 1.2px, dash 3 gap 3 */
  border: 1.2px dashed var(--ink);
  padding: 6px 10px;
  margin: 16px var(--page-margin) 0;
  background: var(--paper);
}
.classification > span:nth-child(2) { text-align: center; }
.classification > span:nth-child(3) { text-align: right; }

/* ---- Page shell ---- */
.page {
  padding: 0 var(--page-margin);
  padding-bottom: 96px;
  max-width: calc(var(--max-width) + var(--page-margin) * 2);
  margin: 0 auto;
}

/* ---- Top nav ---- */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px var(--page-margin);
  gap: 16px;
  flex-wrap: wrap;
}
.topnav__links { display: flex; gap: 18px; flex-wrap: wrap; }
.topnav__links a {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-muted);
}
.topnav__links a:hover { color: var(--ink); }

/* Wordmark */
.wordmark {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.01em;
}
.wordmark a { text-decoration: none; color: var(--ink); }

/* ---- Dossier header ---- */
.dossier-header {
  padding-top: 24px;
  padding-bottom: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.dossier-header__text { flex: 1; min-width: 0; }
/* iOS: serif 40 black */
.dossier-header__title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(32px, 7vw, 40px);
  line-height: 1.0;
  letter-spacing: -0.01em;
  margin: 0 0 6px 0;
  color: var(--ink);
}
/* iOS: body 15 regular italic, ink-muted */
.dossier-header__subtitle {
  font-style: italic;
  color: var(--ink-muted);
  font-size: 15px;
  margin: 0;
  max-width: 60ch;
}

/* The 80-tick dashed rule under the header — mimics the iOS pattern
   (80 rectangles 4x1 with 4px gaps). Implemented as a repeating
   linear-gradient. */
.dossier-rule {
  height: 1px;
  background: repeating-linear-gradient(to right,
    var(--ink-faint) 0 4px,
    transparent 4px 8px);
  margin: 16px 0 24px 0;
}

/* ---- Folio (section) ---- */
.folio { margin-top: 28px; }
.folio__header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 0.8px dashed var(--ink-faint);
  margin-bottom: 14px;
}
.folio__caption {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin: 0;
  flex-shrink: 0;
}
.folio__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(20px, 3.4vw, 22px);
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
  flex: 1;
}
.folio__intro {
  font-style: italic;
  color: var(--ink-muted);
  font-size: 14px;
  margin: -4px 0 14px 0;
  max-width: 60ch;
}
.folio__body { font-size: 16px; }
.folio__body p { margin: 0 0 12px 0; max-width: 65ch; }
.folio__body p:last-child { margin-bottom: 0; }
.folio__body ul,
.folio__body ol {
  margin: 0 0 12px 0;
  padding-left: 22px;
  max-width: 60ch;
}
.folio__body li { margin-bottom: 6px; }
.folio__body code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--paper-edge);
  padding: 1px 6px;
  border-radius: 2px;
}

/* ---- Panels (cards) ---- */
.panel {
  background: var(--paper-edge);
  border: 0.8px solid color-mix(in srgb, var(--ink-faint) 40%, transparent);
  border-radius: var(--r-card);
  padding: 16px 20px;
  margin: 16px 0;
}
.panel--centered { text-align: center; }

/* ---- Rubber stamp ---- */
/* iOS: .system(size: 11, weight: .black) — sans, chunky.
   tracking: 0.12em. Border 1.5px, radius 2, rotation -3°. */
.stamp {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  transform: rotate(var(--stamp-rot));
  flex-shrink: 0;
}
.stamp--ready    { color: var(--stamp-ready); }
.stamp--review   { color: var(--stamp-review); }
.stamp--restrict { color: var(--stamp-restrict); }
.stamp--ink      { color: var(--ink-muted); }

/* ---- Redaction bar ---- */
.redact {
  display: inline-block;
  background: var(--redact);
  color: var(--paper);
  padding: 2px 10px;
  transform: rotate(-1.5deg);
}

/* ---- Links ---- */
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--stamp-restrict); }

/* ---- Buttons / CTA "rubber" button stamps ---- */
.btn-stamp {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 22px;
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  text-decoration: none;
  transform: rotate(-2deg);
}
.btn-stamp:hover { color: var(--paper); background: var(--stamp-restrict); border-color: var(--stamp-restrict); }

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--ink);
  margin-top: 96px;
  padding: 24px var(--page-margin);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}
.footer a { color: var(--ink-faint); }
.footer a:hover { color: var(--ink); }

/* ---- Metric blocks (mono number + caps caption) ---- */
.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.metric {
  background: var(--paper-edge);
  border: 0.8px solid color-mix(in srgb, var(--ink-faint) 40%, transparent);
  border-radius: var(--r-card);
  padding: 14px 16px;
}
.metric__num {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  margin-bottom: 6px;
  color: var(--ink);
}
.metric__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.2px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---- Definition rows (mono label + value, dashed bottom rule) ---- */
.def {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.8px dashed var(--ink-faint);
}
.def:last-child { border-bottom: none; }
.def__label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-top: 3px;
}
.def__value { font-size: 15px; color: var(--ink); }
@media (max-width: 599px) {
  .def { grid-template-columns: 1fr; }
  .def__label { padding-top: 0; }
}

/* ---- FAQ list (serif Q, body A) ---- */
.qa { margin-bottom: 22px; max-width: 65ch; }
.qa__q {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  margin: 0 0 6px 0;
  line-height: 1.3;
  color: var(--ink);
}
.qa__a { margin: 0; color: var(--ink-muted); font-size: 15px; }

/* ---- Press kit grid ---- */
.press-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.press-card {
  background: var(--paper-edge);
  border: 0.8px solid color-mix(in srgb, var(--ink-faint) 40%, transparent);
  border-radius: var(--r-card);
  padding: 16px;
}
.press-card__title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.2px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 8px 0;
}
.press-card a { font-size: 14px; }

/* ---- Reduce motion ---- */
@media (prefers-reduced-motion: reduce) {
  .stamp, .redact, .btn-stamp { transform: none; }
}

/* ---- Dark mode (scanned dossier) — exact iOS values ---- */
@media (prefers-color-scheme: dark) {
  :root {
    /* iOS paper-dark     (0.082, 0.078, 0.059) */
    --paper:      #15140F;
    /* iOS paperEdge-dark (0.149, 0.137, 0.106) */
    --paper-edge: #26231B;
    /* iOS ink-dark       (0.949, 0.929, 0.875) */
    --ink:        #F2EDDF;
    /* iOS inkMuted-dark  (0.694, 0.667, 0.604) */
    --ink-muted:  #B1AA9A;
    /* iOS inkFaint-dark  (0.467, 0.439, 0.388) */
    --ink-faint:  #777063;
    /* iOS redact-dark    (0.027, 0.024, 0.020) */
    --redact:     #070605;
  }
  body { background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, rgba(242,237,223,0.04) 31px, rgba(242,237,223,0.04) 32px); }
  .btn-stamp { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .btn-stamp:hover { background: var(--stamp-restrict); color: var(--paper); }
}
