/* ==========================================================================
   Invenio Protocols — master stylesheet
   Tokens first. Edit here; every page links this file.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------
   Self-hosted. Deliberately not Google Fonts CDN: an Irish firm publishing a
   GDPR page should not hand every visitor's IP to a US font CDN.
   ------------------------------------------------------------------------- */

@font-face {
  font-family: 'Source Serif 4';
  src: url('fonts/source-serif-4-var-latin.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-stretch: normal;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  /* Surface. Warm off-white, never #fff — this is paper, not screen. */
  --paper: #fbfaf7;
  --paper-sunk: #f3f1ea;

  /* Ink */
  --ink: #16181a;          /* 15.9:1 on paper */
  --ink-2: #3d4145;        /* 9.1:1  */
  --ink-3: #5e6367;        /* 5.4:1  — floor for body-size text */

  /* Rules */
  --rule: #ddd8cc;
  --rule-strong: #bdb7a6;

  /* Accent. Graphic use only at this value. */
  --seal: #8a6e3c;
  --seal-text: #6f5628;    /* 5.9:1 — the value any accent *text* uses */
  --seal-wash: #f2ede1;

  /* Risk semantics — desaturated, never traffic-light */
  --risk-proceed: #4a6250;
  --risk-adjust: #856232;
  --risk-deprioritise: #6b6f72;
  --risk-exclude: #7a3f38;

  /* Type */
  --serif: 'Source Serif 4', 'Iowan Old Style', 'Palatino Linotype', Palatino,
    Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.1875rem;
  --step-2: clamp(1.35rem, 1.05rem + 1vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.25rem + 2.1vw, 2.55rem);
  --step-4: clamp(2.5rem, 1.5rem + 4.2vw, 4rem);

  /* Space */
  --gutter: clamp(1.25rem, 4vw, 2.75rem);
  --rail: 9.5rem;
  --measure: 68ch;
}

/* --- Reset ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: var(--step-0);
  line-height: 1.62;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { max-width: 100%; display: block; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--seal-text);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection { background: var(--seal-wash); color: var(--ink); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  font-family: var(--mono);
  font-size: var(--step--1);
}
.skip:focus { left: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Primitives ----------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.measure { max-width: var(--measure); }

/* The margin rail: section mark left, argument right. This asymmetry is the
   whole layout POV — it is what keeps the page from becoming centred hero +
   card row. */
.rail {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
}

.rail__mark {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--seal-text);
  padding-top: 0.5rem;
  border-top: 2px solid var(--seal);
  align-self: start;
  position: sticky;
  top: 6rem;
}
.rail__mark span {
  display: block;
  color: var(--ink-3);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
}

.rail__body { padding-top: 0.35rem; min-width: 0; }

@media (max-width: 56rem) {
  .rail { grid-template-columns: 1fr; gap: 0; }
  .rail__mark {
    position: static;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
  }
  .rail__mark span { margin-top: 0; }
}

/* Type */

h1, h2, h3 {
  font-weight: 400;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
  line-height: 1.03;
  letter-spacing: -0.028em;
}

h2 {
  font-size: var(--step-3);
  line-height: 1.13;
}

h3 {
  font-size: var(--step-1);
  letter-spacing: -0.008em;
  line-height: 1.3;
}

.lede {
  font-size: var(--step-2);
  line-height: 1.42;
  color: var(--ink-2);
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

p { text-wrap: pretty; }
p + p { margin-top: 1.1em; }

.dim { color: var(--ink-3); }

.label {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.85rem 1.35rem;
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: background-color 140ms ease-out, color 140ms ease-out,
    border-color 140ms ease-out;
}

.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--seal-text); border-color: var(--seal-text); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn--ghost:hover { border-color: var(--ink); background: var(--seal-wash); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Inline link */
.link {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--seal-text);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 2px;
  transition: border-color 140ms ease-out;
}
.link:hover { border-color: var(--seal-text); }

/* --- Header --------------------------------------------------------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}

.site-head__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.75rem;
}

/* The wordmark is the primary tier: larger, heavier, and tied tightly to its
   mark. The mark is sized in em so it scales with the type rather than drifting
   away from it. */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.46em;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.032em;
  white-space: nowrap;
  line-height: 1;
}

.wordmark svg {
  flex: none;
  width: 0.875em;
  height: 1.05em;
}

/* The nav is deliberately a second tier: smaller, lighter in colour, and set in
   the same tracked uppercase mono the site already uses for furniture. */
.nav ul {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.1vw, 1.75rem);
}

.nav a {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-3);
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease-out, border-color 140ms ease-out;
}
.nav a:hover { color: var(--ink); border-color: var(--seal); }
.nav a[aria-current='page'] { color: var(--ink); border-color: var(--seal); }

.nav__toggle {
  display: none;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  background: none;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  padding: 0.5rem 0.85rem;
  cursor: pointer;
}

@media (max-width: 46rem) {
  .site-head__in { min-height: 4.25rem; }
  .wordmark { font-size: 1.3rem; }
  .nav__toggle { display: inline-block; }
  .nav {
    position: absolute;
    inset: 100% 0 auto 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    display: none;
  }
  .nav[data-open='true'] { display: block; }
  .nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--gutter);
  }
  .nav a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: var(--step-0);
  }
}

/* --- Sections ------------------------------------------------------------- */

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  border-top: 1px solid var(--rule);
}

.section__head { margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem); }
.section__head h2 { max-width: 24ch; }
.section__head .lede { margin-top: 1.1rem; max-width: var(--measure); }

/* --- Hero ----------------------------------------------------------------- */

.hero {
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 7vw, 5rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: start;
}

@media (max-width: 60rem) {
  .hero__grid { grid-template-columns: 1fr; }
}

.hero__kicker {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.6rem;
}
.hero__kicker::before {
  content: '';
  width: 2.25rem;
  height: 2px;
  background: var(--seal);
  flex: none;
}

.hero h1 { max-width: 15ch; }
.hero__sub { margin-top: 1.5rem; max-width: 54ch; }
.hero .btn-row { margin-top: 2.25rem; }

/* --- Specimen record ------------------------------------------------------
   The only bordered box on the page, and it is earned: it depicts a document.
   -------------------------------------------------------------------------- */

.specimen {
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  box-shadow: 0 1px 0 var(--rule), 0 14px 28px -22px rgba(22, 24, 26, 0.45);
}

.specimen__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--rule-strong);
  background: var(--seal-wash);
}

.specimen__title {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.specimen__stamp {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--seal-text);
  border: 1px solid var(--seal);
  padding: 0.15rem 0.5rem;
}

.specimen dl { display: grid; }

.specimen__row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 0.8rem 1.15rem;
  border-bottom: 1px solid var(--rule);
}
.specimen__row:last-child { border-bottom: 0; }

.specimen dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 0.22rem;
}

.specimen dd {
  margin: 0;
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--ink);
}

.specimen dd.is-action { color: var(--seal-text); }

/* Sits outside the ruled box: caption, not another row. */
.specimen__caption {
  border-top: 1px solid var(--rule-strong);
  padding: 0.9rem 1.15rem 1rem;
  font-size: var(--step--1);
  line-height: 1.55;
  color: var(--ink-3);
  background: var(--paper-sunk);
}

@media (max-width: 30rem) {
  .specimen__row { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* --- Applications list ----------------------------------------------------
   A ruled specification list. Explicitly not a row of cards.
   -------------------------------------------------------------------------- */

.apps { border-top: 1px solid var(--rule-strong); }

.app {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 0 clamp(1rem, 2.5vw, 2rem);
  align-items: baseline;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  position: relative;
  transition: background-color 140ms ease-out;
}
.app:hover { background: var(--seal-wash); }
.app:hover .app__name { color: var(--seal-text); }

.app__ref {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.app__text { min-width: 0; }

.app__name {
  display: block;
  font-size: var(--step-1);
  letter-spacing: -0.01em;
  transition: color 140ms ease-out;
}

.app__name .app__flag { display: inline; }

.app__flag {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--seal-text);
  margin-left: 0.6rem;
  vertical-align: 0.15em;
}

.app__q {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink-2);
  font-size: var(--step-0);
  max-width: 46ch;
}

.app__spec {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--ink-3);
  letter-spacing: 0.02em;
  text-align: right;
}

.app__spec::after {
  content: '→';
  display: inline-block;
  margin-left: 0.9rem;
  color: var(--seal);
  transform: translateX(0);
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}
.app:hover .app__spec::after { transform: translateX(4px); }

@media (max-width: 56rem) {
  .app { grid-template-columns: 3.25rem minmax(0, 1fr); }
  .app__spec { grid-column: 2; text-align: left; margin-top: 0.6rem; }
}

/* --- Evidence ladder ------------------------------------------------------
   ACCESSIBILITY CONTRACT: grade is never encoded by tone alone. Every row
   carries (a) its numeral, (b) its label as text, and (c) a five-cell strength
   meter whose *filled count* — not its colour — states evidential strength.
   Greyscale-safe and print-safe by construction.
   -------------------------------------------------------------------------- */

.ladder { border-top: 1px solid var(--rule-strong); }

.grade {
  display: grid;
  grid-template-columns: 3rem 5.5rem minmax(0, 1fr);
  gap: 0 clamp(1rem, 2.5vw, 2rem);
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.grade__num {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-3);
  padding-top: 0.2rem;
}

/* The meter. Filled cells = evidential strength. Redundant with the label. */
.meter {
  display: flex;
  gap: 3px;
  padding-top: 0.45rem;
}

.meter i {
  width: 0.55rem;
  height: 0.55rem;
  border: 1px solid var(--rule-strong);
  background: transparent;
  display: block;
  transform-origin: center;
}

.meter i[data-on='1'] {
  background: var(--grade-tone, var(--ink));
  border-color: var(--grade-tone, var(--ink));
}

.grade__label {
  display: block;
  font-size: var(--step-1);
  letter-spacing: -0.008em;
  color: var(--ink);
}

.grade__desc {
  display: block;
  margin-top: 0.3rem;
  color: var(--ink-2);
  font-size: var(--step-0);
  max-width: 58ch;
}

/* Single-hue ramp. Secondary cue only — the filled count and the text label
   carry the meaning. Every step still clears 3:1 against paper so the fill
   stays legible as a graphical object; the ramp descends 17.1:1 → 4.3:1. */
.grade:nth-child(1) { --grade-tone: #16181a; }
.grade:nth-child(2) { --grade-tone: #2f3337; }
.grade:nth-child(3) { --grade-tone: #484c50; }
.grade:nth-child(4) { --grade-tone: #5e6367; }
.grade:nth-child(5) { --grade-tone: #74787c; }

/* The wrapper span is the grid item — the label and description inside it are
   not, so responsive placement has to target the wrapper. */
.grade__text { min-width: 0; }

@media (max-width: 46rem) {
  .grade { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .grade__num { grid-column: 1; }
  .meter { grid-column: 2; padding-top: 0.1rem; margin-bottom: 0.55rem; }
  .grade__text { grid-column: 2; }
}

/* --- Method steps --------------------------------------------------------- */

.steps { display: grid; gap: 0; border-top: 1px solid var(--rule-strong); }

.step {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 0 clamp(1rem, 2.5vw, 2rem);
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.step__name {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--seal-text);
  padding-top: 0.15rem;
}

.step p { color: var(--ink-2); max-width: 62ch; }

@media (max-width: 46rem) {
  .step { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* --- Firm ----------------------------------------------------------------- */

.firm__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2.5rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.firm__facts div { padding-block: 0.5rem; }

.firm__facts dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.firm__facts dd {
  margin: 0.2rem 0 0;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--ink);
}

/* --- Interior page head ---------------------------------------------------- */

.crumb {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin-bottom: 1.6rem;
}
.crumb a { text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.crumb a:hover { color: var(--ink); border-color: var(--seal); }

/* Interior pages sit a step below the homepage so the hierarchy across the
   site is legible, not just within a page. */
.page-title { font-size: var(--step-3); max-width: 20ch; }
.page-lede { margin-top: 1.4rem; }

/* A "what this is not" list reads as disclaimer, so it is set quieter than the
   method steps it borrows its structure from. */
.not-list { margin-top: 2rem; }
.not-list .step__name { color: var(--ink-3); }

/* --- People ---------------------------------------------------------------- */

.people { border-top: 1px solid var(--rule-strong); }

.person {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0 clamp(1rem, 2.5vw, 2rem);
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.person__role {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--seal-text);
  padding-top: 0.2rem;
}

.person__name {
  margin: 0;
  font-size: var(--step-2);
  letter-spacing: -0.015em;
  line-height: 1.2;
}

/* The empty slot must read as deliberately blank rather than broken: a ruled
   field waiting for a name, in the furniture face, not the display face. */
.person__name--pending {
  font-family: var(--mono);
  font-size: var(--step-0);
  color: var(--ink-3);
  letter-spacing: 0.04em;
  border-bottom: 1px dashed var(--rule-strong);
  padding: 0 3.5rem 0.35rem 0;
  justify-self: start;   /* grid blockifies inline-block, so shrink explicitly */
}

/* dt takes column 1; both dd's belong in column 2 under the name. */
.person__name,
.person__note { grid-column: 2; }

.person__note {
  margin: 0.55rem 0 0;
  color: var(--ink-2);
  font-size: var(--step--1);
  line-height: 1.6;
  max-width: 58ch;
}

@media (max-width: 46rem) {
  .person { grid-template-columns: 1fr; gap: 0.5rem; }
  .person__role { padding-top: 0; }
  .person__name,
  .person__note { grid-column: 1; }
}

/* --- Module pages ---------------------------------------------------------- */

.module-ref {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--seal-text);
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.module-ref span {
  color: var(--ink-3);
  letter-spacing: 0.1em;
  font-weight: 400;
}

.spec { border-top: 1px solid var(--rule-strong); }

.spec__row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0 clamp(1rem, 2.5vw, 2rem);
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}

.spec dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 0.28rem;
}

.spec dd { margin: 0; max-width: 56ch; }

/* A value the founder has still to set. Reads as a blank field, not a claim. */
.pending-value {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--ink-3);
  letter-spacing: 0.04em;
  border-bottom: 1px dashed var(--rule-strong);
  padding: 0 2.5rem 0.25rem 0;
}

@media (max-width: 46rem) {
  .spec__row { grid-template-columns: 1fr; gap: 0.3rem; }
  .spec dt { padding-top: 0; }
}

/* Prose blocks carrying h3 subsections. Ruled and weighted so a subhead is
   unmistakably a subhead against a serif body. */
.prose h3 {
  font-weight: 600;
  font-size: var(--step-1);
  margin-top: 2.6rem;
  margin-bottom: 0.75rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--rule);
}
.prose > :first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose p { max-width: var(--measure); }

/* --- Specimen masthead ------------------------------------------------------ */

.masthead-spec { margin-top: 2.25rem; }

/* A dated specimen is honest; an undated one invites the obvious attack. */
.stale {
  margin-top: 1.75rem;
  max-width: 46rem;
  padding: 1rem 1.15rem;
  background: var(--seal-wash);
  border-left: 2px solid var(--seal);
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--ink-2);
}
.stale strong { color: var(--ink); font-weight: 600; }

.summary dd { font-size: var(--step-1); font-family: var(--mono); }
.summary-ladder { margin-top: 2rem; }

/* --- Vectors ---------------------------------------------------------------- */

.vector {
  padding-top: 2.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--rule-strong);
}
.vector:first-child { padding-top: 0; margin-top: 0; border-top: 0; }

.vector__head {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  font-size: var(--step-2);
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}

.vector__num {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--seal-text);
  flex: none;
}

.vector__body p { color: var(--ink-2); }

.vector__test {
  margin: 1.5rem 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 64ch;
}

.vector__test-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--seal-text);
  margin-right: 0.6rem;
}

.notice p { color: var(--ink-2); font-size: var(--step--1); line-height: 1.7; }
.notice p + p { margin-top: 1rem; }

/* --- Claim records (native details, no JS) ---------------------------------
   The disclosure is a <details>, so expand-in-place, keyboard access and the
   JS-off case are all free. Print forces every record open.
   -------------------------------------------------------------------------- */

.claims { border-top: 1px solid var(--rule-strong); }

.claim { border-bottom: 1px solid var(--rule); }

.claim > summary {
  display: grid;
  grid-template-columns: 3rem 5.5rem minmax(0, 1fr) 1.5rem;
  gap: 0 clamp(0.75rem, 2vw, 1.5rem);
  align-items: start;
  padding: 1.2rem 0;
  cursor: pointer;
  list-style: none;
  transition: background-color 140ms ease-out;
}
.claim > summary::-webkit-details-marker { display: none; }
.claim > summary:hover { background: var(--seal-wash); }

.claim__num {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-3);
  padding-top: 0.15rem;
}

.claim__text {
  font-size: var(--step-0);
  line-height: 1.5;
  min-width: 0;
}

.claim__grade {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* A plus that becomes a minus. No rotation, no easing to fight. */
.claim__disclose {
  position: relative;
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.45rem;
  justify-self: end;
}
.claim__disclose::before,
.claim__disclose::after {
  content: '';
  position: absolute;
  background: var(--seal);
  inset: 50% 0 auto 0;
  height: 1px;
  margin-top: -0.5px;
}
.claim__disclose::after { transform: rotate(90deg); }
.claim[open] .claim__disclose::after { display: none; }

.claim__trail {
  padding: 0 0 1.4rem;
  margin-left: calc(3rem + clamp(0.75rem, 2vw, 1.5rem));
}

.claim__trail dl { display: grid; gap: 0.55rem 1rem; grid-template-columns: 9rem minmax(0, 1fr); }
.claim__trail dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.claim__trail dd { margin: 0; font-size: var(--step--1); line-height: 1.55; }

@media (max-width: 46rem) {
  .claim > summary { grid-template-columns: 2.5rem minmax(0, 1fr) 1.25rem; }
  .claim .meter { grid-column: 2; margin: 0 0 0.5rem; padding-top: 0.2rem; }
  .claim__text { grid-column: 2; }
  .claim__trail { margin-left: 0; }
  .claim__trail dl { grid-template-columns: 1fr; gap: 0.15rem; }
  .claim__trail dd { margin-bottom: 0.65rem; }
}

/* --- Grade filter ----------------------------------------------------------
   Rendered only when JS is present (see .js gate), so there is never a dead
   control. With JS off every claim is visible, which is the honest default.
   -------------------------------------------------------------------------- */

.filter {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 1.75rem;
}
.js .filter { display: flex; }

.filter__btn {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  padding: 0.55rem 1rem;
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
}
.filter__btn:hover { border-color: var(--ink); }
.filter__btn[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.filter__count {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--ink-3);
}

[data-grade-filter='weak'] .claim[data-grade='01'],
[data-grade-filter='weak'] .claim[data-grade='02'],
[data-grade-filter='weak'] .claim[data-grade='03'] { display: none; }

/* --- Specimens list -------------------------------------------------------- */

/* The specimens list uses a descriptive label rather than an M-01 style ref,
   so its first column needs room to sit on one or two lines. */
.apps--wide .app { grid-template-columns: 9.5rem minmax(0, 1.3fr) minmax(0, 1fr); }
@media (max-width: 56rem) {
  .apps--wide .app { grid-template-columns: minmax(0, 1fr); }
  .apps--wide .app__text,
  .apps--wide .app__spec { grid-column: 1; }
  .apps--wide .app__ref { margin-bottom: 0.4rem; }
}

.app--static { cursor: default; }
.app--static:hover { background: transparent; }
.app--static:hover .app__name { color: inherit; }
.app--static .app__spec::after { content: none; }

.app__status {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--rule-strong);
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

/* --- Forms ----------------------------------------------------------------- */

.form { margin-top: 0.5rem; max-width: 42rem; }

.field { margin-bottom: 1.4rem; }

.field label,
.field .field__label {
  display: block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.45rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  padding: 0.75rem 0.85rem;
  border-radius: 0;
  transition: border-color 140ms ease-out;
}
.field textarea { min-height: 9rem; resize: vertical; line-height: 1.55; }
.field select { font-family: var(--mono); font-size: var(--step--1); }

.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--seal-text); }

.field input::placeholder,
.field textarea::placeholder { color: var(--ink-3); }

.field__hint {
  margin-top: 0.4rem;
  font-size: var(--step--1);
  color: var(--ink-3);
  line-height: 1.5;
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
}
@media (max-width: 40rem) { .field-pair { grid-template-columns: 1fr; } }

.hp { position: absolute; left: -9999px; }

/* --- Legal pages ----------------------------------------------------------- */

.legal h2 {
  font-size: var(--step-1);
  margin-top: 2.5rem;
  margin-bottom: 0.7rem;
  letter-spacing: -0.008em;
}
.legal > :first-child { margin-top: 0; }
.legal p, .legal li { max-width: var(--measure); }
.legal ul { margin-top: 0.8rem; }
.legal li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.5rem;
}
.legal li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 0.45rem;
  height: 1px;
  background: var(--seal);
}
.legal__updated {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

/* --- Verification steps ---------------------------------------------------- */

.verify {
  margin-top: 1.5rem;
  border-top: 1px solid var(--rule-strong);
}

.verify__step {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0 clamp(1rem, 2vw, 1.5rem);
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.verify__num {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-3);
}

.verify__body { font-size: var(--step-0); }
.verify__body strong { font-weight: 600; }

.verify__note {
  margin-top: 1.5rem;
  font-size: var(--step--1);
  line-height: 1.65;
  color: var(--ink-3);
}

/* --- Trailing links / notes ----------------------------------------------- */

.ladder__after,
.firm__after { margin-top: 1.75rem; }

.steps__after { margin-top: 1.75rem; color: var(--ink-2); }

/* --- Intake --------------------------------------------------------------- */

.intake { background: var(--paper-sunk); border-top: 1px solid var(--rule); }
.intake h2 { max-width: 26ch; }
.intake__lede { margin-top: 1.1rem; }
.intake__actions { margin-top: 2rem; }

/* --- Footer --------------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--rule-strong);
  padding-block: clamp(2.75rem, 5vw, 4rem) 2rem;
  font-size: var(--step--1);
}

.site-foot__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.8fr));
  gap: 2.5rem clamp(1.5rem, 4vw, 3rem);
}

@media (max-width: 46rem) {
  .site-foot__grid { grid-template-columns: 1fr 1fr; }
  .site-foot__brand { grid-column: 1 / -1; }
}

/* The footer wordmark is a sign-off, not the primary tier. */
.site-foot .wordmark {
  font-size: 1.25rem;
  letter-spacing: -0.026em;
}

.site-foot__tag {
  margin-top: 0.9rem;
  color: var(--ink-2);
  max-width: 32ch;
}

.site-foot address {
  font-style: normal;
  margin-top: 1.1rem;
  color: var(--ink-3);
  line-height: 1.75;
}

.site-foot address a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.site-foot address a:hover { color: var(--ink); border-color: var(--seal); }

.site-foot h2 {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.9rem;
}

.site-foot nav li + li { margin-top: 0.55rem; }

.site-foot nav a {
  text-decoration: none;
  color: var(--ink-2);
  border-bottom: 1px solid transparent;
}
.site-foot nav a:hover { color: var(--ink); border-color: var(--seal); }

.site-foot__legal {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  color: var(--ink-3);
}

/* --- Motion ---------------------------------------------------------------
   One authored moment on this page: the ladder meters resolve on entry, so the
   evidence ramp reads as something being graded. Content is fully visible
   without JS; this only adds the fill.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .js .meter[data-animate] i[data-on='1'] {
    transform: scale(0.35);
    opacity: 0;
  }
  .js .meter[data-animate].is-in i[data-on='1'] {
    transform: scale(1);
    opacity: 1;
    transition: transform 460ms cubic-bezier(0.16, 1, 0.3, 1),
      opacity 320ms ease-out;
    transition-delay: calc(var(--i, 0) * 55ms);
  }
}

/* --- Print ----------------------------------------------------------------
   These files get printed and circulated. Force the meter to survive it.
   -------------------------------------------------------------------------- */

@media print {
  :root { --paper: #fff; }
  body { font-size: 10.5pt; }
  .site-head, .nav, .btn-row, .skip, .app__spec::after { display: none !important; }
  .section, .hero { padding-block: 1.25rem; border-top: 1px solid #999; }
  .rail { grid-template-columns: 7rem 1fr; }
  .specimen, .grade, .app, .step, .claim, .person, .spec__row { break-inside: avoid; }
  /* A printed specimen must be complete: every source trail open, no filter. */
  .claim__trail { display: block !important; }
  .claim__disclose, .filter { display: none !important; }
  [data-grade-filter='weak'] .claim { display: block !important; }
  .meter i { border-color: #000 !important; }
  .meter i[data-on='1'] { background: #000 !important; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 8pt; color: #555; }
}
