/* labmate.tools — "Vol. 1" catalog style */

:root {
  --paper: #F2EDDF;
  --paper-2: #FAF7EE;
  --ink: #1B2224;
  --ink-2: #3A4443;
  --muted: #4A5655;
  --faint: #6B7472;
  --dot: #8A918C;
  --teal: #17403D;
  --teal-soft: #9CC7B6;
  --teal-line: #5E8F80;
  --pass: #2E9E5B;
  --pass-dark: #1F7A45;
  --on-teal: #F2F5F3;
  --on-teal-2: #C4D8D3;
  --on-teal-accent: #9FD3B3;

  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --gutter: clamp(16px, 5vw, 64px);
  --max: 1280px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--teal); }
:focus-visible { outline: 3px solid var(--pass); outline-offset: 3px; }

svg { display: block; }

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--gutter) 40px;
}

.mono { font-family: var(--mono); letter-spacing: 0.08em; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--paper); padding: 8px 12px; border: 1.5px solid var(--ink); }

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

.masthead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding-bottom: 14px;
  border-bottom: 3px solid var(--ink);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.wordmark { font-size: 22px; letter-spacing: -0.02em; color: var(--ink); line-height: 1; }
.wordmark b { font-weight: 600; }
.wordmark .dot { color: var(--pass); font-weight: 700; }
.wordmark .tld { color: var(--muted); }

.masthead nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; }

.strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: 4px;
  padding: 6px 0;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ---------- Title + index ---------- */

.title-block {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px 40px;
  align-items: end;
  padding: 44px 0 40px;
}

.title-block h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(52px, 8vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.title-block .lede {
  margin: 18px 0 0;
  max-width: 620px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.45;
  color: var(--ink-2);
}

.index-box {
  border: 1.5px solid var(--ink);
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 14px;
}
.box-title {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.index-box ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.index-box a { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.index-box a:hover span:first-child { text-decoration: underline; }
.leader { flex-grow: 1; border-bottom: 1.5px dotted var(--faint); transform: translateY(-4px); }

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

.catalog { display: grid; gap: 32px; }

.section-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
  margin: 0;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.section-bar small { font-size: 12px; font-weight: 400; letter-spacing: 0.08em; color: #C9CFC4; }

.items { list-style: none; margin: 0; padding: 0; }

.item a {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 210px 130px;
  grid-template-areas: "fig main flow status";
  column-gap: 28px;
  align-items: center;
  padding: 18px 14px;
  border-bottom: 1.5px dotted var(--dot);
  text-decoration: none;
  color: var(--ink);
}
.item a:hover { background: rgba(255, 255, 255, 0.35); }
.item a:hover .item-name { color: var(--teal); }

.fig { grid-area: fig; }
.item-main { grid-area: main; }
.item-flow { grid-area: flow; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--muted); }
.status { grid-area: status; justify-self: end; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--faint); white-space: nowrap; }
.status.building { color: var(--pass-dark); }

.item-name {
  display: block;
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.15;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.item-desc { margin: 0; max-width: 440px; font-size: 17px; line-height: 1.45; color: var(--ink-2); }

/* ---------- Figures ---------- */

.fig {
  position: relative;
  width: 200px;
  height: 104px;
  border: 1.5px solid var(--ink);
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 8px;
}
.fig-label {
  position: absolute;
  top: 5px;
  left: 7px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.plate { display: flex; align-items: center; gap: 6px; }
.plate-rows { display: grid; gap: 5px; font-family: var(--mono); font-size: 8px; line-height: 12px; color: var(--faint); }
.wells {
  display: grid;
  grid-template-columns: repeat(8, 12px);
  gap: 5px;
  padding: 6px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: #fff;
}
.w { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--dot); background: #fff; }
.w.done { background: var(--pass); border-color: var(--pass); }
.w.now { border: 3px solid var(--ink); }
.w.pos { background: var(--pass); border-color: var(--pass); }
.w.neg { border: 1.5px dashed var(--ink); }
.w.smp { background: var(--teal-soft); border-color: var(--teal-line); }

.eq { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--ink); }
.eq sub { font-size: 0.56em; }

.fig-mix { display: flex; align-items: center; gap: 12px; }
.fig-mix .times { display: flex; align-items: flex-start; }
.fig-mix .times .eq { font-size: 44px; line-height: 1; }
.fig-mix .times .over { margin: 2px 0 0 4px; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--pass-dark); }

.fig-dil { display: grid; justify-items: center; gap: 6px; }
.fig-dil .eq { font-size: 27px; line-height: 1; white-space: nowrap; }
.tubes { display: flex; align-items: flex-end; gap: 10px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.tube { border: 1.5px solid var(--ink); border-top: none; border-radius: 0 0 4px 4px; }
.tube.stock { width: 14px; height: 18px; background: var(--teal); }
.tube.final { width: 20px; height: 26px; background: var(--teal-soft); }

.fig-mol { display: flex; align-items: center; gap: 12px; }
.fig-mol > .eq { font-size: 32px; line-height: 1; }
.frac { display: grid; justify-items: center; }
.frac .eq { font-size: 24px; line-height: 1.15; padding: 0 6px; }
.frac .bar { justify-self: stretch; border-top: 2px solid var(--ink); }

.fig-rpm { display: flex; align-items: center; gap: 12px; }
.fig-rpm .stack { display: grid; gap: 2px; }
.fig-rpm .stack .eq { font-size: 22px; line-height: 1.1; }
.fig-rpm .stack .arrow { font-family: var(--mono); font-size: 13px; color: var(--faint); }

/* ---------- Find a tool ---------- */

.finder { margin: 0 0 32px; padding: 16px 18px 14px; border: 1.5px solid var(--ink); background: var(--paper-2); }
.finder-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--ink); margin-bottom: 12px; }
.finder-head .box-title { border: none; margin: 0; padding-bottom: 8px; }
.finder-count { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.finder-row { position: relative; display: flex; align-items: center; }
.finder-icon { position: absolute; left: 14px; color: var(--ink); display: flex; pointer-events: none; }
.finder-row input {
  flex: 1; min-width: 0; height: 56px;
  padding: 0 52px 0 46px;
  border: 1.5px solid var(--ink); border-radius: 0; background: #fff;
  font-family: var(--serif); font-size: 21px; color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.finder-row input::placeholder { color: #8A918C; font-style: italic; }
.finder-row input:focus { outline: none; border-color: var(--pass); box-shadow: 0 0 0 2px var(--pass); }
.finder-row input::-webkit-search-cancel-button { cursor: pointer; }
.finder-key { position: absolute; right: 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1.5px solid var(--dot); padding: 1px 7px; background: var(--paper-2); pointer-events: none; }
.finder-row input:focus ~ .finder-key, .finder-row input:not(:placeholder-shown) ~ .finder-key { display: none; }
.finder-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.finder-chips button {
  min-height: 36px; padding: 0 14px;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; cursor: pointer;
}
.finder-chips button:hover { background: #fff; }
.finder-chips button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.finder-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: -12px 0 32px; padding: 18px 20px; border: 1.5px dashed var(--ink); }
.finder-empty[hidden] { display: none; }
.finder-empty p { margin: 0; font-size: 17px; color: var(--ink-2); }
.btn-ink { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-decoration: none; }
.btn-ink:hover { background: var(--teal); color: var(--paper); }

.item[hidden], .catalog > section[hidden] { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Bottom blocks ---------- */

.bottom {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 24px;
  margin-top: 44px;
}

.know { border: 1.5px solid var(--ink); padding: 22px 24px; }
.know ol { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-size: 16px; line-height: 1.5; color: #2A3332; }

.request {
  background: var(--teal);
  color: var(--on-teal);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}
.request .box-title { border: none; padding: 0; margin: 0 0 10px; color: var(--on-teal-accent); }
.request h2 { margin: 0 0 10px; font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.2; }
.request p { margin: 0; font-size: 16px; color: var(--on-teal-2); }

.btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: 1.5px solid var(--paper);
}
.btn:hover { background: transparent; color: var(--paper); }

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

.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 56px;
  padding-top: 14px;
  border-top: 3px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

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

@media (max-width: 1080px) {
  .item a {
    grid-template-columns: 200px minmax(0, 1fr) auto;
    grid-template-areas:
      "fig main main"
      "fig flow status";
    row-gap: 10px;
  }
  .status { justify-self: end; }
}

@media (max-width: 860px) {
  .title-block { grid-template-columns: 1fr; }
  .index-box { max-width: 420px; }
  .bottom { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .finder { padding: 12px 12px 12px; }
  .index-box { display: none; } /* the section chips in Find a tool do the same job on a phone */
  .title-block { padding-bottom: 24px; }
  .finder-row input { font-size: 17px; height: 52px; padding-right: 12px; }
  .finder-key { display: none; }
  .page { padding-top: 24px; }
  .masthead nav a[href="#know"] { display: none; }
  .strip span:nth-child(2) { display: none; }
  .item a {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "fig fig"
      "main main"
      "flow status";
    padding: 18px 4px;
    row-gap: 12px;
  }
  .fig { width: 100%; }
  .item-name { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
