/* ==========================================================================
   Lactoferrin.net — design system

   Direction: "apo and holo."
   Lactoferrin is a colourless protein when iron-free (apo) and a distinct
   salmon red when iron-saturated (holo). It was called the red protein of milk
   before it was named. That behaviour IS the colour system: saturation encodes
   certainty. A claim graded Established renders at full holo; one graded
   Laboratory only renders apo, drained of it.

   The paper is cool, milk-white, blue-cast. Deliberately NOT a warm cream —
   the subject is milk, and milk is cold white, not parchment.

   Type, two voices only:
     Zilla Slab       — display. A technical slab, not an editorial didone.
     Libre Franklin   — body and utility. A Franklin Gothic revival; carries
                        labels in letterspaced caps where another site would
                        reach for monospace.

   THERE IS NO MONOSPACE ON THIS SITE, deliberately. Monospace-marks-quantities
   is the signature of a different property covering this same topic, and the
   two must not converge. See docs/separation.md before changing any of this.

   Layout: a sticky contents rail beside a left-aligned measure — the apparatus
   of a reference work, not a centred editorial column.

   Fonts are self-hosted OFL, latin subset. No external requests.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: "Libre Franklin";
  src: url("/assets/fonts/libre-franklin-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Zilla Slab";
  src: url("/assets/fonts/zilla-slab-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Zilla Slab";
  src: url("/assets/fonts/zilla-slab-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

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

:root {
  --paper: #f5f7f8;
  --paper-2: #eaeef0;
  --paper-3: #dfe5e8;
  --ink: #14191c;
  --ink-2: #46525a;
  --ink-3: #6e7c85;
  --rule: #c9d3d8;

  /* Iron saturation. --holo is text-safe on --paper; the -mark variants are
     for fills and chips only. */
  --holo: #9c3d28;
  --apo: #8fa3ad;

  /* The saturation ladder the evidence grades render through. */
  --grade-1: #9c3d28;
  --grade-2: #b06248;
  --grade-3: #c08b78;
  --grade-4: #9fb2bb;
  --grade-5: #b9c4ca;
  /* Grade 6 ("Not supported") is a DECIDED result, not an unknown one. It gets a
     solid, definite mark — never the pale fill used for the untested grades. */
  --grade-6: #3f5a67;

  --font-display: "Zilla Slab", Georgia, "Times New Roman", serif;
  --font-body: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;

  --t-micro: 0.7rem;
  --t-small: 0.82rem;
  --t-body: clamp(0.98rem, 0.95rem + 0.16vw, 1.06rem);
  --t-lead: clamp(1.12rem, 1.04rem + 0.4vw, 1.3rem);
  --t-h3: clamp(1.1rem, 1.04rem + 0.3vw, 1.28rem);
  --t-h2: clamp(1.35rem, 1.2rem + 0.8vw, 1.8rem);
  --t-h1: clamp(1.9rem, 1.5rem + 1.9vw, 2.9rem);
  --t-hero: clamp(2.2rem, 1.6rem + 3vw, 3.9rem);

  --wrap: 78rem;
  --measure: 40rem;
  --rail: 15rem;
  --gutter: clamp(1.1rem, 0.8rem + 1.4vw, 2.25rem);

  --radius: 3px;
  --speed: 180ms;
  --ease: cubic-bezier(0.25, 0.6, 0.3, 1);
}

:root[data-theme="dark"] {
  --paper: #101619;
  --paper-2: #171f23;
  --paper-3: #1e272c;
  --ink: #e6ecef;
  --ink-2: #a8b6bd;
  --ink-3: #7c8b93;
  --rule: #2a363c;
  --holo: #e08260;
  --apo: #5a6d77;
  --grade-1: #e08260;
  --grade-2: #c47053;
  --grade-3: #9d6553;
  --grade-4: #5d717b;
  --grade-5: #465862;
  --grade-6: #9fc4d6;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101619;
    --paper-2: #171f23;
    --paper-3: #1e272c;
    --ink: #e6ecef;
    --ink-2: #a8b6bd;
    --ink-3: #7c8b93;
    --rule: #2a363c;
    --holo: #e08260;
    --apo: #5a6d77;
    --grade-1: #e08260;
    --grade-2: #c47053;
    --grade-3: #9d6553;
    --grade-4: #5d717b;
    --grade-5: #465862;
    --grade-6: #9fc4d6;
  }
}

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

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--holo);
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--ink);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Utility type --------------------------------------------------------- */

/* Labels are letterspaced caps in the body face. Where the paired site would
   use monospace, this site uses this. Do not add a monospace face. */
.label {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Chemical symbols and units are case-sensitive: Fe is not FE, kDa is not KDA.
   Any label carrying notation uses this instead. */
.label--case {
  text-transform: none;
  letter-spacing: 0.08em;
}

/* --- Shell ---------------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
  top: 0;
}

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.masthead__inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0.9rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* The wordmark carries an iron site: a filled dot for the metal the protein is
   defined by. Two lobes, two irons — hence two dots. */
.brand__fe {
  display: inline-flex;
  gap: 3px;
}

.brand__fe i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--holo);
}

.brand:hover {
  color: var(--holo);
}

.masthead__tag {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* --- Layout: rail + measure ------------------------------------------------
   The reference-work apparatus. A sticky contents rail sits beside a
   left-aligned column. On narrow screens the rail becomes a plain block above
   the content.
   -------------------------------------------------------------------------- */

.shell {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: start;
}

.rail {
  position: sticky;
  top: 1.5rem;
  padding-block: 2.5rem;
  border-right: 1px solid var(--rule);
  padding-right: 1.25rem;
}

.rail__heading {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 0.85rem;
}

.rail__nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: 2rem;
}

.rail__nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: var(--t-small);
  padding: 0.32rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.7rem;
  margin-left: -0.7rem;
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.rail__nav a:hover {
  color: var(--ink);
}

.rail__nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--holo);
}

.main {
  padding-block: 2.5rem 4.5rem;
  min-width: 0;
}

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

@media (max-width: 60rem) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .rail {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 1.5rem 0;
  }
  .rail__nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem 1.1rem;
    margin-bottom: 0;
  }
  .rail__nav a {
    border-left: 0;
    padding-left: 0;
    margin-left: 0;
    border-bottom: 2px solid transparent;
  }
  .rail__nav a[aria-current="page"] {
    border-left-color: transparent;
    border-bottom-color: var(--holo);
  }
}

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

.hero {
  padding-block: clamp(1.5rem, 1rem + 2vw, 3rem) clamp(2rem, 1.5rem + 2vw, 3.5rem);
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--t-hero);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0.75rem 0 0;
  max-width: 18ch;
  text-wrap: balance;
}

.hero__standfirst {
  font-size: var(--t-lead);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 46ch;
  margin: 1.2rem 0 0;
  text-wrap: pretty;
}

/* --- THE LEDGER — the signature -------------------------------------------
   Claims about lactoferrin, each with its grade, as the front page of the
   site. Everything else here is quiet so this can be the memorable thing.
   -------------------------------------------------------------------------- */

.ledger {
  margin-top: clamp(2rem, 1.5rem + 2vw, 3.25rem);
  border-top: 2px solid var(--ink);
}

.ledger__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.5rem;
  align-items: baseline;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
}

a.ledger__row:hover {
  background: var(--paper-2);
  box-shadow: 0 0 0 0.6rem var(--paper-2);
}

.ledger__claim {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--t-h3);
  line-height: 1.25;
  color: var(--ink);
}

a.ledger__row:hover .ledger__claim {
  color: var(--holo);
}

.ledger__note {
  display: block;
  font-family: var(--font-body);
  font-size: var(--t-small);
  font-weight: 400;
  color: var(--ink-2);
  margin-top: 0.3rem;
  line-height: 1.5;
}

/* The grade chip. Its fill is the saturation ladder: full holo at the top of
   the scale, drained to apo at the bottom. */
.grade {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

.grade::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  flex: none;
  background: var(--chip, var(--grade-5));
}

.grade--1 {
  --chip: var(--grade-1);
}
.grade--2 {
  --chip: var(--grade-2);
}
.grade--3 {
  --chip: var(--grade-3);
}
.grade--4 {
  --chip: var(--grade-4);
}
.grade--5 {
  --chip: transparent;
}

.grade--5::before {
  box-shadow: inset 0 0 0 1.5px var(--grade-5);
}

.grade--6 {
  --chip: var(--grade-6);
  color: var(--ink-2);
}


/* The scale's own key, printed under the ledger. A grading system that does
   not show its definitions is just an opinion with colours. */
.scale {
  margin-top: 2.25rem;
}

.scale__list {
  display: grid;
  gap: 0.9rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.scale__item {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.4rem 1.25rem;
  align-items: baseline;
  font-size: var(--t-small);
  color: var(--ink-2);
  line-height: 1.5;
}

@media (max-width: 34rem) {
  .scale__item {
    grid-template-columns: minmax(0, 1fr);
  }
  .ledger__row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Article -------------------------------------------------------------- */

.breadcrumb {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1.25rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 0.45rem;
  color: var(--rule);
}

.breadcrumb a {
  color: var(--ink-3);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--holo);
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--t-h1);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin: 0;
  text-wrap: balance;
}

.standfirst {
  font-size: var(--t-lead);
  line-height: 1.45;
  color: var(--ink-2);
  margin: 1rem 0 0;
  text-wrap: pretty;
}

/* The grade banner. On a graded page this sits directly under the title,
   before the reader has committed to anything. */
.verdict {
  margin: 1.75rem 0 0;
  padding: 1.1rem 1.25rem;
  background: var(--paper-2);
  border-left: 3px solid var(--chip, var(--grade-5));
  border-radius: 0 var(--radius) var(--radius) 0;
}

.verdict__grade {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-h3);
  color: var(--ink);
  margin: 0;
}

.verdict__desc {
  margin: 0.4rem 0 0;
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--ink-2);
}

.provenance {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.provenance a {
  color: var(--ink-2);
}

.prose {
  margin-top: 2.25rem;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: var(--t-h2);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.18;
  margin-top: 2.4em;
  margin-bottom: 0.15em;
  text-wrap: balance;
}

.prose h3 {
  font-family: var(--font-display);
  font-size: var(--t-h3);
  font-weight: 500;
  line-height: 1.25;
  margin-top: 1.9em;
  margin-bottom: 0.15em;
}

.prose p {
  text-wrap: pretty;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin-block: 2.5em;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-block: 1.75em;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-small);
}

.prose th {
  text-align: left;
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--ink-3);
  white-space: nowrap;
}

.prose td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}

/* --- Index cards ---------------------------------------------------------- */

.index-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.index-list li {
  border-bottom: 1px solid var(--rule);
}

.index-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  padding: 1rem 0;
  text-decoration: none;
  color: inherit;
}

.index-list a:hover .index-list__title {
  color: var(--holo);
}

.index-list__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--t-h3);
  line-height: 1.25;
  color: var(--ink);
}

.index-list__desc {
  display: block;
  font-size: var(--t-small);
  color: var(--ink-2);
  margin-top: 0.3rem;
  line-height: 1.5;
  font-family: var(--font-body);
  font-weight: 400;
}

.empty-note {
  font-size: var(--t-small);
  color: var(--ink-3);
  font-style: italic;
  margin-top: 1.5rem;
}

/* --- Sources & disclaimer ------------------------------------------------- */

.sources {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.sources h2 {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 1rem;
  font-family: var(--font-body);
}

.sources ol {
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--ink-2);
  padding-left: 1.3em;
  margin: 0;
}

.sources li + li {
  margin-top: 0.55rem;
}

.disclaimer {
  margin-top: 2.5rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--ink-2);
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
  margin-top: 3rem;
}

.site-footer__inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 2.5rem var(--gutter);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 2rem;
}

.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: var(--t-small);
}

.site-footer__col a {
  color: var(--ink-2);
  text-decoration: none;
}

.site-footer__col a:hover {
  color: var(--holo);
  text-decoration: underline;
}

.site-footer__blurb {
  margin: 0;
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 32ch;
}

.site-footer__legal {
  border-top: 1px solid var(--rule);
}

.site-footer__legal p {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 1.1rem var(--gutter);
  font-size: var(--t-micro);
  color: var(--ink-3);
  line-height: 1.6;
}

/* --- 404 ------------------------------------------------------------------ */

.notfound {
  padding-block: clamp(2.5rem, 2rem + 5vw, 6rem);
}

/* Plate: an optional photograph between the provenance line and the prose.
   Deliberately plain. On a reference site the evidence grade is the thing the
   reader came for, and the picture must not compete with it. */
.plate {
  margin: 0 0 1.5rem;
}
.plate__img {
  width: 100%;
  height: auto;
  display: block;
}
