/* STFU Crime Lab.

   Two palettes, deliberately separate.

   The ENVIRONMENT (desk, page chrome) is theme-aware. The PAPER is not:
   manila is manila, stamp red is stamp red, tape yellow is tape yellow.
   Physical objects do not restyle themselves when the lights go down, and a
   UI where every surface obediently inverts reads as painted CSS rather than
   as things. In dark mode the desk goes to after-hours and the file stays
   the same file. */

:root {
  /* environment -- theme-aware */
  --desk:        #cfc6b4;
  --desk-deep:   #b8ae99;
  --desk-ink:    #2a2620;
  --desk-muted:  #6b6151;
  --desk-rule:   #a9a08c;

  /* paper -- fixed in every theme */
  --manila:      #e3d3ac;
  --manila-tab:  #d8c69a;
  --manila-edge: #bfa877;
  --thermal:     #f4efe2;
  --ink:         #17150f;
  --ink-faded:   #6f6549;
  --rule:        #b9a87e;
  --tape:        #f2ce00;
  --stamp:       #b3271e;

  /* No webfonts: the CSP blocks external hosts, and a silent fallback on a
     brand page is worse than a system stack chosen on purpose. */
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --cond: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --desk:       #191713;
    --desk-deep:  #0f0e0b;
    --desk-ink:   #e8e0cd;
    --desk-muted: #9b9079;
    --desk-rule:  #3a352b;
  }
}
:root[data-theme="dark"] {
  --desk:       #191713;
  --desk-deep:  #0f0e0b;
  --desk-ink:   #e8e0cd;
  --desk-muted: #9b9079;
  --desk-rule:  #3a352b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--desk-ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  background-image:
    repeating-linear-gradient(92deg, rgba(0,0,0,.020) 0 2px, transparent 2px 7px);
}

#app { max-width: 620px; margin: 0 auto; padding: 0 18px 90px; }
.view[hidden] { display: none; }

/* --- tape --------------------------------------------------------------
   Yellow barrier tape reads "something happened here". Badges, shields and
   seals read "we are the government", which is a deception problem we gain
   nothing from. Every strip carries our own name. */
.tape {
  background: var(--tape);
  color: #100e08;
  font-family: var(--cond);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .30em;
  text-transform: uppercase;
  padding: 10px 0;
  white-space: nowrap;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 2px 0 rgba(0,0,0,.22), 0 10px 22px rgba(0,0,0,.20);
  clip-path: polygon(0 12%, 2% 0, 5% 14%, 8% 2%, 100% 4%,
                     100% 88%, 97% 100%, 94% 86%, 91% 98%, 0 96%);
  transform: rotate(-1.4deg);
}
.tape em { font-style: normal; opacity: .55; padding: 0 .2em; }

/* --- header ------------------------------------------------------------ */
.bar {
  max-width: 620px; margin: 0 auto; padding: 22px 18px 6px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
}
.wordmark {
  font-family: var(--cond); font-weight: 800; font-size: 21px;
  letter-spacing: -.01em; color: var(--desk-ink); text-decoration: none;
}
.wordmark span { color: var(--stamp); }
.auth { display: flex; gap: 14px; align-items: center; }
.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  font-size: 12px; letter-spacing: .10em; text-transform: uppercase;
  color: var(--desk-muted); text-decoration: underline; text-underline-offset: 3px;
}
.linkbtn:hover { color: var(--desk-ink); }
.linkbtn[hidden] { display: none; }

/* --- the folder -------------------------------------------------------- */
.folder {
  position: relative;
  background: var(--manila);
  color: var(--ink);
  border-radius: 2px 2px 3px 3px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    0 1px 0 var(--manila-edge),
    0 16px 34px rgba(0,0,0,.26);
  padding: 30px 26px 32px;
  margin-top: 40px;
  background-image:
    repeating-linear-gradient(101deg, rgba(120,95,45,.045) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(4deg,   rgba(120,95,45,.030) 0 1px, transparent 1px 9px);
}
.folder::before {
  content: attr(data-tab);
  position: absolute; top: -25px; left: 24px;
  background: var(--manila-tab); color: var(--ink-faded);
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  padding: 7px 20px 6px; border-radius: 4px 10px 0 0;
  box-shadow: 0 -1px 0 var(--manila-edge);
}

/* --- ruled form -------------------------------------------------------- */
dl { margin: 0; }
.field {
  display: grid; grid-template-columns: 148px 1fr; gap: 14px;
  align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--rule);
}
.field dt {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faded);
}
.field dd { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
@media (max-width: 460px) { .field { grid-template-columns: 1fr; gap: 2px; } }

.heading-rule {
  font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ink-faded); margin: 26px 0 8px;
  padding-bottom: 5px; border-bottom: 2px solid var(--ink);
}
.flag { color: var(--stamp); font-weight: 700; }

/* --- rubber stamp ------------------------------------------------------
   Verdicts only. Red appearing anywhere decorative destroys its meaning,
   which is "the lab concluded something". */
.stamp {
  display: inline-block;
  border: 3px double var(--stamp); color: var(--stamp);
  font-family: var(--cond); font-weight: 800;
  font-size: 20px; letter-spacing: .16em; text-transform: uppercase;
  padding: 9px 20px 8px; border-radius: 3px;
  transform: rotate(-4.2deg);
  opacity: .88;
  text-shadow: .4px .4px 0 rgba(179,39,30,.30);
  mix-blend-mode: multiply;
}
.stamp.sm { font-size: 13px; padding: 6px 13px 5px; border-width: 2px; }
.stamp.flat { transform: rotate(1.8deg); }
.stamp[hidden] { display: none; }
.stamp-row { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; margin-top: 14px; }

/* --- buttons ----------------------------------------------------------- */
.btn {
  display: inline-block; cursor: pointer;
  font-family: var(--cond); font-weight: 700; font-size: 13px;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 11px 18px; border-radius: 2px;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  text-decoration: none;
}
.btn.primary { background: var(--ink); color: var(--manila); }
.btn:hover { opacity: .82; }
.btn[hidden] { display: none; }

.error {
  color: var(--stamp); font-size: 13px; font-weight: 700; margin: 14px 0 0;
}
.error[hidden] { display: none; }
.fineprint { font-size: 12px; color: var(--ink-faded); line-height: 1.55; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* --- evidence intake --------------------------------------------------- */
.unit {
  font-size: 11px; letter-spacing: .30em; text-transform: uppercase;
  color: var(--ink-faded); margin: 0;
}
.hero-h {
  font-family: var(--cond); font-weight: 800;
  font-size: clamp(28px, 7vw, 40px); line-height: 1.04;
  letter-spacing: -.02em; margin: 10px 0 12px; text-wrap: balance;
}
.hero-p { font-size: 14.5px; margin: 0 0 4px; max-width: 52ch; }
.hero-p em { font-style: normal; color: var(--stamp); font-weight: 700; }

.drop {
  display: block; cursor: pointer;
  border: 2px dashed var(--rule); border-radius: 3px;
  padding: 38px 20px; text-align: center; margin: 24px 0 6px;
  background: rgba(255,255,255,.20);
}
.drop:hover { background: rgba(255,255,255,.38); }
.drop-t {
  display: block; font-family: var(--cond); font-weight: 800;
  font-size: 18px; margin-bottom: 5px;
}
.drop-s { display: block; font-size: 11.5px; color: var(--ink-faded); }

.straight {
  margin: 22px 0 0; padding-top: 15px; border-top: 1px solid var(--rule);
  max-width: 62ch;
}

/* --- the bench ---------------------------------------------------------
   Lines print as their stage reports. A step ahead of the pipeline shows
   nothing at all -- paper that has not fed out yet is not there. */
.bench { list-style: none; padding: 0; margin: 18px 0 0; font-size: 13px; }
.bench li { display: none; padding: 8px 0 8px 22px; position: relative;
            border-bottom: 1px dotted var(--rule); }
.bench li.active, .bench li.done {
  display: block;
  animation: feed .34s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes feed {
  from { opacity: 0; transform: translateY(-7px); clip-path: inset(100% 0 0 0); }
  to   { opacity: 1; transform: none;             clip-path: inset(0 0 0 0); }
}
.bench li::before { position: absolute; left: 0; }
.bench li.done::before  { content: "\2713"; color: var(--ink-faded); }
.bench li.done          { color: var(--ink-faded); }
.bench li.active::before{ content: "\203A"; color: var(--stamp); font-weight: 800; }
.bench li.active        { font-weight: 700; }
.bench li.active .s-label::after {
  content: "_"; margin-left: 3px; color: var(--stamp);
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink { 0%,49%{opacity:1} 50%,100%{opacity:0} }
.s-found { display: block; margin-top: 2px; font-weight: 700; color: var(--stamp); }
.bench li.done .s-found { color: var(--ink); }
#printNote { margin-top: 18px; }

/* --- case file --------------------------------------------------------- */
.subject {
  font-family: var(--cond); font-weight: 800;
  font-size: 28px; letter-spacing: -.015em; margin: 10px 0 2px;
  text-wrap: balance;
}
.subject-sub { font-size: 12.5px; color: var(--ink-faded); margin: 0; }
.r-body { font-size: 13.5px; margin: 8px 0 0; }

/* --- the printout inside the file -------------------------------------- */
.printout {
  position: relative;
  background: var(--thermal); color: var(--ink);
  margin: 34px auto 0; padding: 22px 20px 26px; max-width: 380px;
  box-shadow: 0 3px 12px rgba(0,0,0,.18);
  font-size: 12.5px;
}
.printout::before, .printout::after {
  content: ""; position: absolute; left: 0; right: 0; height: 7px;
  background: repeating-linear-gradient(-45deg, var(--thermal) 0 5px, transparent 5px 10px);
}
.printout::before { top: -6px; }
.printout::after  { bottom: -6px; transform: scaleY(-1); }
.p-brand {
  font-weight: 700; letter-spacing: .26em; font-size: 11px;
  text-transform: uppercase; margin: 0 0 2px;
}
.p-meta { color: var(--ink-faded); font-size: 10.5px; margin: 0 0 12px; }
.p-line {
  display: flex; justify-content: space-between; gap: 10px;
  margin: 5px 0; font-variant-numeric: tabular-nums;
}
.p-line[hidden] { display: none; }
.p-line span { color: var(--ink-faded); }
.p-rule { border-top: 1px dashed var(--rule); margin: 12px 0; }
.p-rule.double { border-top: 3px double var(--rule); }
.p-foot {
  text-align: center; letter-spacing: .16em; font-size: 10.5px;
  margin: 16px 0 0; color: var(--ink-faded);
}
.p-plain { letter-spacing: 0; text-transform: none; display: inline-block; margin-top: 6px; }

/* --- the account ask --------------------------------------------------- */
.save-prompt {
  max-width: 620px; margin: 26px auto 0; padding: 18px 20px;
  border: 1px solid var(--desk-rule); border-radius: 2px;
}
.save-head { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--desk-ink); }
.save-why { margin: 0 0 14px; font-size: 13px; color: var(--desk-muted); }
.save-why[hidden] { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* --- sign-in modal, as an intake slip ---------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(12,10,6,.62);
}
.modal[hidden] { display: none; }
.modal-card {
  position: relative; width: 100%; max-width: 380px;
  background: var(--manila); color: var(--ink);
  border-radius: 2px; padding: 28px 26px 26px;
  box-shadow: 0 18px 50px rgba(0,0,0,.42);
  background-image:
    repeating-linear-gradient(101deg, rgba(120,95,45,.045) 0 1px, transparent 1px 5px);
}
.modal-card h2 {
  font-family: var(--cond); font-weight: 800; font-size: 20px; margin: 0 0 6px;
}
.modal-card .lede { margin: 0 0 18px; font-size: 13.5px; color: var(--ink-faded); }
.modal-card label {
  display: block; margin-bottom: 16px; font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faded);
}
.modal-card input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px;
  font-family: var(--mono); font-size: 15px;
  background: var(--thermal); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 2px;
  text-transform: none; letter-spacing: 0;
}
.modal-card .btn { width: 100%; }
.modal-card .btn + .btn { margin-top: 8px; }
.modal-x {
  position: absolute; top: 6px; right: 10px;
  background: none; border: 0; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--ink-faded);
}
#authCode { font-size: 26px; letter-spacing: .34em; text-align: center; }

/* --- wizard form ------------------------------------------------------- */
#wizard label {
  display: block; margin: 16px 0; font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faded);
}
#wizard input, #wizard select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  font-family: var(--mono); font-size: 15px;
  background: var(--thermal); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 2px;
  text-transform: none; letter-spacing: 0;
}
#wizard small {
  display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.5;
  color: var(--ink-faded); text-transform: none; letter-spacing: 0;
}
#wizard label.check {
  display: flex; gap: 10px; align-items: flex-start;
  text-transform: none; letter-spacing: 0; font-size: 13px;
}
#wizard label.check input { width: auto; margin: 3px 0 0; }
#wizard .btn { margin-right: 8px; }
.note-inline {
  border-left: 3px solid var(--stamp); padding: 2px 0 2px 14px; margin: 20px 0;
  font-size: 13px;
}
.note-inline[hidden] { display: none; }
.dnc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 10px; }
#dncYear { max-width: 150px; }
#dncRegistered[hidden] { display: none; }

/* --- folder tabs -------------------------------------------------------
   Real file-folder tabs, so the front of the product reads as one file with
   three sections rather than three pages. */
.tabs { display: flex; gap: 4px; margin: 40px 0 0; padding-left: 12px; }
.tab {
  cursor: pointer; border: 0; border-radius: 4px 10px 0 0;
  padding: 9px 16px 8px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .16em; text-transform: uppercase;
  background: var(--manila-tab); color: var(--ink-faded);
  box-shadow: inset 0 -3px 6px rgba(120,95,45,.16);
}
.tab.is-on {
  background: var(--manila); color: var(--ink); font-weight: 700;
  box-shadow: none;
}
.tab:not(.is-on):hover { color: var(--ink); }
/* the tab strip replaces the single printed tab */
.folder-tabbed { margin-top: 0; }
.folder-tabbed::before { content: none; }
.panel[hidden] { display: none; }

/* --- how it works ------------------------------------------------------ */
.proc { margin: 18px 0 0; padding-left: 20px; font-size: 13.5px; }
.proc li { margin-bottom: 11px; }
.proc b { font-weight: 700; }
.tiers .field { align-items: center; }
.tiers .stamp { transform: rotate(-2deg); }
.nots { margin: 10px 0 0; padding-left: 20px; font-size: 13.5px; }
.nots li { margin-bottom: 8px; }

/* --- the ledger --------------------------------------------------------
   A docket board, deliberately NOT a wanted poster. These are settlements
   of civil claims, most expressly denying liability; a poster asserting
   guilt about a named company is the one thing this product must never do.
   Same grid, honest frame. */
.ledger {
  display: grid; gap: 10px; margin: 22px 0 18px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
.lcard {
  border: 1px solid var(--rule); border-radius: 2px;
  padding: 14px 14px 13px; background: rgba(255,255,255,.22);
}
.l-amt {
  margin: 0; font-family: var(--cond); font-weight: 800;
  font-size: 27px; letter-spacing: -.02em; color: var(--stamp);
  font-variant-numeric: tabular-nums;
}
.l-who { margin: 3px 0 0; font-size: 13.5px; font-weight: 700; }
.l-meta {
  margin: 2px 0 8px; font-size: 10.5px; letter-spacing: .10em;
  text-transform: uppercase; color: var(--ink-faded);
}
.l-what { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-faded); }
