/* MolQuill — site stylesheet.
 *
 * Chemistry literature has a visual grammar of its own: figures numbered with
 * the caption beneath, tables numbered with the caption above, rules only at
 * the head and foot of a table, Helvetica inside figures and a serif for
 * running text. That grammar is the page's structure — it is what the
 * audience reads all day, and it is nothing like a product site.
 */
:root {
  --paper:   #fdfdfc;
  --ink:     #12100e;
  --ink-2:   #4a4744;
  --ink-3:   #7d7975;
  --rule:    #1a1815;
  --hair:    #ddd9d3;
  --accent:  #14594c;
  --flag:    #8a6a1f;
  --field:   #f4f2ee;

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --fig:   "IBM Plex Sans", Helvetica, Arial, sans-serif;
  --num:   "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --measure: 34rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e0e0d; --ink: #edeae5; --ink-2: #b3aea7; --ink-3: #85807a;
    --rule: #e8e4de; --hair: #2c2a27; --accent: #6fc8b2;
    --flag: #cfa356; --field: #191817;
  }
}
:root[data-theme="dark"] {
  --paper: #0e0e0d; --ink: #edeae5; --ink-2: #b3aea7; --ink-3: #85807a;
  --rule: #e8e4de; --hair: #2c2a27; --accent: #6fc8b2; --flag: #cfa356;
  --field: #191817;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.page { max-width: 54rem; margin-inline: auto; padding-inline: 20px; }
.col  { max-width: var(--measure); }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 2.9rem); line-height: 1.12; letter-spacing: -0.017em; }
h2 { font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.55rem); line-height: 1.22; letter-spacing: -0.01em; }
h3 { font-family: var(--fig); font-size: 0.95rem; font-weight: 600; }
p { margin: 0 0 1.05em; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
strong { font-weight: 600; }
code { font-family: var(--num); font-size: 0.87em; }

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem;
  font-family: var(--fig); font-size: 0.9rem;
}
.skip:focus { left: 12px; top: 12px; z-index: 10; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* running head ------------------------------------------------------- */
.runhead {
  font-family: var(--fig); font-size: 0.72rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-3);
  display: flex; gap: 0.9rem; align-items: baseline; flex-wrap: wrap;
  padding-block: 1.6rem 0.55rem;
}
.runhead b { color: var(--ink); font-weight: 600; letter-spacing: 0.06em; }
.runhead a { color: inherit; text-decoration: none; }
.runhead a:hover { color: var(--ink); }
.runhead .sp { flex: 1 1 auto; }
.rule-thick { border: 0; border-top: 1.5px solid var(--rule); margin: 0 0 2.6rem; }

/* opening ------------------------------------------------------------- */
.open { margin-bottom: 2rem; }
.open .lede {
  font-size: 1.15rem; color: var(--ink-2); margin-top: 1rem; max-width: 32rem;
}

/* call to action ------------------------------------------------------ */
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; margin: 1.6rem 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--fig); font-size: 0.95rem; font-weight: 500;
  text-decoration: none; padding: 0.62rem 1.15rem;
  border: 1.5px solid var(--ink); border-radius: 2px;
  color: var(--paper); background: var(--ink);
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost { color: var(--ink); background: transparent; }
.btn.ghost:hover { color: var(--paper); background: var(--ink); }
.cta .note {
  font-family: var(--fig); font-size: 0.82rem; color: var(--ink-3);
  line-height: 1.45;
}

/* figures -------------------------------------------------------------- */
figure { margin: 0 0 2.6rem; }
.fig-art { background: var(--paper); padding: 1.4rem 0 1.1rem; display: block; }
.fig-art svg { width: 100%; height: auto; color: var(--ink); display: block; }
.fig-art.narrow svg { max-width: 30rem; margin-inline: auto; }
.scheme-wipe { clip-path: inset(0 0 0 0); }
@media (prefers-reduced-motion: no-preference) {
  .scheme-wipe { animation: draw 1.5s cubic-bezier(.4,.05,.2,1) 0.15s backwards; }
  @keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
}
figcaption {
  font-family: var(--fig); font-size: 0.815rem; line-height: 1.5;
  color: var(--ink-2); max-width: 38rem;
  border-top: 0.5px solid var(--hair); padding-top: 0.6rem;
}
figcaption b { color: var(--ink); font-weight: 600; }

.shot {
  border: 1px solid var(--hair); background: var(--field);
  padding: 6px; border-radius: 2px; margin-bottom: 0.7rem;
}
.shot img { display: block; width: 100%; height: auto; border-radius: 1px; }

/* sections -------------------------------------------------------------- */
section { margin-bottom: 2.9rem; }
/* Headings carry no bottom margin of their own, so the first thing under one
   opens the gap. dl.caps sets its own and is left out. */
h2 + p, h2 + ul { margin-top: 0.75rem; }
.sec-no {
  font-family: var(--num); font-size: 0.74rem; color: var(--ink-3);
  letter-spacing: 0.06em; display: block; margin-bottom: 0.35rem;
}

/* The one bulleted list on the site. Set at the body measure and in the body
   colour scale, so it reads as running text that happens to be itemised. */
.lims { margin: 0; padding-left: 1.15rem; color: var(--ink-2); }
.lims li { margin-bottom: 0.3rem; }
.lims li:last-child { margin-bottom: 0; }

/* capability list — a definition list, deliberately not a card grid ------ */
dl.caps { margin: 1.4rem 0 0; }
dl.caps > div {
  display: grid; grid-template-columns: 11.5rem 1fr; gap: 0 1.6rem;
  padding: 0.72rem 0; border-top: 0.5px solid var(--hair);
  align-items: baseline;
}
dl.caps > div:last-child { border-bottom: 0.5px solid var(--hair); }
@media (max-width: 620px) { dl.caps > div { grid-template-columns: 1fr; gap: 0.15rem; } }
dt { font-family: var(--fig); font-weight: 600; font-size: 0.9rem; }
dd { margin: 0; color: var(--ink-2); font-size: 0.985rem; }

/* File extensions, settings and shortcuts set in the mono face, the way a
   journal sets a parameter. Global, not scoped to the definition list — it is
   used in running text on every page. */
.spec { font-family: var(--num); font-size: 0.84em; color: var(--ink-3); }
dd .spec, td .spec { color: var(--ink-3); }
p .spec, li .spec, figcaption .spec { color: inherit; opacity: 0.82; }

/* tables — chemistry-journal rules: head and foot only, never vertical --- */
.tbl { margin: 0 0 2.6rem; }
.tbl-cap {
  font-family: var(--fig); font-size: 0.815rem; line-height: 1.5;
  color: var(--ink-2); max-width: 38rem; margin-bottom: 0.55rem;
}
.tbl-cap b { color: var(--ink); font-weight: 600; }
.scroll { overflow-x: auto; }
table {
  border-collapse: collapse; width: 100%;
  font-family: var(--fig); font-size: 0.9rem;
  border-top: 1.5px solid var(--rule); border-bottom: 1.5px solid var(--rule);
}
thead th {
  font-weight: 500; font-size: 0.72rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-3);
  border-bottom: 0.5px solid var(--hair);
}
th, td { text-align: left; padding: 0.5rem 1.1rem 0.5rem 0; vertical-align: baseline; }
th:last-child, td:last-child { padding-right: 0; }
td.v { font-family: var(--num); font-size: 0.8rem; white-space: nowrap; color: var(--ink-2); }
td.v.y { color: var(--ink); }
tbody tr + tr td { border-top: 0.5px solid var(--hair); }

/* set-off note ---------------------------------------------------------- */
.standfirst { border-left: 2px solid var(--flag); padding-left: 1.1rem; margin: 1.5rem 0 0; }
.standfirst p { color: var(--ink-2); }
.standfirst p:last-child { margin-bottom: 0; }
.standfirst strong { color: var(--ink); }

/* price ----------------------------------------------------------------- */
.price {
  border-top: 1.5px solid var(--rule); border-bottom: 1.5px solid var(--rule);
  padding: 1.5rem 0; margin: 1.6rem 0 0;
  display: grid; grid-template-columns: auto 1fr; gap: 0 2rem; align-items: start;
}
@media (max-width: 620px) { .price { grid-template-columns: 1fr; gap: 1rem; } }
.price .amount {
  font-family: var(--fig); font-size: 2.6rem; font-weight: 600;
  line-height: 1; letter-spacing: -0.02em;
}
.price .per {
  font-family: var(--fig); font-size: 0.78rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); margin-top: 0.5rem;
}
.price ul { margin: 0 0 1rem; padding-left: 1.1rem; color: var(--ink-2); font-size: 0.985rem; }
.price li { margin-bottom: 0.25rem; }

/* drop zone (the file-opening pages) ------------------------------------- */
.drop {
  border: 1.5px dashed var(--hair); border-radius: 3px;
  background: var(--field);
  padding: 2.6rem 1.5rem; text-align: center;
  margin: 1.8rem 0 0.8rem;
  transition: border-color .12s, background .12s;
}
.drop.is-over { border-color: var(--accent); border-style: solid; background: var(--paper); }
.drop .big { font-family: var(--fig); font-size: 1.05rem; font-weight: 500; margin-bottom: 0.35rem; }
.drop .small { font-family: var(--fig); font-size: 0.85rem; color: var(--ink-3); }
.drop .small a { color: var(--accent); }
.drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop .err { color: #b3261e; font-family: var(--fig); font-size: 0.85rem; margin-top: 0.7rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .drop .err { color: #f2b8b5; } }

/* contact --------------------------------------------------------------- */
.contact { border-top: 1.5px solid var(--rule); padding-top: 1.7rem; }
.mailto {
  font-family: var(--fig); font-weight: 500; font-size: 1.02rem;
  color: var(--accent); text-decoration: none;
  border-bottom: 1.5px solid var(--accent); padding-bottom: 2px;
}
.mailto:hover { color: var(--ink); border-color: var(--ink); }

/* footnotes ------------------------------------------------------------- */
.notes {
  border-top: 0.5px solid var(--hair); margin-top: 3rem;
  padding-block: 1.2rem 3rem;
  font-family: var(--fig); font-size: 0.775rem; line-height: 1.55; color: var(--ink-3);
}
.notes p { margin: 0 0 0.55em; max-width: 40rem; }
.notes sup { font-size: 0.85em; }
.notes a { color: var(--ink-3); }
