/* LabRated shared.css — design tokens + components. See DESIGN-SYSTEM.md.
   Hand-written. Light theme only (v1). */

/* ---------- fonts (self-hosted, OFL) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62.5% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --bench: #EEF1F4;
  --sheet: #FFFFFF;
  --ink: #131A22;
  --ink-soft: #46525E;
  --line: #D4DBE2;
  --line-strong: #9AA6B2;
  --line-input: #66727F;
  --cobalt: #234FBF;
  --cobalt-deep: #1A3A8F;
  --impact: #E8541D;
  --recall: #C7231F;
  --s0: #E9EEF9;
  --s1: #C9D8F7; --s2: #93B0EE; --s3: #5E85DD; --s4: #3358C4; --s5: #1C3A96;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Public Sans", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --radius: 4px;
  --gap: clamp(16px, 2.5vw, 28px);
  --measure: 68ch;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
img, svg { max-width: 100%; height: auto; }
body {
  margin: 0;
  background: var(--bench);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  text-rendering: optimizeLegibility;
}
h1, h2, h3 {
  font-family: var(--font-display);
  font-stretch: 125%;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.45em;
}
h1 { font-weight: 800; font-size: clamp(30px, 5vw, 46px); }
h2 { font-weight: 700; font-size: clamp(22px, 3.2vw, 30px); }
h3 { font-weight: 700; font-size: clamp(17px, 2.2vw, 20px); }
p { margin: 0 0 1em; }
a { color: var(--cobalt); text-underline-offset: 3px; }
a:hover { color: var(--cobalt-deep); }
small, .caption { font-size: 13px; color: var(--ink-soft); }
.mono, td.num, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
  border-radius: 2px;
}
.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--sheet); color: var(--cobalt);
  padding: 10px 16px; z-index: 99; border: 2px solid var(--cobalt);
}
.skip-link:focus { left: 8px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gap); }
.section { margin: clamp(36px, 6vw, 64px) 0; }
.grid2 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid3 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: 0.4em; }

/* ---------- header / footer ---------- */
.site-head {
  background: var(--sheet);
  border-bottom: 2px solid var(--ink);
}
.site-head .wrap {
  display: flex; align-items: center; gap: 18px;
  min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
}
.logomark {
  width: 30px; height: 30px; border: 2px solid var(--cobalt); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font: 800 12px var(--font-display); font-stretch: 125%; color: var(--cobalt);
  letter-spacing: 0;
}
.wordmark {
  font: 800 19px var(--font-display); font-stretch: 125%;
  letter-spacing: 0.01em;
}
.site-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: 15px;
  padding: 10px 12px; border-radius: var(--radius);
}
.site-nav a:hover { color: var(--cobalt); }
.site-nav a[aria-current="page"], .site-nav a.nav-active {
  color: var(--cobalt); box-shadow: inset 0 -2px 0 var(--cobalt);
}
.site-foot {
  margin-top: clamp(48px, 8vw, 88px);
  background: var(--sheet); border-top: 2px solid var(--ink);
  padding: 28px 0 40px; font-size: 14px; color: var(--ink-soft);
}
.site-foot a { color: var(--ink-soft); }
.site-foot .cols { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-foot .fineprint { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 12.5px; }

/* ---------- certificate sheet ---------- */
.sheet {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px);
}
.sheet > :last-child { margin-bottom: 0; }
.eyebrow {
  font: 600 12px var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-soft); display: block; margin-bottom: 10px;
}

/* ---------- specimen label (signature — ONLY on label components) ---------- */
.specimen {
  background: var(--sheet);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 6px;
}
.specimen-inner {
  border: 1px dashed var(--line-strong);
  padding: clamp(14px, 2.5vw, 22px);
}
.specimen .code {
  font: 600 15px var(--font-mono); letter-spacing: 0.02em;
}
.picto {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 2px solid var(--ink);
  border-radius: 2px; background: var(--sheet); flex: none;
}
.picto svg { width: 32px; height: 32px; }

/* ---------- buttons ---------- */
.btn, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px;
  font: 700 16px var(--font-display); font-stretch: 110%;
  border-radius: var(--radius); cursor: pointer; text-decoration: none;
  transition: transform 120ms, box-shadow 120ms;
}
.btn {
  background: var(--cobalt); color: #fff; border: 2px solid var(--cobalt);
  box-shadow: 0 2px 0 var(--cobalt-deep);
}
.btn:hover { background: var(--cobalt-deep); color: #fff; }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--cobalt-deep); }
.btn-ghost {
  background: transparent; color: var(--cobalt); border: 2px solid var(--cobalt);
}
.btn-ghost:hover { background: rgba(35, 79, 191, 0.06); }
.btn-ghost:active { transform: translateY(2px); }

/* ---------- score dots (sequential ramp + numeral + ring, never color alone) ---------- */
.dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  font: 600 13px var(--font-mono);
}
.dot[data-s="0"] { background: var(--s0); color: var(--ink); }
.dot[data-s="1"] { background: var(--s1); color: var(--ink); }
.dot[data-s="2"] { background: var(--s2); color: var(--ink); }
.dot[data-s="3"] { background: var(--s3); color: var(--ink); }
.dot[data-s="4"] { background: var(--s4); color: #fff; }
.dot[data-s="5"] { background: var(--s5); color: #fff; }

/* ---------- stars ---------- */
.stars { display: inline-flex; align-items: center; gap: 6px; }
.stars svg { width: 20px; height: 20px; }
.stars .fill { fill: var(--impact); }
.stars .empty { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.stars .n { font: 600 15px var(--font-mono); }

/* ---------- tables ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th {
  text-align: left; font: 600 13px var(--font-body);
  color: var(--ink-soft); padding: 10px 12px;
  border-bottom: 2px solid var(--ink); white-space: nowrap;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:hover td { background: rgba(35, 79, 191, 0.04); }
.data-table td.num { white-space: nowrap; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sticky-head thead th { position: sticky; top: 0; background: var(--sheet); z-index: 2; }

/* ---------- callouts ---------- */
.note, .caution {
  border-left: 3px solid var(--cobalt);
  padding: 12px 16px; margin: 1.2em 0;
  background: transparent;
}
.caution { border-left-color: var(--recall); }
.note .tag, .caution .tag {
  font: 600 12px var(--font-mono); letter-spacing: 0.12em;
  display: block; margin-bottom: 4px;
}
.note .tag { color: var(--cobalt); }
.caution .tag { color: var(--recall); }

/* ---------- recall results ---------- */
.recall-item {
  border-left: 3px solid var(--recall);
  background: var(--sheet); padding: 14px 18px; margin: 12px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.recall-item .campaign { font: 600 14px var(--font-mono); }
.recall-flag {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--recall); font: 600 13px var(--font-mono); letter-spacing: 0.08em;
}
.recall-flag::before {
  content: ""; width: 10px; height: 10px; border: 2px solid var(--recall);
  border-radius: 50%; display: inline-block;
}

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font: 600 13px var(--font-body); color: var(--ink-soft); }
select, input[type="search"], input[type="text"] {
  font: 400 16px var(--font-body); color: var(--ink);
  background: var(--sheet); border: 1px solid var(--line-input);
  border-radius: var(--radius); padding: 10px 12px; min-height: 44px;
}
select:focus, input:focus { border-color: var(--cobalt); }

/* ---------- misc ---------- */
.tagline { font: 400 18px/1.55 var(--font-body); color: var(--ink-soft); max-width: 54ch; }
.pledge {
  display: flex; gap: 10px 22px; flex-wrap: wrap;
  font: 600 13px var(--font-mono); color: var(--ink-soft);
}
.pledge span::before { content: "\2717\00a0"; color: var(--ink-soft); font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.crumbs { font-size: 13px; color: var(--ink-soft); margin: 14px 0 0; }
.crumbs a { color: var(--ink-soft); }
.badge {
  display: inline-block; font: 600 12px var(--font-mono);
  border: 1px solid var(--line-strong); border-radius: 2px;
  padding: 2px 8px; color: var(--ink-soft); letter-spacing: 0.06em;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn:active, .btn-ghost:active { transform: none; }
}
@media print {
  .site-head, .site-foot, .btn, .btn-ghost { display: none; }
  body { background: #fff; }
}
