/* Agentix AI, assay.css
   A dark warm bench surface. Crimson Pro carries the display, DM Mono carries
   the texture. Vocabulary is laboratory assay, single hyphen compounds only,
   and every piece of state lives on a [data-state] attribute rather than on a
   class, so the markup can be read without knowing the stylesheet. */

:root {
  --ink: #12100E;
  --ink-sink: #0A0908;
  --ink-lift: #1B1713;
  --panel: #201B16;
  --panel-firm: #272119;
  --text: #E8E2D9;
  --text-soft: #B6AC9C;
  --text-faint: #948978;
  --brass: #B8873F;
  --brass-lift: #D8AB63;
  --slate: #6F8FA3;
  --slate-lift: #93B0C1;
  --rule: rgba(232, 226, 217, 0.13);
  --rule-firm: rgba(232, 226, 217, 0.26);
  --display: "Crimson Pro", Georgia, "Times New Roman", serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(1.15rem, 4.2vw, 2.75rem);
  --rise: 0 22px 52px rgba(0, 0, 0, 0.55);
  --rise-soft: 0 10px 26px rgba(0, 0, 0, 0.4);
}

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

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

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

body {
  background: var(--ink);
  color: var(--text);
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.06rem, 0.98rem + 0.36vw, 1.24rem);
  line-height: 1.66;
  font-weight: 400;
  letter-spacing: 0.003em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brass-lift); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--text); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.14; letter-spacing: -0.012em; }

h1, h2, h3 { font-family: var(--display); }

p, ul, ol, dl { margin: 0 0 1.05em; }

:focus-visible {
  outline: 2px solid var(--brass-lift);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ------------------------------------------------------------------ shell */

.skip-lead {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 50;
  background: var(--brass);
  color: #16120C;
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 10px 0;
}
.skip-lead:focus { left: 0; }

.rack-width {
  width: min(76rem, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.assay-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(18, 16, 14, 0.93);
  backdrop-filter: saturate(140%) blur(9px);
  border-bottom: 1px solid var(--rule);
}

.assay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.35rem;
}

.assay-mark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  flex: 0 0 auto;
}
.assay-mark svg { width: 10.4rem; height: auto; }
.assay-mark:hover { color: var(--text); }

.assay-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.6vw, 2.1rem);
  margin: 0;
  padding: 0;
}

.assay-link {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-decoration: none;
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
}
.assay-link:hover { color: var(--text); border-bottom-color: var(--brass); }
.assay-link[aria-current="page"] { color: var(--brass-lift); border-bottom-color: var(--brass); }

.assay-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.7rem;
  height: 2.7rem;
  padding: 0 0.6rem;
  background: var(--ink-lift);
  border: 1px solid var(--rule-firm);
  border-radius: 10px;
  cursor: pointer;
}
.assay-bead {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--text-soft);
}

@media (max-width: 860px) {
  .assay-toggle[data-state="ready"] { display: inline-flex; }
  .assay-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--ink-lift);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--rise-soft);
  }
  .assay-nav[data-state="closed"] { display: none; }
  .assay-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.1rem;
  }
  .assay-link {
    display: block;
    width: 100%;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
  }
}

/* --------------------------------------------------------- disambiguation */

.blank-note {
  border: 1px solid rgba(184, 135, 63, 0.42);
  border-left-width: 3px;
  background: linear-gradient(90deg, rgba(184, 135, 63, 0.11), rgba(184, 135, 63, 0.02));
  border-radius: 12px;
  padding: 1.05rem 1.3rem;
  margin: 0 0 clamp(2.3rem, 4.5vw, 3.2rem);
}
.blank-note p {
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.72;
  color: var(--text-soft);
  margin: 0;
}
.blank-note p + p { margin-top: 0.7rem; }
.blank-note strong { color: var(--brass-lift); font-weight: 500; }

/* ------------------------------------------------------------------- hero */

.worktop {
  padding: clamp(2.6rem, 6vw, 4.6rem) 0 clamp(2.2rem, 5vw, 3.6rem);
  border-bottom: 1px solid var(--rule);
}

.worktop-inner {
  display: grid;
  gap: clamp(2rem, 5vw, 3.4rem);
  align-items: center;
}

@media (min-width: 62rem) {
  .worktop-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}

.worktop-marker,
.titration-marker,
.notebook-marker {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 1.1rem;
}

.worktop-title {
  font-size: clamp(2.35rem, 1.5rem + 3.6vw, 3.85rem);
  font-weight: 600;
  max-width: 18ch;
}

.worktop-line {
  margin: 1.3rem 0 0;
  color: var(--text-soft);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  max-width: 46ch;
}

.worktop-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.9rem;
}

.worktop-figure { margin: 0; }

.worktop-art {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--rule-firm);
  box-shadow: var(--rise);
}

.worktop-caption {
  font-family: var(--mono);
  font-size: 0.73rem;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  margin: 0.85rem 0 0;
}

/* ---------------------------------------------------------------- buttons */

.draught {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.79rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.82rem 1.35rem;
  border-radius: 10px;
  border: 1px solid var(--rule-firm);
  color: var(--text);
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}
.draught[data-state="filled"] {
  background: var(--brass);
  border-color: var(--brass);
  color: #17120A;
  box-shadow: var(--rise-soft);
}
.draught[data-state="filled"]:hover {
  background: var(--brass-lift);
  border-color: var(--brass-lift);
  color: #17120A;
  transform: translateY(-1px);
}
.draught[data-state="hollow"] { background: transparent; color: var(--text-soft); }
.draught[data-state="hollow"]:hover { color: var(--text); border-color: var(--brass); }

@media (prefers-reduced-motion: reduce) {
  .draught { transition: none; }
  .draught[data-state="filled"]:hover { transform: none; }
}

/* --------------------------------------------------------------- sections */

.titration {
  padding: clamp(3.1rem, 7vw, 5.4rem) 0;
  border-bottom: 1px solid var(--rule);
}
.titration[data-state="lifted"] { background: var(--ink-lift); }
.titration[data-state="sunk"] { background: var(--ink-sink); }

.titration-head { max-width: 54rem; margin-bottom: clamp(2rem, 4.5vw, 3.1rem); }

.titration-title {
  font-size: clamp(1.85rem, 1.35rem + 2vw, 2.7rem);
  font-weight: 600;
  max-width: 22ch;
}

.titration-abstract {
  margin: 1.05rem 0 0;
  color: var(--text-soft);
  max-width: 58ch;
}

/* --------------------------------------------------------- progress rail */

.graduation-strip {
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: clamp(2.4rem, 5vw, 3.6rem);
  padding-bottom: 0.9rem;
  scrollbar-width: thin;
}

.graduation-track {
  list-style: none;
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0;
  min-width: 100%;
  border-top: 1px solid var(--rule-firm);
}

/* Each stage takes an equal share while there is room, then stops shrinking
   at its floor and the strip scrolls instead of crushing the labels. */
.graduation-track li {
  position: relative;
  flex: 1 1 0;
  min-width: 8.4rem;
}

.graduation-step {
  display: block;
  height: 100%;
  text-decoration: none;
  color: var(--text-soft);
  padding: 1.05rem 1.2rem 0.95rem;
  border-right: 1px solid var(--rule);
  border-top: 2px solid transparent;
  margin-top: -1px;
}
.graduation-track li:last-child .graduation-step { border-right: 0; }
.graduation-step:hover { color: var(--text); border-top-color: var(--brass); background: rgba(184, 135, 63, 0.06); }

.graduation-index {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--brass);
  margin-bottom: 0.42rem;
}

.graduation-name {
  display: block;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

/* ----------------------------------------------------- the numbered stages */

.aliquot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(1.6rem, 3.4vw, 2.5rem);
}

.aliquot {
  display: grid;
  gap: clamp(0.7rem, 2vw, 1.9rem);
  padding-top: clamp(1.6rem, 3.4vw, 2.5rem);
  border-top: 1px solid var(--rule);
}
.aliquot-list > li:first-child { border-top: 0; padding-top: 0; }

@media (min-width: 48rem) {
  .aliquot { grid-template-columns: 7.5rem minmax(0, 1fr); }
}

.aliquot-index {
  font-family: var(--mono);
  font-size: clamp(2.4rem, 1.6rem + 2.6vw, 3.5rem);
  font-weight: 300;
  line-height: 1;
  color: var(--brass);
  margin: 0;
  letter-spacing: -0.02em;
}

.aliquot-body { min-width: 0; }

.aliquot-title {
  font-size: clamp(1.45rem, 1.2rem + 1.1vw, 1.95rem);
  margin-bottom: 0.7rem;
}

.aliquot-text {
  color: var(--text-soft);
  max-width: 62ch;
  margin-bottom: 1.35rem;
}

.aliquot-split { display: grid; gap: 0.9rem; }

@media (min-width: 40rem) {
  .aliquot-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.aliquot-panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
}
.aliquot-panel[data-state="measures"] { border-left: 3px solid var(--brass); }
.aliquot-panel[data-state="cannot"] { border-left: 3px solid var(--slate); }
.aliquot-panel p:last-child { margin-bottom: 0; }
.aliquot-panel p { font-size: 0.98rem; color: var(--text-soft); }

.aliquot-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0 0 0.55rem;
}
.aliquot-panel[data-state="measures"] .aliquot-label { color: var(--brass); }
.aliquot-panel[data-state="cannot"] .aliquot-label { color: var(--slate-lift); }

/* ------------------------------------------------------- panels and prose */

.crucible-set {
  display: grid;
  gap: 1rem;
}

@media (min-width: 46rem) {
  .crucible-set { grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); }
}

.crucible {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: clamp(1.3rem, 2.6vw, 1.8rem);
  box-shadow: var(--rise-soft);
}
.crucible h3 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}
.crucible p {
  color: var(--text-soft);
  font-size: 1rem;
  margin-bottom: 0;
}
.crucible-tag {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--slate-lift);
  margin: 0 0 0.7rem;
}

.retort { max-width: 40rem; }
.retort h3 {
  font-size: 1.35rem;
  margin: 2rem 0 0.6rem;
}
.retort h3:first-child { margin-top: 0; }
.retort p { color: var(--text-soft); }
.retort ul, .retort ol { color: var(--text-soft); padding-left: 1.2rem; }
.retort li { margin-bottom: 0.5rem; }
.retort p:last-child, .retort ul:last-child { margin-bottom: 0; }

.pair-set {
  display: grid;
  gap: clamp(1.6rem, 4vw, 3.2rem);
  align-items: start;
}

@media (min-width: 58rem) {
  .pair-set { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
}

/* ------------------------------------------------------------ fact ledger */

.pipette {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.pipette > div {
  display: grid;
  gap: 0.2rem 1.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 40rem) {
  .pipette > div { grid-template-columns: 13rem minmax(0, 1fr); }
}

.pipette dt {
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-top: 0.22rem;
}
.pipette dd {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
}

/* ------------------------------------------------------------ pull quotes */

.fume-note {
  border: 1px solid rgba(111, 143, 163, 0.4);
  border-left: 3px solid var(--slate);
  background: rgba(111, 143, 163, 0.08);
  border-radius: 14px;
  padding: 1.15rem 1.4rem;
  margin: 1.6rem 0;
}
.fume-note p {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text-soft);
  margin: 0;
}
.fume-note p + p { margin-top: 0.75rem; }
.fume-note strong { color: var(--text); font-weight: 500; }

/* ----------------------------------------------------------------- tables */

.reagent-scroll {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--panel);
  margin: 1.5rem 0;
  -webkit-overflow-scrolling: touch;
}

.reagent-table {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.reagent-table caption {
  font-family: var(--mono);
  font-size: 0.71rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: left;
  padding: 0.95rem 1.1rem 0.3rem;
}
.reagent-table th,
.reagent-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.78rem 1.1rem;
  border-top: 1px solid var(--rule);
}
.reagent-table thead th {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
  border-top: 1px solid var(--rule-firm);
  background: var(--panel-firm);
}
.reagent-table tbody th { font-weight: 600; color: var(--text); }
.reagent-table td { color: var(--text-soft); }
.reagent-table tbody tr:hover td { background: rgba(232, 226, 217, 0.03); }

/* ------------------------------------------------------------ plate image */

.plate-figure {
  margin: 0;
  display: grid;
  gap: 0.85rem;
}
.plate-art {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--rule-firm);
  box-shadow: var(--rise);
}
.plate-caption {
  font-family: var(--mono);
  font-size: 0.73rem;
  line-height: 1.65;
  color: var(--text-faint);
  margin: 0;
}

/* ----------------------------------------------------------------- footer */

.fixative {
  background: var(--ink-sink);
  border-top: 1px solid var(--rule);
  padding: clamp(2.6rem, 5vw, 3.8rem) 0 2.2rem;
}

.fixative-grid {
  display: grid;
  gap: clamp(1.8rem, 4vw, 3rem);
  padding-bottom: 2.1rem;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 52rem) {
  .fixative-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); }
}

.fixative-mark { display: inline-flex; }
.fixative-mark svg { width: 10rem; height: auto; }

.fixative-blurb {
  color: var(--text-faint);
  font-size: 1rem;
  max-width: 34ch;
  margin: 0.9rem 0 0;
}

.fixative-title {
  font-family: var(--mono);
  font-size: 0.71rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 0.85rem;
}

.fixative-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.fixative-col a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 1rem;
}
.fixative-col a:hover { color: var(--text); text-decoration: underline; }

.fixative-legal {
  padding-top: 1.7rem;
  display: grid;
  gap: 0.45rem;
}
.fixative-legal p {
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.7;
  color: var(--text-faint);
  margin: 0;
}
.fixative-legal a { color: var(--text-soft); }

/* -------------------------------------------------------- legal documents */

.notebook-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3.4rem);
  padding: clamp(2.4rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
  align-items: start;
}

@media (min-width: 64rem) {
  .notebook-grid { grid-template-columns: 17.5rem minmax(0, 1fr); }
  .index-nav { position: sticky; top: 5.6rem; max-height: calc(100vh - 7.5rem); overflow-y: auto; }
}

.index-nav {
  background: var(--ink-lift);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.2rem 1.3rem;
}

.index-title {
  font-family: var(--mono);
  font-size: 0.71rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 0.9rem;
}

.index-list {
  margin: 0;
  padding: 0 0 0 1.5rem;
  display: grid;
  gap: 0.42rem;
}
.index-list li { font-family: var(--mono); font-size: 0.73rem; color: var(--text-faint); }

.index-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-soft);
  text-decoration: none;
}
.index-link:hover { color: var(--brass-lift); text-decoration: underline; }

.notebook-body { min-width: 0; max-width: 48rem; }

.notebook-head {
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--rule-firm);
  margin-bottom: 2.2rem;
}
.notebook-head h1 {
  font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.05rem);
  font-weight: 600;
}

.notebook-abstract {
  margin: 1.1rem 0 0;
  color: var(--text-soft);
  font-size: 1.12rem;
  max-width: 52ch;
}

.notebook-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.4rem;
  margin: 1.4rem 0 0;
}
.notebook-dates span {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.protocol { margin-bottom: 2.9rem; scroll-margin-top: 5.5rem; }

.protocol-title {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.4rem;
  align-items: baseline;
  font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.8rem);
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
}

.protocol-no {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--brass);
}

.protocol-body h3 {
  font-size: 1.2rem;
  margin: 1.7rem 0 0.55rem;
  color: var(--text);
}
.protocol-body p,
.protocol-body li { color: var(--text-soft); }
.protocol-body ul,
.protocol-body ol { padding-left: 1.25rem; }
.protocol-body li { margin-bottom: 0.5rem; }
.protocol-body strong { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------- scroll reveal */
/* Fails open. Nothing is hidden until the script says it is able to show it
   again, so a blocked or broken script leaves the page fully readable. */

.settle { transition: opacity 0.5s ease, transform 0.5s ease; }
.settle[data-state="armed"] { opacity: 0; transform: translateY(14px); }
.settle[data-state="shown"] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .settle,
  .settle[data-state="armed"] { opacity: 1; transform: none; transition: none; }
}

@media print {
  .assay-bar, .index-nav, .worktop-acts, .graduation-strip { display: none; }
  body { background: #fff; color: #000; }
}
