/* Cobalt Consulting Group: shared stylesheet ("Well plate" direction)
   Pages load Libre Franklin (400, 500, 600, 700, 800) from Google Fonts in <head>; see site-nav.txt.

   ZOOM RULE: the whole site is rendered at zoom 0.85.
   1. Any vh value must be written already divided by 0.85 (100vh is 117.65vh, 50vh is 58.82vh).
   2. In JS, getBoundingClientRect, clientX/Y, innerWidth and scrollY are in zoomed (visual) px,
      but px written to CSS, transforms or SVG are layout px. Divide visual measurements by
      Z = parseFloat(getComputedStyle(document.documentElement).zoom) || 1 before writing them. */

html { zoom: 0.85; }


/* ---------- Tokens ---------- */
:root {
  --page: #FFFFFF;
  --plate: #EEF1F5;          /* cool gray panel, also the tinted band */
  --plate-edge: #D9DFE7;
  --rule: #D9DFE7;
  --well-empty: #FFFFFF;
  --well-ring: #C9D2DD;
  --ink: #0E1B33;            /* all text, including secondary text */
  --cobalt: #0047AB;         /* the one accent */
  --cobalt-press: #003C93;
  --on-cobalt: #FFFFFF;

  /* Dye strength: lightest to darkest. Used by wells, swatches and bars. */
  --t1: #D3DFF4;
  --t2: #A3BDE8;
  --t3: #6890D6;
  --t4: #2E64C2;
  --t5: #003C93;

  --font: "Libre Franklin", system-ui, sans-serif;
  --fs-body: 1.0625rem;
  --fs-small: 0.95rem;
  --fs-lede: 1.15rem;
  --fs-h1: clamp(2.2rem, 4.2vw, 3.4rem);
  --fs-h2: clamp(1.8rem, 3vw, 2.4rem);
  --fs-h3: 1.2rem;

  --wrap: 1180px;
  --gutter: 32px;
  --section-y: 96px;
  --radius: 4px;

  /* Well plate sizing */
  --w: 46px;
  --gap: 10px;
}


/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.55;
  font-variant-ligatures: none;   /* keeps "501(c)(3)" from turning into a copyright sign */
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 1.2em; }
strong, b { font-weight: 700; }


/* ---------- Type scale ---------- */
h1, h2, h3, h4 { color: var(--ink); margin: 0; }
h1 { font-size: var(--fs-h1); line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 24px; }
h2 { font-size: var(--fs-h2); line-height: 1.1; font-weight: 800; letter-spacing: -0.015em; margin-bottom: 20px; }
h3 { font-size: var(--fs-h3); line-height: 1.25; font-weight: 700; margin-bottom: 12px; }
h4 { font-size: 1rem; line-height: 1.3; font-weight: 700; margin-bottom: 8px; }
.lede { font-size: var(--fs-lede); max-width: 40ch; }
.measure { max-width: 60ch; }
.num, .tabular { font-variant-numeric: tabular-nums; }


/* ---------- Links and focus ---------- */
a { color: var(--cobalt); text-underline-offset: 3px; }
a:hover { color: var(--cobalt-press); }
.text-link { font-weight: 600; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 50;
  background: var(--cobalt); color: var(--on-cobalt); padding: 10px 16px; border-radius: var(--radius);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--on-cobalt); }


/* ---------- Layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section-y) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section.tint, .tint { background: var(--plate); }
.section.tint + .section, .section + .section.tint { border-top: 0; }
.page-head { padding-top: 24px; padding-bottom: 56px; }   /* inner-page title block under the nav */
.split { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: start; }
.split.even { grid-template-columns: 1fr 1fr; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.stack > * + * { margin-top: 16px; }


/* ---------- Buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; padding: 14px 22px; border-radius: var(--radius);
  font: inherit; font-weight: 600; font-size: 1rem; line-height: 1; text-decoration: none;
  border: 2px solid var(--cobalt); cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--cobalt); color: var(--on-cobalt); }
.btn-primary:hover { background: var(--cobalt-press); border-color: var(--cobalt-press); color: var(--on-cobalt); }
.btn-secondary { background: transparent; color: var(--cobalt); }
.btn-secondary:hover { background: var(--t1); color: var(--cobalt); }
.btn-small { padding: 10px 16px; font-size: 0.95rem; }


/* ---------- Nav ---------- */
.site-header { position: relative; z-index: 20; background: var(--page); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 22px; padding-bottom: 22px; }
.nav-logo { flex: none; }
.nav-logo img { height: 40px; width: auto; }
.nav-menu { display: flex; align-items: center; gap: 36px; }
.nav-links { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.98rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--cobalt); }
.nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.nav-cta { padding: 12px 18px; }
.nav-toggle {
  display: none; font: inherit; font-weight: 600; font-size: 0.98rem; color: var(--ink);
  background: none; border: 2px solid var(--ink); border-radius: var(--radius); padding: 8px 14px; cursor: pointer;
}


/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 48px 0 40px; font-size: var(--fs-small); font-variant-ligatures: none; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr 1.6fr; gap: 32px 40px; }
.site-footer p { margin: 0 0 6px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--cobalt); }
.footer-name { font-weight: 700; }
.site-footer .footer-pages { grid-template-columns: repeat(2, max-content); gap: 6px 40px; }
.footer-legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule); }


/* ---------- Well plate ----------
   Markup: .plate > .plate-grid#plate (wells are built by JS as button.well[data-tier] > .cup > .liquid).
   Add .dim to a well or .row-label to fade it; .active marks the selected well. */
.plate {
  background: var(--plate);
  border: 1px solid var(--plate-edge);
  border-radius: 18px 18px 18px 6px;
  padding: 28px 32px 32px 24px;
}
.plate-grid {
  position: relative;
  display: grid;
  grid-template-columns: 4.6rem repeat(3, var(--w)) 14px repeat(3, var(--w));
  gap: var(--gap);
  align-items: center;
}
.col-head { font-weight: 600; font-size: 0.95rem; padding-bottom: 6px; }
.col-head.fall { grid-column: 2 / span 3; }
.col-head.spring { grid-column: 6 / span 3; }
.row-label { font-weight: 500; font-size: 0.92rem; font-variant-numeric: tabular-nums; transition: opacity .2s; }
.row-label.dim { opacity: 0.35; }
.well {
  width: var(--w); height: var(--w);
  padding: 0; margin: 0; border: 0; background: none;
  border-radius: 50%; cursor: pointer; position: relative;
}
.well.blank { cursor: default; }
.cup {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  background: var(--well-empty);
  box-shadow: inset 0 0 0 1px var(--well-ring);
}
.liquid { position: absolute; inset: 0; transition: opacity .2s; }
.well.dim .liquid { opacity: 0.12; }
.well:not(.blank)::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid transparent;
}
.well:not(.blank):hover::after { border-color: var(--well-ring); }
.well.active::after { border-color: var(--ink) !important; }
.well:focus-visible { outline: none; }
.well:focus-visible::after { border-color: var(--cobalt) !important; border-width: 3px; }

/* Dye colors. data-tier="1" to "5" on a well, a table row or any parent of a .sw swatch. */
[data-tier="1"] .liquid, [data-tier="1"] .sw, .sw[data-tier="1"] { background: var(--t1); }
[data-tier="2"] .liquid, [data-tier="2"] .sw, .sw[data-tier="2"] { background: var(--t2); }
[data-tier="3"] .liquid, [data-tier="3"] .sw, .sw[data-tier="3"] { background: var(--t3); }
[data-tier="4"] .liquid, [data-tier="4"] .sw, .sw[data-tier="4"] { background: var(--t4); }
[data-tier="5"] .liquid, [data-tier="5"] .sw, .sw[data-tier="5"] { background: var(--t5); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; vertical-align: -1px; box-shadow: inset 0 0 0 1px var(--well-ring); }

/* Pipette (animated by JS) */
.tip, .drop { position: absolute; left: 0; top: 0; pointer-events: none; visibility: hidden; }
.tip { width: 12px; height: 34px; color: var(--ink); }
.drop { width: 7px; height: 7px; border-radius: 50%; background: var(--cobalt); }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 22px 0 0; padding: 0; font-size: 0.92rem; font-weight: 500; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px var(--well-ring); }

/* Readout: the selected project */
.readout { border-left: 3px solid var(--ink); padding: 2px 0 2px 20px; margin-top: 28px; }
.ro-name { display: flex; align-items: center; gap: 12px; font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; margin: 0 0 16px; }
.ro-name i { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px var(--well-ring); }
.readout dl { margin: 0; display: grid; grid-template-columns: auto auto auto; justify-content: start; gap: 8px 36px; }
.readout dt { font-weight: 500; font-size: 0.92rem; }
.readout dd { margin: 0; font-weight: 600; font-size: 1.08rem; }


/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 20px; }
label, .label { font-weight: 600; font-size: 0.98rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="search"], input[type="number"],
select, textarea {
  font: inherit; color: var(--ink); background: var(--page);
  width: 100%; padding: 12px 14px; border: 1px solid var(--well-ring); border-radius: var(--radius);
}
textarea { min-height: 9rem; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--t3); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 0; border-color: var(--cobalt); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--cobalt); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
fieldset { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin: 0 0 8px; }
[aria-invalid="true"] { border-color: #B3261E; }
.field-error { color: #B3261E; font-weight: 500; font-size: var(--fs-small); margin: 0; }

/* Toggle buttons (filters, tabs). Use aria-pressed="true" for the selected one. */
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt {
  font: inherit; font-size: 0.92rem; font-weight: 500; line-height: 1.2;
  padding: 8px 12px; border-radius: var(--radius); cursor: pointer;
  background: var(--page); color: var(--ink); border: 1px solid var(--plate-edge);
}
.opt:hover { border-color: var(--t3); }
.opt[aria-pressed="true"], .opt[aria-selected="true"] { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }


/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-top: 2px solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 600; font-size: 0.95rem; padding: 14px 12px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr:hover td { background: var(--plate); }
th.num, td.num { text-align: right; }


/* ---------- Utilities ---------- */
.placeholder { font-style: italic; }            /* bracketed "[to be supplied]" content */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.no-lig { font-variant-ligatures: none; }
.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 28px 48px; list-style: none; margin: 0; padding: 0; }
.logo-row img { height: 44px; width: auto; max-width: 200px; object-fit: contain; }
.photo { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--plate); }


/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}


/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav-menu { gap: 24px; }
  .nav-links { gap: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .split, .split.even { grid-template-columns: 1fr; gap: 40px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 880px) {
  .nav { flex-wrap: wrap; }
  .nav-toggle { display: inline-block; }
  .nav-menu { display: none; flex-basis: 100%; flex-direction: column; align-items: flex-start; gap: 20px; padding: 8px 0 12px; }
  .site-header.is-open .nav-menu { display: flex; }
  .nav-links { flex-direction: column; gap: 14px; }
  .nav-links a { font-size: 1.1rem; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; --section-y: 64px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .readout dl { grid-template-columns: 1fr 1fr; }
  .logo-row { gap: 24px 32px; }
  .logo-row img { height: 36px; }
}
@media (max-width: 560px) {
  :root { --w: 32px; --gap: 6px; }
  .plate { padding: 18px 14px 20px 12px; border-radius: 14px 14px 14px 4px; }
  .plate-grid { grid-template-columns: 3.6rem repeat(3, var(--w)) 6px repeat(3, var(--w)); }
  .row-label { font-size: 0.82rem; }
  .tip { width: 9px; height: 26px; }
  .ro-name { font-size: 1.7rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
