/* ============================================================
   Biology Hub — shared design
   Motif: the lab bench. A 96-well plate as the index,
   an instrument readout as the answer.
   Swap this file to restyle every tool at once.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root{
  /* Colours taken from things on a bench */
  --bench:  #E4E8E1;   /* benchtop */
  --paper:  #F8F9F6;   /* lab notebook */
  --ink:    #141A16;
  --ink-2:  #57625A;
  --dye:    #2B3894;   /* bromophenol blue loading dye */
  --phenol: #C23860;   /* phenol red indicator */
  --rule:   #C4CBBE;

  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --w: 62rem;
}

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

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

body{
  margin: 0;
  background: var(--bench);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  /* faint graph paper */
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
}

.wrap{
  max-width: var(--w);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

a { color: var(--dye); text-underline-offset: .18em; }

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

/* ── Masthead ─────────────────────────────────────── */
.masthead{
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding-block: 3.5rem 3rem;
  margin-bottom: 2.5rem;
}

.eyebrow{
  margin: 0 0 .75rem;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.wordmark{
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 3.9rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1;
}

.lede{
  margin: .9rem 0 0;
  font-size: 1.02rem;
  color: var(--ink-2);
}

/* ── 96-well plate = the index ────────────────────── */
.plate{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.well{
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1.15rem 1.15rem 1.35rem;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
  transition: background .12s ease;
}

.well:hover, .well:focus-visible{ background: #fff; }

.well-id{
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  color: var(--dye);
}

.well-title{ font-weight: 600; line-height: 1.35; }

.well-desc{
  font-size: .86rem;
  color: var(--ink-2);
  line-height: 1.55;
}

.empty{ padding: 2rem; background: var(--paper); color: var(--ink-2); }

/* ── Tool pages ───────────────────────────────────── */
.tool-head{
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding-block: 2.5rem 2rem;
  margin-bottom: 2.25rem;
}

.tool-head h1{
  margin: 0;
  font-size: clamp(1.65rem, 4.5vw, 2.3rem);
  letter-spacing: -.025em;
  line-height: 1.2;
}

h2{
  margin: 2.5rem 0 .8rem;
  font-size: 1.08rem;
  letter-spacing: -.01em;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--rule);
}

/* ── Inputs ───────────────────────────────────────── */
.field{ margin-bottom: 1.1rem; }

.field label{
  display: block;
  margin-bottom: .35rem;
  font-size: .84rem;
  font-weight: 500;
  color: var(--ink-2);
}

.field input,
.field select{
  width: 100%;
  padding: .7rem .8rem;
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0;
}

.field input:focus, .field select:focus{
  border-color: var(--dye);
  outline: none;
  box-shadow: inset 0 -2px 0 var(--dye);
}

/* ── The readout: this site's signature ─────────────
   An instrument display window. Monospaced digits that
   change the moment you type. */
.readout{
  margin: 1.75rem 0;
  padding: 1.4rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
  border-left: 4px solid var(--dye);
  overflow-x: auto;
}

.readout-value{
  display: block;
  font-family: var(--mono);
  font-size: clamp(1.9rem, 6vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.readout-unit{
  display: block;
  margin-top: .3rem;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .08em;
  color: #9AA79E;
}

.readout.is-error{ border-left-color: var(--phenol); }
.readout.is-error .readout-value{ font-size: 1.1rem; color: #F0B9C7; }

/* ── Supporting blocks ────────────────────────────── */
.formula{
  padding: 1rem 1.15rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: .92rem;
  line-height: 1.85;
  overflow-x: auto;
  white-space: pre-wrap;
}

.note{
  padding: .9rem 1.1rem;
  background: var(--paper);
  border-left: 3px solid var(--rule);
  font-size: .92rem;
}

.warn{
  padding: .9rem 1.1rem;
  background: #FBEEF2;
  border-left: 3px solid var(--phenol);
  font-size: .92rem;
}

/* ── Footer ───────────────────────────────────────── */
.foot{
  margin-top: 4rem;
  padding-block: 1.75rem 3rem;
  border-top: 1px solid var(--rule);
  font-size: .84rem;
  color: var(--ink-2);
}

.foot p{ margin: .3rem 0; }

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; }
}
