/* ====================================================================
   donna — open dossier, two-page spread.
   Concept: an open case folder lying flat on a desk. Left page = intake
   record + countdown. Right page = public petition. Photos drift through
   the open file like translucent evidence overlays.
   ==================================================================== */

:root {
  --paper:      oklch(0.93 0.030 80);
  --paper-soft: oklch(0.91 0.034 78);
  --paper-edge: oklch(0.86 0.038 76);
  --paper-fold: oklch(0.78 0.040 72);
  --ink:        oklch(0.22 0.040 36);
  --ink-soft:   oklch(0.36 0.038 38);
  --ink-faint:  oklch(0.55 0.030 40);
  --red:        oklch(0.55 0.210 25);
  --red-deep:   oklch(0.42 0.190 22);
  --yellow:     oklch(0.85 0.140 88);
  --void:       oklch(0.10 0.010 250);

  --shadow-doc: 0 30px 80px -28px rgba(20,12,4,0.65), 0 8px 18px -10px rgba(20,12,4,0.40);

  --type-heading: "Bebas Neue", "Oswald", "Anton", Impact, sans-serif;
  --type-body:    "Special Elite", "Courier Prime", "American Typewriter", "Courier New", monospace;
  --type-num:     "Major Mono Display", "JetBrains Mono", ui-monospace, monospace;

  --doc-w: 1240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--void);
  color: var(--ink);
  font-family: var(--type-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body { min-height: 100dvh; }

/* ============================================================
   Background video.
   ============================================================ */
.bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  filter: saturate(0.55) contrast(1.1) brightness(0.55);
  transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}
body[data-state="main"] .bg { opacity: 0.40; }

.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(8,4,0,0.0) 0%, rgba(8,4,0,0.35) 60%, rgba(8,4,0,0.85) 100%);
}

/* ============================================================
   Stage 1: lock screen.
   ============================================================ */
.lock {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 40%, oklch(0.18 0.02 250) 0%, oklch(0.06 0.005 250) 80%);
  cursor: pointer;
  padding: 24px;
  transition: opacity 0.7s cubic-bezier(0.7, 0, 0.84, 0);
}
body[data-state="entering"] .lock { opacity: 0; pointer-events: none; }
body[data-state="main"] .lock { display: none; }

.lock__inner {
  position: relative;
  text-align: center;
  max-width: 540px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(245,235,210,0.24);
  background: rgba(0,0,0,0.35);
  color: oklch(0.92 0.020 80);
  backdrop-filter: blur(6px);
}
.lock__inner::before,
.lock__inner::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--red);
}
.lock__inner::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.lock__inner::after  { bottom: -2px; right: -2px; border-left: none; border-top: none; }

.lock__brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding: 8px 16px;
  border: 1px solid rgba(245,235,210,0.32);
}
.lock__seal { font-size: 22px; color: var(--red); }
.lock__brandtxt {
  font-family: var(--type-heading);
  font-size: 14px;
  letter-spacing: 0.18em;
  line-height: 1.05;
  text-align: left;
  color: oklch(0.92 0.02 80);
}

.lock__title {
  font-family: var(--type-heading);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  color: var(--red);
}
.lock__sub {
  font-family: var(--type-body);
  font-size: 11px;
  letter-spacing: 0.24em;
  margin: 0 0 22px;
  color: oklch(0.78 0.020 80);
}
.lock__codes {
  font-family: var(--type-num);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: oklch(0.68 0.020 80);
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 36px;
  text-transform: uppercase;
}
.lock__cta {
  font-family: var(--type-heading);
  font-size: clamp(18px, 2.4vw, 22px);
  letter-spacing: 0.18em;
  margin: 0 0 12px;
  color: oklch(0.92 0.02 80);
  animation: blink 1.6s steps(2, end) infinite;
}
.lock__warn {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--yellow);
  margin: 0;
}
@keyframes blink { 0%, 55% { opacity: 1; } 55.01%, 100% { opacity: 0.32; } }

/* ============================================================
   Stage 2: the open dossier (two-page spread).
   ============================================================ */
.doc {
  position: relative;
  z-index: 10;

  /* Single-column flow */
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.8vw, 22px);

  width: min(900px, calc(100vw - 320px));
  margin: 24px auto;
  padding: clamp(28px, 3.2vw, 56px) clamp(28px, 3vw, 48px) clamp(20px, 2.4vw, 36px);

  /* Liquid-glass paper: more translucent — let the video bleed through. */
  background:
    linear-gradient(180deg,
      oklch(0.94 0.028 80 / 0.42) 0%,
      oklch(0.92 0.032 78 / 0.38) 40%,
      oklch(0.90 0.034 76 / 0.40) 100%),
    radial-gradient(ellipse at 30% 80%, oklch(0.86 0.040 76 / 0.16), transparent 60%),
    radial-gradient(ellipse at 90% 10%, oklch(0.86 0.040 76 / 0.14), transparent 55%);
  -webkit-backdrop-filter: blur(18px) saturate(1.10);
  backdrop-filter: blur(18px) saturate(1.10);
  color: var(--ink);

  /* Inner highlight + drop shadow, gives it material weight */
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.35),
    inset 0 -1px 0 oklch(0 0 0 / 0.12),
    inset 0 0 0 1px oklch(1 0 0 / 0.10),
    0 30px 80px -28px rgba(20,12,4,0.65),
    0 8px 18px -10px rgba(20,12,4,0.40);

  transform: translateY(40px) rotate(-0.3deg);
  opacity: 0;
  transition:
    transform 1.0s cubic-bezier(0.16, 1, 0.3, 1) 0.15s,
    opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}
body[data-state="main"] .doc {
  transform: translateY(0) rotate(-0.3deg);
  opacity: 1;
}

/* Subtle paper noise — a touch of fibrous texture over the glass */
.doc::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: multiply;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0.32  0 0 0 0 0.20  0 0 0 0 0.06  0 0 0 0.18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Diagonal fold crease */
.doc::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 49.6%, oklch(0.78 0.040 72 / 0.16) 49.9%, transparent 50.2%);
  mix-blend-mode: multiply;
  opacity: 0.4;
}

/* Folder tab */
.doc__tab {
  position: absolute;
  top: -22px;
  left: clamp(40px, 6vw, 80px);
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--paper-edge);
  padding: 8px 24px;
  font-family: var(--type-heading);
  font-size: 14px;
  letter-spacing: 0.20em;
  color: var(--ink-soft);
  box-shadow: 0 -2px 4px rgba(0,0,0,0.10);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 100%, 0 100%);
}
.doc__tab-r { color: var(--ink); font-family: var(--type-num); letter-spacing: 0.06em; }

/* Three-hole punch on the LEFT page */
.doc__punches {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: clamp(80px, 18vh, 140px);
  pointer-events: none;
  z-index: 12;
}
.doc__punches span {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--void);
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.7),
    inset 0 -1px 0 oklch(0.86 0.038 76);
}
@media (max-width: 720px) {
  .doc__punches { display: none; }
}

/* ============================================================
   Top header strip
   ============================================================ */
.doc__hdr {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  padding-bottom: clamp(8px, 1.2vw, 14px);
  border-bottom: 1.5px solid var(--ink);
  font-size: 10px;
  letter-spacing: 0.20em;
  color: var(--ink-soft);
}
.doc__form { font-family: var(--type-body); justify-self: start; }
.doc__filenum {
  font-family: var(--type-num);
  font-size: clamp(11px, 1.2vw, 13px);
  letter-spacing: 0.06em;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 2px 10px;
  justify-self: end;
}

/* Barcode (centered between titles) */
.barcode {
  display: flex;
  align-items: stretch;
  height: 28px;
  gap: 1.5px;
  filter: contrast(1.1);
}
.barcode span { display: block; background: var(--ink); }
.barcode span:nth-child(1) { width: 2px; }
.barcode span:nth-child(2) { width: 1px; }
.barcode span:nth-child(3) { width: 4px; }
.barcode span:nth-child(4) { width: 1px; }
.barcode span:nth-child(5) { width: 2px; }
.barcode span:nth-child(6) { width: 3px; }
.barcode span:nth-child(7) { width: 1px; }
.barcode span:nth-child(8) { width: 2px; }
.barcode span:nth-child(9) { width: 1px; }
.barcode span:nth-child(10){ width: 4px; }
.barcode span:nth-child(11){ width: 2px; }
.barcode span:nth-child(12){ width: 1px; }
.barcode span:nth-child(13){ width: 3px; }
.barcode span:nth-child(14){ width: 1px; }
.barcode span:nth-child(15){ width: 2px; }
.barcode span:nth-child(16){ width: 1px; }
.barcode span:nth-child(17){ width: 4px; }
.barcode span:nth-child(18){ width: 2px; }
.barcode span:nth-child(19){ width: 1px; }
.barcode span:nth-child(20){ width: 3px; }

.doc__hr {
  border: none;
  border-top: 1px solid var(--ink);
  margin: 0;
  position: relative;
}
.doc__hr::after {
  content: "";
  position: absolute;
  top: 2px; left: 0; right: 0;
  border-top: 1px dashed var(--ink-faint);
  opacity: 0.45;
}

/* ============================================================
   Intake block: mugshot + record + CTA + inline feed.
   ============================================================ */
.intake {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: clamp(20px, 2.4vw, 36px);
  align-items: start;
}
@media (max-width: 720px) {
  .intake { grid-template-columns: minmax(0, 130px) minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 380px) {
  .intake { grid-template-columns: minmax(0, 110px) minmax(0, 1fr); gap: 10px; }
}
.intake__r {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.4vw, 18px);
  min-width: 0;
}

.mug {
  position: relative;
  margin: 0;
  transform: rotate(-1.2deg);
  padding: 6px 6px 12px;
  background: oklch(0.97 0.012 80);
  box-shadow:
    0 2px 0 oklch(0.78 0.040 72),
    0 8px 20px rgba(50,30,10,0.20);
}
.mug__frame {
  width: 100%;
  aspect-ratio: 2 / 3;
  background-image: url("/mugshot.jpg");
  background-size: 200% 200%;
  background-position: 0 0;
  background-repeat: no-repeat;
  filter: contrast(1.05) saturate(0.78) brightness(0.95);
  border: 1px solid var(--ink);
}
.mug__cap {
  margin-top: 8px;
  font-family: var(--type-body);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  text-align: center;
}
.mug__tape {
  position: absolute;
  width: 50px;
  height: 14px;
  background: oklch(0.88 0.075 90 / 0.85);
  box-shadow: 0 1px 1px rgba(0,0,0,0.12);
}
.mug__tape--tl { top: -7px; left: -8px; transform: rotate(-22deg); }
.mug__tape--br { bottom: -2px; right: -10px; transform: rotate(28deg); }

.record {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.record__row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--ink-faint);
}
.record__row:last-child { border-bottom: none; }
.record__row dt {
  font-family: var(--type-heading);
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--ink-soft);
  align-self: center;
}
.record__row dd {
  margin: 0;
  font-family: var(--type-body);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.2;
}
.record__name {
  font-size: clamp(15px, 1.6vw, 18px);
  letter-spacing: 0.04em;
}
.record__charges {
  font-style: italic;
  text-decoration: underline;
  text-decoration-color: var(--ink);
  text-decoration-thickness: 1px;
}
.record__row--status dt {
  color: var(--red);
  font-weight: 700;
}
.record__incarcerated {
  display: inline-block;
  font-family: var(--type-heading);
  font-size: clamp(14px, 1.5vw, 17px);
  letter-spacing: 0.14em;
  color: var(--red);
  border: 2px solid var(--red);
  padding: 2px 10px;
  background: oklch(0.96 0.020 30 / 0.65);
  text-shadow: 0 0 1px oklch(0.96 0.020 30);
}

/* ============================================================
   Countdown — centered band.
   ============================================================ */
.countdown {
  text-align: center;
  padding: clamp(10px, 1.6vw, 16px) clamp(20px, 3vw, 40px);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  position: relative;
}
.countdown::before,
.countdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ink-faint);
  opacity: 0.5;
}
.countdown::before { top: 3px; }
.countdown::after  { bottom: 3px; }

.countdown__hdr {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
  align-items: center;
}
.countdown__h {
  font-family: var(--type-heading);
  letter-spacing: 0.20em;
  font-size: clamp(13px, 1.4vw, 16px);
  color: var(--ink);
}
.countdown__sub {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
}
.countdown__grid {
  display: inline-flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
}
.countdown__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 14px;
  border: 1.5px solid var(--ink);
  background: oklch(0.96 0.020 80 / 0.55);
  min-width: 70px;
}
.countdown__num {
  font-family: var(--type-num);
  font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.countdown__lbl {
  margin-top: 4px;
  font-family: var(--type-heading);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}
.countdown__sep {
  font-family: var(--type-num);
  font-size: clamp(28px, 3.2vw, 38px);
  color: var(--ink-faint);
  align-self: center;
  padding-bottom: 14px;
}
.countdown__note {
  margin-top: 8px;
  font-family: var(--type-heading);
  font-size: 11px;
  letter-spacing: 0.20em;
  color: var(--red);
}

/* ============================================================
   Petition CTA button (under STATUS row).
   ============================================================ */
.cta {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: clamp(10px, 1.4vw, 16px);
  padding: 12px 18px;
  background: oklch(0.97 0.018 80 / 0.85);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-family: var(--type-heading);
  letter-spacing: 0.18em;
  font-size: clamp(13px, 1.3vw, 15px);
  cursor: pointer;
  text-align: left;
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.5),
    0 4px 12px -4px rgba(20,12,4,0.30);
  transition: background 0.18s ease-out, transform 0.12s ease-out, box-shadow 0.18s ease-out;
}
.cta:hover {
  background: oklch(0.99 0.020 80 / 0.95);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.6),
    0 6px 16px -4px rgba(20,12,4,0.40);
}
.cta:active { transform: translateY(1px); }
.cta__count {
  font-family: var(--type-body);
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--ink-soft);
  text-transform: none;
}
.cta__count strong {
  font-family: var(--type-num);
  color: var(--red);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.cta__arrow { font-family: var(--type-body); font-size: 18px; line-height: 1; color: var(--red); }

/* Form */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form__row { position: relative; display: flex; flex-direction: column; gap: 2px; }
.form__lbl {
  font-family: var(--type-heading);
  font-size: 10px;
  letter-spacing: 0.20em;
  color: var(--ink-soft);
}
.form input[type="text"],
.form textarea {
  background: transparent;
  border: none;
  border-bottom: 1.5px dashed var(--ink-faint);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--type-body);
  font-size: 15px;
  padding: 4px 0 6px;
  outline: none;
  resize: vertical;
  min-height: 24px;
}
.form input::placeholder,
.form textarea::placeholder { color: var(--ink-faint); font-style: italic; }
.form input[type="text"]:focus,
.form textarea:focus { border-bottom-color: var(--ink); border-bottom-style: solid; }
.form__counter {
  position: absolute;
  right: 0;
  bottom: -14px;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.form__hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form__foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.form__btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 0;
  padding: 10px 18px;
  font-family: var(--type-heading);
  font-size: 13px;
  letter-spacing: 0.20em;
  cursor: pointer;
  transition: background 0.18s ease-out, transform 0.12s ease-out;
}
.form__btn:hover:not(:disabled) { background: var(--red-deep); }
.form__btn:active:not(:disabled) { transform: translateY(1px); }
.form__btn:disabled { background: var(--ink-faint); cursor: wait; }
.form__btn-tick { font-family: var(--type-body); font-size: 16px; line-height: 1; }
.form__status {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--ink-soft);
  min-height: 16px;
}
.form__status[data-kind="ok"]    { color: var(--ink); }
.form__status[data-kind="error"] { color: var(--red); }
.form__status[data-kind="rate"]  { color: oklch(0.50 0.180 60); }
.form.is-error                   { box-shadow: 0 0 0 1px var(--red) inset; }

/* Feed (inline under CTA) — messy 5×2 sharpie grid */
.feed {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.feed--inline { margin-top: 6px; }
.feed__hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.feed__h {
  font-family: var(--type-heading);
  letter-spacing: 0.20em;
  font-size: 11px;
  color: var(--ink-soft);
}
.feed__count {
  font-family: var(--type-num);
  font-size: 10px;
  letter-spacing: 0.10em;
  color: var(--ink-faint);
}

/* Default (non-inline) feed list — kept for any future reuse */
.feed__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* === Messy sharpie grid (inline) === */
.feed--inline .feed__list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: minmax(40px, auto);
  gap: 10px 14px;
  padding: 10px 4px 6px;
  border: none;
  max-height: none;
  overflow: visible;
}
.feed--inline .feed__list li {
  border: none !important;
  padding: 0;
  font-family: "Permanent Marker", "Caveat", cursive;
  color: var(--ink);
  font-size: clamp(16px, 1.6vw, 19px);
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-align: left;
  /* Solid sharpie stroke — small shadow + extra weight via shadow stacking */
  text-shadow:
    0 0 1px rgba(20,12,4,0.45),
    0 0.5px 0 rgba(20,12,4,0.30);
  /* Override base ledger-in animation */
  animation: none;
  transform-origin: 50% 50%;
  word-break: break-word;
}
.feed--inline .feed__list li::before { content: none !important; }
/* Hide timestamps in the messy grid; keep names + messages */
.feed--inline .feed__time { display: none; }
.feed--inline .feed__name { display: block; }
.feed--inline .feed__msg {
  display: block;
  margin: 4px 0 0;
  font-family: "Caveat", "Permanent Marker", cursive;
  font-weight: 600;
  font-size: clamp(14px, 1.3vw, 17px);
  font-style: normal;
  line-height: 1.15;
  color: var(--ink);
  text-shadow: 0 0 1px rgba(20,12,4,0.35);
  letter-spacing: 0;
  /* slight counter-rotation so the line break feels hand-written */
  transform: rotate(1deg);
}

/* Random-ish jitter — each cell at its own scribble angle */
.feed--inline .feed__list li:nth-child(1)  { transform: rotate(-4deg) translate(2px, 1px);  color: var(--ink); }
.feed--inline .feed__list li:nth-child(2)  { transform: rotate(2deg)  translate(-1px, -2px); color: oklch(0.30 0.060 30); }
.feed--inline .feed__list li:nth-child(3)  { transform: rotate(-1deg) translate(0, 2px);    color: var(--ink); }
.feed--inline .feed__list li:nth-child(4)  { transform: rotate(5deg)  translate(-2px, 0);   color: oklch(0.32 0.080 250); }
.feed--inline .feed__list li:nth-child(5)  { transform: rotate(-3deg) translate(1px, -1px); color: var(--ink); }
.feed--inline .feed__list li:nth-child(6)  { transform: rotate(3deg)  translate(-1px, 3px); color: oklch(0.28 0.070 30); }
.feed--inline .feed__list li:nth-child(7)  { transform: rotate(-5deg) translate(2px, 0);    color: var(--ink); }
.feed--inline .feed__list li:nth-child(8)  { transform: rotate(1deg)  translate(0, -2px);   color: oklch(0.30 0.080 250); }
.feed--inline .feed__list li:nth-child(9)  { transform: rotate(-2deg) translate(-2px, 1px); color: var(--ink); }
.feed--inline .feed__list li:nth-child(10) { transform: rotate(4deg)  translate(1px, -1px); color: oklch(0.32 0.060 30); }
.feed--inline .feed__list li:nth-child(n+11) { display: none; }

@media (max-width: 720px) {
  .feed--inline .feed__list {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px 10px;
    padding: 6px 2px 4px;
  }
  .feed--inline .feed__list li {
    font-size: 14px;
  }
  .feed--inline .feed__msg { font-size: 11px; line-height: 1.1; }
  .feed--inline .feed__list li:nth-child(n+7) { display: none; }
}
.feed__list:empty { display: none; }
.feed__list li {
  position: relative;
  padding: 8px 14px 8px 26px;
  border-bottom: 1px dashed var(--ink-faint);
  animation: ledger-in 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.feed__list li:last-child { border-bottom: none; }
.feed__list li::before {
  content: "✕";
  position: absolute;
  left: 8px;
  top: 10px;
  font-size: 11px;
  color: var(--red);
}
.feed__name {
  font-family: var(--type-body);
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.feed__time {
  float: right;
  margin-left: 12px;
  font-family: var(--type-num);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.feed__msg {
  margin: 4px 0 0;
  font-size: 12px;
  font-style: italic;
  color: var(--ink-soft);
}
.feed__empty {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  margin-top: 10px;
}
@keyframes ledger-in {
  from { transform: translateY(-4px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ============================================================
   Bottom footer (spans both pages).
   ============================================================ */
.doc__ftr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--ink);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}
.doc__ftr-l { display: flex; align-items: center; gap: 14px; }
.doc__ftr-stamp {
  font-family: var(--type-heading);
  color: var(--red);
  border: 2px solid var(--red);
  padding: 2px 8px;
  letter-spacing: 0.18em;
  font-size: 11px;
}
.doc__ftr-meta { font-style: italic; color: var(--ink-faint); }
.doc__ftr-r { font-family: var(--type-num); }

/* Coffee stain — bottom-right corner */
.doc__stain {
  position: absolute;
  bottom: -16px;
  right: 18px;
  width: 110px;
  height: 110px;
  pointer-events: none;
  opacity: 0.85;
  mix-blend-mode: multiply;
  transform: rotate(8deg);
}

/* ============================================================
   Stamps — overlaid on top of the document.
   ============================================================ */
.stamp {
  position: absolute;
  pointer-events: none;
  font-family: var(--type-heading);
  color: var(--red);
  z-index: 14; /* above evidence drift */
}
.stamp--received {
  top: clamp(40px, 5vw, 64px);
  right: clamp(30px, 4vw, 54px);
  border: 3px solid var(--red);
  padding: 6px 12px;
  text-align: center;
  mix-blend-mode: multiply;
  opacity: 0;
  filter: blur(0.4px);
  transform: rotate(11deg) scale(1.6);
  animation: stamp-land-r 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards 1.4s;
}
.stamp--received .stamp__big {
  display: block;
  font-size: clamp(18px, 2.2vw, 24px);
  letter-spacing: 0.10em;
  line-height: 0.9;
  text-decoration: line-through;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}
.stamp--received .stamp__small {
  display: block;
  font-family: var(--type-body);
  font-size: 9px;
  letter-spacing: 0.16em;
  margin-top: 3px;
  color: var(--red);
}
.stamp--received .stamp__small--alt { font-size: 8px; opacity: 0.85; }

@keyframes stamp-land-r {
  0%   { opacity: 0; transform: rotate(11deg) scale(1.6); filter: blur(2px); }
  60%  { opacity: 0.95; }
  100% { opacity: 0.85; transform: rotate(11deg) scale(0.95); filter: blur(0.5px); }
}

/* ============================================================
   Drifting evidence photos — pass over the document with multiply blend.
   Light, subtle, ghostly.
   ============================================================ */
.evidence {
  position: fixed;
  inset: 0;
  z-index: 13; /* above doc (10), spine (11), punches (12) — below stamps (14) */
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s;
}
body[data-state="main"] .evidence { opacity: 1; }

.evidence__item {
  position: absolute;
  width: 280px;
  opacity: 0;
  filter: blur(2px) grayscale(0.30) contrast(0.95) sepia(0.10);
  mix-blend-mode: multiply;
  will-change: transform, opacity;
}
.evidence__item--a { top: 6%;  width: 300px; animation: drift-r 48s linear infinite; animation-delay: -8s; }
.evidence__item--b { top: 18%; width: 240px; animation: drift-l 56s linear infinite; animation-delay: -28s; }
.evidence__item--c { top: 30%; width: 280px; animation: drift-r 62s linear infinite; animation-delay: -44s; }
.evidence__item--d { top: 42%; width: 220px; animation: drift-l 50s linear infinite; animation-delay: -16s; }
.evidence__item--e { top: 54%; width: 260px; animation: drift-r 66s linear infinite; animation-delay: -2s; }
.evidence__item--f { top: 66%; width: 230px; animation: drift-l 58s linear infinite; animation-delay: -36s; }
.evidence__item--g { top: 78%; width: 270px; animation: drift-r 54s linear infinite; animation-delay: -22s; }
.evidence__item--h { top: 14%; width: 200px; animation: drift-l 70s linear infinite; animation-delay: -50s; }
.evidence__item--i { top: 88%; width: 250px; animation: drift-r 64s linear infinite; animation-delay: -12s; }

@keyframes drift-r {
  0%   { transform: translate3d(-30vw, 0, 0) rotate(-5deg); opacity: 0; }
  10%  { opacity: 0.65; }
  90%  { opacity: 0.65; }
  100% { transform: translate3d(130vw, -4vh, 0) rotate(3deg); opacity: 0; }
}
@keyframes drift-l {
  0%   { transform: translate3d(130vw, 0, 0) rotate(4deg); opacity: 0; }
  10%  { opacity: 0.62; }
  90%  { opacity: 0.62; }
  100% { transform: translate3d(-30vw, 4vh, 0) rotate(-3deg); opacity: 0; }
}

/* ============================================================
   Petition modal (native <dialog>).
   ============================================================ */
.modal {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--ink);
  max-width: 560px;
  width: calc(100vw - 32px);
  /* Reset native dialog gunk */
  margin: auto;
  inset: 0;
  position: fixed;
}
.modal::backdrop {
  background:
    radial-gradient(ellipse at center, rgba(8,4,0,0.35) 0%, rgba(8,4,0,0.85) 100%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
@keyframes modal-in {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.modal[open] .modal__sheet {
  animation: modal-in 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal__sheet {
  position: relative;
  background:
    linear-gradient(180deg,
      oklch(0.94 0.028 80 / 0.96) 0%,
      oklch(0.91 0.034 78 / 0.94) 100%);
  padding: clamp(28px, 4vw, 44px) clamp(28px, 4vw, 44px) clamp(20px, 3vw, 32px);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.5),
    inset 0 -1px 0 oklch(0 0 0 / 0.10),
    0 24px 60px -16px rgba(20,12,4,0.65);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.6vw, 22px);
  /* Subtle paper noise */
  background-image:
    linear-gradient(180deg,
      oklch(0.94 0.028 80 / 0.96) 0%,
      oklch(0.91 0.034 78 / 0.94) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0.32  0 0 0 0 0.20  0 0 0 0 0.06  0 0 0 0.10 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.modal__close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--type-body);
  font-size: 28px;
  line-height: 1;
  color: var(--ink-soft);
  padding: 4px 8px;
}
.modal__close:hover { color: var(--red); }

.modal__hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--type-body);
  font-size: 10px;
  letter-spacing: 0.20em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
}
.modal__file { font-family: var(--type-num); letter-spacing: 0.06em; color: var(--ink); }

.modal__title {
  font-family: var(--type-heading);
  font-weight: 400;
  letter-spacing: 0.18em;
  font-size: clamp(28px, 4vw, 38px);
  margin: 0;
  color: var(--ink);
  line-height: 1;
}
.modal__sub {
  font-family: var(--type-body);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
  max-width: 50ch;
}
.modal__foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ============================================================
   Toast notification.
   ============================================================ */
.toast {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(40px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  font-family: var(--type-heading);
  letter-spacing: 0.18em;
  font-size: 13px;
  box-shadow: 0 12px 32px -10px rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.24s ease-out;
}
.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast__mark {
  font-family: var(--type-body);
  font-size: 16px;
  color: var(--red);
}

/* ============================================================
   Side ledger — receipt paper auto-scrolling all petitions.
   ============================================================ */
.ledger {
  position: fixed;
  z-index: 8; /* above bg, below doc (10) so doc shadow falls onto it */
  top: 0;
  right: 0;
  height: 100dvh;
  width: 240px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1) 1s;
}
body[data-state="main"] .ledger { opacity: 1; }
.ledger[hidden] { display: none; }

.ledger__roll {
  position: relative;
  width: 200px;
  height: 92dvh;
  background:
    linear-gradient(180deg,
      oklch(0.93 0.030 80 / 0.78) 0%,
      oklch(0.91 0.034 78 / 0.78) 100%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.30),
    0 16px 32px -12px rgba(20,12,4,0.55);
  /* Receipt paper torn edges via mask */
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='40' preserveAspectRatio='none'><path d='M0,0 H200 V35 L195,38 L188,33 L180,38 L172,32 L164,38 L156,34 L148,38 L140,32 L132,37 L124,33 L116,38 L108,34 L100,37 L92,32 L84,38 L76,34 L68,37 L60,33 L52,38 L44,33 L36,37 L28,33 L20,38 L12,34 L4,37 L0,33 Z' fill='black'/></svg>");
  -webkit-mask-size: 100% auto;
  -webkit-mask-position: bottom;
  -webkit-mask-repeat: no-repeat;
  display: flex;
  flex-direction: column;
}

.ledger__hdr {
  flex: 0 0 auto;
  text-align: center;
  padding: 14px 12px 10px;
  border-bottom: 1px dashed var(--ink-faint);
  background: oklch(0.91 0.034 78 / 0.55);
}
.ledger__title {
  display: block;
  font-family: var(--type-heading);
  font-size: 14px;
  letter-spacing: 0.20em;
  color: var(--ink);
}
.ledger__sub {
  display: block;
  font-family: var(--type-body);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  margin-top: 3px;
}

.ledger__viewport {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  padding: 8px 0;
  /* Soft fade at top + bottom so names fade in/out instead of snap */
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 12%, black 88%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, black 12%, black 88%, transparent 100%);
}
.ledger__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  /* JS sets animation when content is ready */
}
.ledger__list.is-rolling {
  animation: ledger-scroll var(--roll-dur, 60s) linear infinite;
}
@keyframes ledger-scroll {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}
.ledger__list li {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-bottom: 1px dashed var(--ink-faint);
  font-family: var(--type-body);
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0.02em;
  position: relative;
}
.ledger__list li::before {
  content: "✕";
  margin-right: 6px;
  color: var(--red);
}
.ledger__list .ledger__msg {
  display: block;
  margin-top: 2px;
  margin-left: 16px;
  font-size: 11px;
  font-style: italic;
  color: var(--ink-soft);
}

.ledger__ftr {
  flex: 0 0 auto;
  text-align: center;
  padding: 10px 12px 14px;
  border-top: 1px dashed var(--ink-faint);
  font-family: var(--type-heading);
  font-size: 10px;
  letter-spacing: 0.20em;
  color: var(--ink-faint);
}

/* Hide ledger on narrow viewports */
@media (max-width: 1180px) {
  .ledger { display: none; }
  .doc { width: min(900px, calc(100vw - 32px)); }
}

/* ============================================================
   Reduced motion.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .evidence { display: none; }
  .doc { transform: none !important; }
  .stamp { opacity: 0.85 !important; filter: none !important; }
  .lock__cta { animation: none; opacity: 1; }
}

/* ============================================================
   Mobile / small screens — stack pages vertically; allow scrolling.
   ============================================================ */
@media (max-width: 900px) {
  .doc { margin: 24px auto; }
  .doc__hdr { grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .barcode { height: 22px; }
  .stamp--received { transform: rotate(8deg) scale(0.7); right: 8px; top: 8px; }
  .countdown__sep { display: none; }
  .ledger { display: none; }
}

/* Phone: pack everything into one viewport, no scroll. */
@media (max-width: 720px) {
  body { overflow: hidden; }
  .doc {
    width: calc(100vw - 16px);
    margin: 8px auto;
    padding: 18px 16px 14px 28px;
    gap: 10px;
    /* Lock the doc to viewport, scale internals */
    max-height: calc(100dvh - 16px);
    min-height: calc(100dvh - 16px);
    overflow: hidden;
  }
  .doc__tab { top: -14px; padding: 4px 14px; font-size: 11px; }
  .doc__punches { left: 4px; gap: 16vh; }
  .doc__punches span { width: 12px; height: 12px; }
  .doc__hdr { padding-bottom: 4px; }
  .doc__hdr .doc__form { font-size: 9px; }
  .doc__hdr .doc__filenum { font-size: 10px; padding: 1px 6px; }

  .mug { padding: 4px 4px 8px; }
  .mug__cap { font-size: 8px; margin-top: 4px; letter-spacing: 0.14em; }
  .mug__tape { width: 38px; height: 10px; }

  .record__row { padding: 3px 0; gap: 8px; grid-template-columns: 80px 1fr; }
  .record__row dt { font-size: 9px; letter-spacing: 0.12em; }
  .record__row dd { font-size: 12px; }
  .record__name { font-size: 14px !important; }
  .record__incarcerated { font-size: 12px !important; padding: 1px 6px; }

  .cta { padding: 9px 14px; font-size: 12px; gap: 8px; letter-spacing: 0.14em; }
  .cta__count { font-size: 10px; }
  .cta__count strong { font-size: 11px; }
  .cta__arrow { font-size: 14px; }

  .feed__hdr { margin-bottom: 2px; }
  .feed__h { font-size: 9px; letter-spacing: 0.16em; }
  .feed__count { font-size: 9px; }

  .countdown { padding: 8px 10px; }
  .countdown__hdr { margin-bottom: 4px; gap: 0; }
  .countdown__h { font-size: 11px; letter-spacing: 0.14em; }
  .countdown__sub { font-size: 8px; }
  .countdown__cell { padding: 4px 8px; min-width: 44px; }
  .countdown__num { font-size: 20px; }
  .countdown__lbl { font-size: 8px; letter-spacing: 0.16em; margin-top: 2px; }

  .doc__ftr { padding-top: 6px; font-size: 9px; letter-spacing: 0.14em; }
  .doc__ftr-stamp { font-size: 9px; padding: 1px 6px; }
  .doc__ftr-meta { display: none; }
  .doc__stain { width: 70px; height: 70px; bottom: -8px; right: 8px; }

  /* Tighter intake spacing */
  .intake__r { gap: 6px; }
}

@media (max-width: 380px) {
  .doc { padding: 14px 10px 10px 22px; }
  .doc__punches { display: none; }
  .record__row { grid-template-columns: 70px 1fr; gap: 6px; }
  .record__row dt { font-size: 8px; }
  .countdown__cell { min-width: 40px; padding: 3px 6px; }
  .countdown__num { font-size: 18px; }
}
@media (max-width: 480px) {
  .doc {
    padding: 24px 18px 32px;
    width: calc(100vw - 16px);
  }
  .countdown__cell { padding: 6px 8px; min-width: 46px; }
  .countdown__grid { gap: 4px; }
}
