/* smishield: a lie detector for text messages.
   Visual language: polygraph chart paper, red evidence pen, pencil notes, rubber stamps.
   Shape rule: paper things (sheets, buttons, folders) use --r-paper (2px); only the phone
   is rounded, because it is a physical device on the table. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-var.woff2") format("woff2-variations"), url("fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --paper: #f3f5f0;
  --sheet: #fbfcf9;
  --ink: #161b1a;
  --ink-2: #48524e;
  --rule: #cdd7cf;
  --grid-minor: rgb(46 120 88 / 0.10);
  --grid-major: rgb(46 120 88 / 0.24);
  --red: #b3202a;
  --red-wash: rgb(179 32 42 / 0.07);
  --pencil: #44586d;
  --folder: #e2e9de;
  --folder-edge: #b9c7b8;
  --device: #1a1e1d;
  --device-edge: #3a403e;
  --screen: #fdfdfb;
  --bubble: #e7ebe7;
  --shadow: rgb(30 52 42 / 0.16);
  --r-paper: 2px;
  --font-sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1412;
    --sheet: #161c19;
    --ink: #e2e8e3;
    --ink-2: #a2ada7;
    --rule: #2c3530;
    --grid-minor: rgb(120 200 160 / 0.06);
    --grid-major: rgb(120 200 160 / 0.14);
    --red: #f2776c;
    --red-wash: rgb(242 119 108 / 0.08);
    --pencil: #a8bccf;
    --folder: #1c2420;
    --folder-edge: #34413a;
    --device: #262c2a;
    --device-edge: #46504c;
    --screen: #121715;
    --bubble: #232b28;
    --shadow: rgb(0 0 0 / 0.45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-sans);
  font-stretch: 100%;
  overflow-x: hidden;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 0.9rem; border-radius: var(--r-paper);
}
.skip:focus { top: 1rem; }

h1, h2, h3 { text-wrap: balance; }

kbd {
  font: 600 0.78rem var(--font-mono);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: var(--r-paper);
  padding: 0 0.3rem;
  background: var(--sheet);
}

/* ---------- Masthead ---------- */

.masthead {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1.5rem;
}
.wordmark {
  display: inline-block;
  margin: 0 0 1rem;
  font: 800 0.95rem/1 var(--font-sans);
  font-stretch: 75%;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  border: 2px solid currentColor;
  padding: 0.35rem 0.55rem 0.3rem;
  transform: rotate(-2deg);
}
.masthead h1 {
  margin: 0;
  max-width: 19ch;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  font-weight: 800;
  font-stretch: 72%;
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.lede {
  margin: 1rem 0 0;
  max-width: 54ch;
  font-size: 1.08rem;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Bench: phone on the left, instrument and finding on the right ---------- */

.bench {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.subject { position: sticky; top: 1.25rem; }

/* Phone */
.phone {
  position: relative;
  background: var(--device);
  border-radius: 40px;
  padding: 2.4rem 0.75rem 1.1rem;
  box-shadow:
    inset 0 0 0 1.5px var(--device-edge),
    0 1px 0 var(--device-edge),
    0 22px 40px -18px var(--shadow),
    0 6px 12px -6px var(--shadow);
  transform: rotate(-1.2deg);
}
.phone-notch {
  position: absolute; top: 0.85rem; left: 50%;
  width: 84px; height: 20px; margin-left: -42px;
  border-radius: 999px;
  background: #0b0d0c;
}
.phone-contact {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--screen);
  border-radius: 26px 26px 0 0;
  padding: 0.9rem 0.9rem 0.7rem;
  border-bottom: 1px solid var(--rule);
}
.avatar {
  flex: none;
  width: 2.2rem; height: 2.2rem;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bubble);
  color: var(--ink-2);
  font: 700 1rem var(--font-sans);
}
.contact-field { flex: 1; min-width: 0; }
.contact-field label {
  display: block;
  font: 600 0.72rem/1.2 var(--font-mono);
  color: var(--ink-2);
}
.optional { font-weight: 400; }
#sender {
  width: 100%;
  border: 0;
  border-bottom: 1px dashed var(--rule);
  background: transparent;
  color: var(--ink);
  font: 600 1rem/1.4 var(--font-sans);
  padding: 0.15rem 0;
  border-radius: 0;
}
#sender::placeholder { color: var(--ink-2); font-weight: 400; }
#sender:focus-visible { outline-offset: 3px; }

.phone-screen {
  background: var(--screen);
  border-radius: 0 0 26px 26px;
  padding: 1rem 0.9rem 1.2rem;
  min-height: 15rem;
}
.bubble-label {
  display: block;
  text-align: center;
  font: 400 0.72rem var(--font-mono);
  color: var(--ink-2);
  margin-bottom: 0.6rem;
}
.bubble {
  display: block;
  width: 92%;
  min-height: 9rem;
  max-height: 22rem;
  resize: vertical;
  border: 0;
  border-radius: 18px 18px 18px 5px;
  background: var(--bubble);
  color: var(--ink);
  font: 400 1rem/1.45 var(--font-sans);
  padding: 0.7rem 0.85rem;
}
.bubble::placeholder { color: var(--ink-2); }

/* Run button */
.run { margin-top: 1.5rem; }
.run-button {
  width: 100%;
  appearance: none;
  border: 2px solid var(--ink);
  border-radius: var(--r-paper);
  background: var(--ink);
  color: var(--paper);
  font: 800 1.15rem/1 var(--font-sans);
  font-stretch: 80%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1rem 1.2rem;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--red);
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 160ms;
}
.run-button:hover:not(:disabled) { box-shadow: 0 5px 0 var(--red); transform: translateY(-2px); }
.run-button:active:not(:disabled) { box-shadow: 0 1px 0 var(--red); transform: translateY(2px); }
.run-button:disabled { opacity: 0.55; cursor: progress; box-shadow: none; }
.run-hint {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-2);
  text-align: center;
}
.status {
  min-height: 1.4em;
  margin: 0.7rem 0 0;
  font: 400 0.85rem/1.4 var(--font-mono);
  color: var(--ink-2);
}
.status.error { color: var(--red); font-weight: 600; }

/* Case files: manila-style folders with tabs */
.cases { margin-top: 1.75rem; display: grid; gap: 0.9rem; }
.cases-heading {
  margin: 0 0 0.1rem;
  font: 800 1rem var(--font-sans);
  font-stretch: 75%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.case {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.75rem;
  text-align: left;
  appearance: none;
  color: var(--ink);
  background: var(--folder);
  border: 1px solid var(--folder-edge);
  border-radius: var(--r-paper);
  padding: 0.75rem 0.9rem 0.7rem;
  cursor: pointer;
  font: inherit;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 180ms;
}
.case::before {
  /* the folder tab */
  content: "";
  position: absolute; top: -7px; left: 0.6rem;
  width: 4.6rem; height: 8px;
  background: var(--folder);
  border: 1px solid var(--folder-edge);
  border-bottom: 0;
  border-radius: var(--r-paper) var(--r-paper) 0 0;
}
.case:hover { transform: translateX(4px); box-shadow: -4px 4px 0 var(--folder-edge); }
.case:active { transform: translateX(2px) translateY(1px); box-shadow: none; }
.case[aria-pressed="true"] { border-color: var(--red); box-shadow: -4px 4px 0 var(--red-wash), inset 3px 0 0 var(--red); }
.case-tab {
  grid-row: span 2;
  align-self: center;
  font: 600 0.72rem var(--font-mono);
  color: var(--ink-2);
  writing-mode: horizontal-tb;
  border-right: 1px solid var(--folder-edge);
  padding-right: 0.75rem;
}
.case-title { font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.case-meta { font-size: 0.82rem; color: var(--ink-2); line-height: 1.3; }

/* ---------- Instrument: chart paper strip ---------- */

.record { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; min-width: 0; }

.instrument-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.instrument h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  font-stretch: 75%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.readout {
  margin: 0;
  font: 600 1.6rem/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.readout-label { font-size: 0.75rem; font-weight: 400; color: var(--ink-2); margin-right: 0.25rem; }

.chart {
  position: relative;
  height: clamp(200px, 30vw, 270px);
  background-color: var(--sheet);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 60px 50px, 60px 50px, 12px 10px, 12px 10px;
  background-position: -1px -1px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink);
  border-radius: var(--r-paper);
  overflow: hidden;
}
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.zone { fill: var(--red-wash); }
.threshold {
  stroke: var(--red);
  stroke-width: 1.25;
  stroke-dasharray: 6 5;
  vector-effect: non-scaling-stroke;
  opacity: 0.8;
}
.trace {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.25;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.pen-arm {
  stroke: var(--ink-2);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0.6;
}
.pen {
  position: absolute;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  left: 100%; top: 95%;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px var(--sheet), 0 0 0 4px var(--red);
  transition: none;
}
.chart.idle .pen { left: calc(100% - 18px); top: 95%; }
.axis, .zone-label {
  position: absolute;
  font: 400 0.7rem/1 var(--font-mono);
  color: var(--ink-2);
  background: var(--sheet);
  padding: 0.1rem 0.25rem;
  pointer-events: none;
}
.axis { left: 0.4rem; }
.axis-top { top: 0.35rem; }
.axis-mid { top: 50%; transform: translateY(-50%); color: var(--red); }
.axis-low { bottom: 0.35rem; }
.zone-label { left: 3.6rem; top: 0.35rem; color: var(--red); }

.chart-caption {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-2);
  max-width: 70ch;
}

/* ---------- Examiner's finding: a typed report sheet ---------- */

.finding {
  position: relative;
  overflow-wrap: anywhere;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-paper);
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: 0 18px 30px -24px var(--shadow);
}
.finding-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--ink);
}
.form-title {
  margin: 0;
  font: 600 0.85rem var(--font-mono);
  color: var(--ink-2);
}
.stamp {
  margin: 0;
  font: 900 clamp(1.35rem, 3.2vw, 2rem)/1 var(--font-sans);
  font-stretch: 68%;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--stamp, var(--red));
  border: 3px solid currentColor;
  box-shadow: inset 0 0 0 2px var(--sheet), inset 0 0 0 4px currentColor;
  padding: 0.55rem 0.8rem 0.5rem;
  transform: rotate(-3deg);
  mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) { .stamp { mix-blend-mode: normal; } }
.finding.ham .stamp { --stamp: var(--ink); }

.readings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-bottom: 1px solid var(--rule);
}
.readings > div { padding: 0.85rem 0.75rem 0.85rem 0; }
.readings > div + div { padding-left: 0.85rem; border-left: 1px solid var(--rule); }
.readings dt { font-size: 0.78rem; color: var(--ink-2); }
.readings dd {
  margin: 0.15rem 0 0;
  font: 600 1.25rem/1.2 var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.finding.spam #probability { color: var(--red); }

.close-call {
  margin: 1rem 0 0;
  font: 600 0.9rem var(--font-mono);
  color: var(--red);
  border-left: 3px solid var(--red);
  padding-left: 0.7rem;
}
.summary { margin: 1rem 0 0; max-width: 68ch; text-wrap: pretty; }

.sheet-heading {
  margin: 1.6rem 0 0.6rem;
  font: 800 0.95rem var(--font-sans);
  font-stretch: 75%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.transcript-wrap {
  background-image: linear-gradient(var(--rule) 1px, transparent 1px);
  background-size: 100% 2.3rem;
  background-position: 0 2.05rem;
  padding: 0.1rem 0 0.5rem;
}
.transcript {
  margin: 0;
  font: 400 1.05rem/2.3rem var(--font-mono);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* Evidence marks */
.mark {
  position: relative;
  display: inline-block;
  padding: 0 0.15em;
  white-space: nowrap;
}
.mark-spam::before {
  /* hand-drawn red ellipse */
  content: "";
  position: absolute;
  inset: -0.32em -0.38em -0.28em -0.36em;
  pointer-events: none;
  background: no-repeat center / 100% 100% var(--circle);
  clip-path: inset(0 0 0 0);
}
.mark-spam.v1 { --circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M8 22C6 10 30 4 52 4s42 5 42 15-18 17-46 17S5 30 9 18c3-8 18-12 34-13' fill='none' stroke='%23b3202a' stroke-width='2.6' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
.mark-spam.v2 { --circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M90 10C82 3 60 2 40 4S4 12 5 22s20 15 48 14 43-8 42-18c-1-7-12-11-26-12' fill='none' stroke='%23b3202a' stroke-width='2.6' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
.mark-spam.v3 { --circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M14 8C28 2 74 2 90 10s4 24-30 26S3 33 6 20C8 12 22 7 40 6' fill='none' stroke='%23b3202a' stroke-width='2.6' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) {
  .mark-spam.v1 { --circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M8 22C6 10 30 4 52 4s42 5 42 15-18 17-46 17S5 30 9 18c3-8 18-12 34-13' fill='none' stroke='%23f2776c' stroke-width='2.6' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
  .mark-spam.v2 { --circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M90 10C82 3 60 2 40 4S4 12 5 22s20 15 48 14 43-8 42-18c-1-7-12-11-26-12' fill='none' stroke='%23f2776c' stroke-width='2.6' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
  .mark-spam.v3 { --circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M14 8C28 2 74 2 90 10s4 24-30 26S3 33 6 20C8 12 22 7 40 6' fill='none' stroke='%23f2776c' stroke-width='2.6' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
}
.mark-spam { color: var(--red); font-weight: 600; }
.mark-link {
  display: inline;
  white-space: pre-wrap;
  padding: 0;
  color: var(--red);
  font-weight: 600;
  text-decoration: underline wavy var(--red) 1.5px;
  text-underline-offset: 5px;
}
.mark-link::before { content: none; }
.mark-ham {
  color: var(--pencil);
  text-decoration: underline dashed var(--pencil) 1.5px;
  text-underline-offset: 6px;
}
.mark sup {
  position: absolute;
  top: -1.05em;
  right: -0.9em;
  min-width: 1.15rem; height: 1.15rem;
  display: grid; place-items: center;
  font: 600 0.66rem/1 var(--font-mono);
  border-radius: 50%;
  background: var(--red);
  color: var(--sheet);
  pointer-events: none;
}
.mark-link sup { position: relative; top: -0.7em; right: auto; margin-left: 0.2em; display: inline-grid; }
.mark-ham sup { background: transparent; color: var(--pencil); border: 1px solid var(--pencil); }

.key {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem;
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-2);
}
.key-item { display: inline-flex; align-items: center; gap: 0.45rem; }
.key-swatch { display: inline-block; width: 1.6rem; height: 0.9rem; }
.key-spam { border: 2px solid var(--red); border-radius: 50%; }
.key-ham { border-bottom: 2px dashed var(--pencil); height: 0.6rem; }

.exhibits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2rem;
}
.exhibit-list { list-style: none; margin: 0; padding: 0; counter-reset: ex; }
.exhibit-list li {
  counter-increment: ex;
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--rule);
  font-family: var(--font-mono);
  font-size: 0.92rem;
}
.exhibit-list li::before {
  content: counter(ex);
  display: grid; place-items: center;
  width: 1.3rem; height: 1.3rem;
  border-radius: 50%;
  font-size: 0.7rem; font-weight: 600;
}
.exhibit-spam li::before { background: var(--red); color: var(--sheet); }
.exhibit-ham li::before { border: 1px solid var(--pencil); color: var(--pencil); }
.exhibit-list .term { overflow-wrap: anywhere; }
.exhibit-list .weight { font-weight: 600; font-variant-numeric: tabular-nums; }
.exhibit-spam .weight { color: var(--red); }
.exhibit-ham .weight { color: var(--pencil); }
.exhibit-list li.none { display: block; color: var(--ink-2); font-family: var(--font-sans); border: 0; }
.exhibit-list li.none::before { content: none; }

.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.notes li {
  padding-left: 1.1rem;
  position: relative;
  max-width: 72ch;
}
.notes li::before {
  content: "";
  position: absolute; left: 0; top: 0.65em;
  width: 0.55rem; height: 2px;
  background: var(--ink);
}
.notes strong { font-weight: 700; }
.notes li.none { color: var(--ink-2); padding-left: 0; }
.notes li.none::before { content: none; }

.fine { margin: 0.6rem 0 0; font-size: 0.82rem; color: var(--ink-2); max-width: 70ch; }

/* ---------- Calibration record ---------- */

.calibration {
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  background-color: var(--sheet);
  background-image:
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 24px 24px;
}
.calibration-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 3.25rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1.2fr;
  gap: 2.5rem;
  align-items: end;
}
.calibration h2, .limits h2, .method h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  font-stretch: 72%;
  line-height: 1;
  text-transform: uppercase;
}
.cal-copy { margin: 0.75rem 0 0; color: var(--ink-2); max-width: 36ch; }
.cal-f1 { margin: 1.5rem 0 0; display: grid; }
.cal-big {
  font: 800 clamp(3.6rem, 8vw, 5.8rem)/0.9 var(--font-sans);
  font-stretch: 72%;
  font-variant-numeric: tabular-nums;
}
.cal-big-label { font-size: 0.9rem; color: var(--ink-2); margin-top: 0.4rem; }
.cal-grid { margin: 0; display: grid; gap: 0.9rem; }
.cal-grid > div { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--rule); padding-bottom: 0.5rem; }
.cal-grid dt { color: var(--ink-2); }
.cal-grid dd { margin: 0; font: 600 1.5rem var(--font-mono); font-variant-numeric: tabular-nums; }

.cm { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.cm caption { text-align: left; font-size: 0.82rem; color: var(--ink-2); padding-bottom: 0.5rem; }
.cm th { font-weight: 600; font-size: 0.82rem; text-align: left; padding: 0.4rem 0.6rem 0.4rem 0; color: var(--ink-2); }
.cm thead th { text-align: right; }
.cm td { padding: 0.55rem 0.7rem; text-align: right; font: 600 1.5rem var(--font-mono); border: 1px solid var(--rule); background: var(--paper); }
.cm td:first-child { border: 0; background: transparent; }
.cm .cm-wrong { color: var(--red); }

/* ---------- Limits and method ---------- */

.limits, .method {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.25rem 1.5rem 0;
}
.limits-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 3rem;
  counter-reset: lim;
}
.limits-list li {
  counter-increment: lim;
  position: relative;
  padding-left: 2.4rem;
  max-width: 60ch;
  text-wrap: pretty;
}
.limits-list li::before {
  content: counter(lim);
  position: absolute; left: 0; top: 0;
  font: 600 1.4rem/1.1 var(--font-mono);
  color: var(--red);
}
.method { padding-bottom: 1rem; }
.method-steps {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
}
.method-steps li {
  padding: 1rem 1.25rem 0 0;
  font-size: 0.95rem;
  text-wrap: pretty;
}
.method-steps li + li { padding-left: 1.25rem; border-left: 1px solid var(--rule); }
.step-name {
  display: block;
  font: 800 1.25rem var(--font-sans);
  font-stretch: 75%;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}
.method-foot { margin: 2rem 0 0; font-size: 0.9rem; color: var(--ink-2); max-width: 80ch; }

.colophon {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding: 1.25rem 1.5rem 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--ink-2);
}
.colophon p { margin: 0; max-width: 90ch; }

/* ---------- Motion (only when the reader allows it) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .finding.reveal .stamp { animation: stamp-in 420ms cubic-bezier(0.2, 1.4, 0.4, 1) both; }
  .finding.reveal .mark-spam::before { animation: circle-in 520ms cubic-bezier(0.6, 0, 0.3, 1) both; animation-delay: calc(var(--i, 0) * 90ms + 150ms); }
  .finding.reveal .mark sup { animation: tag-in 260ms ease-out both; animation-delay: calc(var(--i, 0) * 90ms + 450ms); }
  .finding.reveal .mark-ham { animation: pencil-in 500ms ease-out both; animation-delay: calc(var(--i, 0) * 90ms + 200ms); }
  .finding.waiting .stamp, .finding.waiting .mark-spam::before, .finding.waiting .mark sup { visibility: hidden; }
  .pen.writing { animation: pen-tick 120ms steps(2) infinite; }
}
@keyframes stamp-in {
  0% { transform: rotate(-9deg) scale(1.6); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: rotate(-3deg) scale(1); opacity: 1; }
}
@keyframes circle-in {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes tag-in {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes pencil-in {
  from { text-decoration-color: transparent; }
  to { text-decoration-color: var(--pencil); }
}
@keyframes pen-tick {
  50% { box-shadow: 0 0 0 3px var(--sheet), 0 0 0 5px var(--red); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .calibration-inner { grid-template-columns: 1fr 1fr; }
  .cm-block { grid-column: 1 / -1; }
  .method-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-steps li:nth-child(3) { padding-left: 0; border-left: 0; }
}

@media (max-width: 860px) {
  .bench { grid-template-columns: minmax(0, 1fr); gap: 2.25rem; }
  .subject { position: static; max-width: 420px; width: 100%; margin: 0 auto; }
}

@media (max-width: 640px) {
  .masthead { padding: 1.75rem 1rem 1.25rem; }
  .bench { padding: 0 1rem 2.5rem; }
  .phone { transform: none; }
  .finding { padding: 1.25rem 1rem 1.1rem; margin: 0 -0.25rem; }
  .readings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readings > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .readings > div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .exhibits { grid-template-columns: minmax(0, 1fr); }
  .calibration-inner { grid-template-columns: minmax(0, 1fr); padding: 2.5rem 1rem; gap: 2rem; }
  .limits, .method { padding: 2.5rem 1rem 0; }
  .limits-list { grid-template-columns: minmax(0, 1fr); }
  .method-steps { grid-template-columns: minmax(0, 1fr); }
  .method-steps li, .method-steps li + li { padding: 1rem 0 0; border-left: 0; }
  .method-steps li + li { border-top: 1px solid var(--rule); margin-top: 1rem; }
  .colophon { padding: 1.25rem 1rem 2rem; }
  .zone-label { display: none; }
  .cm td { font-size: 1.2rem; padding: 0.45rem 0.5rem; }
}

@media (forced-colors: active) {
  .mark-spam::before { content: none; }
  .mark-spam { outline: 2px solid CanvasText; border-radius: 50%; }
  .stamp { border-color: CanvasText; }
}
