/*
 * holotype — the Holotype house style, bundled with press (`theme: holotype`).
 *
 * The describing voice is Martina Plantijn, Klim's "better Plantin", for text
 * and headings. The instrument voice is IBM Plex: Plex Sans for figures,
 * captions and the byline, Plex Mono for section numbers, dates and code. Text
 * runs justified at 19px in a 660px column on a cool near-white page; figures
 * run to 774px. Structure the tokens can't express lives in overrides.css.
 */

/* Martina Plantijn by Kris Sowersby, Klim Type Foundry. A commercial face,
   licensed to Holotype and committed in fonts/licensed/ (see README.md). Until
   the files load, text sets in "Martina Plantijn Fallback" below. */
/* Light is for a name set large: a docs page's (see overrides.css). */
@font-face {
  font-family: "Martina Plantijn";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/licensed/martina-plantijn-light.woff2") format("woff2");
}
@font-face {
  font-family: "Martina Plantijn";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/licensed/martina-plantijn-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Martina Plantijn";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/licensed/martina-plantijn-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Martina Plantijn";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/licensed/martina-plantijn-medium.woff2") format("woff2");
}
@font-face {
  font-family: "Martina Plantijn";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/licensed/martina-plantijn-medium-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Martina Plantijn";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/licensed/martina-plantijn-bold.woff2") format("woff2");
}
@font-face {
  font-family: "Martina Plantijn";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/licensed/martina-plantijn-bold-italic.woff2") format("woff2");
}

/* The fallback: IBM Plex Serif scaled to Martina Plantijn's x-height (0.486
   against Plex's 0.516), so without the Klim files the page reads at the same
   size. Medium and bold map to Plex's semibold. It also supplies any glyph
   Martina Plantijn lacks. */
@font-face {
  font-family: "Martina Plantijn Fallback";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  size-adjust: 94.2%;
  src: url("fonts/ibm-plex-serif-400.woff2") format("woff2");
}
@font-face {
  font-family: "Martina Plantijn Fallback";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  size-adjust: 94.2%;
  src: url("fonts/ibm-plex-serif-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Martina Plantijn Fallback";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  size-adjust: 94.2%;
  src: url("fonts/ibm-plex-serif-600.woff2") format("woff2");
}
@font-face {
  font-family: "Martina Plantijn Fallback";
  font-style: italic;
  font-weight: 500 700;
  font-display: swap;
  size-adjust: 94.2%;
  src: url("fonts/ibm-plex-serif-600-italic.woff2") format("woff2");
}

/* IBM Plex (SIL Open Font License, see fonts/OFL.txt), designed by Mike Abbink
   with Bold Monday. Subset to Latin, Greek, punctuation, arrows and math
   operators, OpenType features kept. Plex Sans is variable (weight 100-700,
   width 75-100). */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-variable.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: italic;
  font-weight: 100 700;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-variable-italic.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-500.woff2") format("woff2");
}
/* SemiBold for figures, which set residues and the bases a mutation changes in
   Plex Mono 600; without it a 600 request gets a synthesized bold of 500. */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-600.woff2") format("woff2");
}

:root {
  /* Type: the describing voice, and the instrument voice in sans and mono. */
  --serif: "Martina Plantijn", "Martina Plantijn Fallback", Georgia, serif;
  --display: var(--serif);
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;
  --figure-font: var(--sans);
  --caption-font: var(--sans);
  --byline-font: var(--sans);
  --meta-font: var(--mono);
  --accent: #7295aa;                 /* the brand's soft blue: the figure palette at 0.125, deepened to 3:1 on the paper */

  /* Reading layout: 19px Martina Plantijn in a 660px column (about 70
     characters a line), justified and hyphenated, with flush paragraphs and a
     small gap between them. Figures run to 774px; the header keeps the
     column's left edge and runs right to the figures' edge. */
  --measure: 660px;
  --figure-measure: 774px;
  --frontmatter-measure: calc((var(--measure) + var(--figure-measure)) / 2);
  --text-size: 19px;
  --leading: 1.6;
  --paragraph-gap: 10px;
  --text-align: justify;
  --hyphens: auto;

  /* Section numbers 1, 2.1, 2.1.1 in mono, hanging in the left margin. */
  --section-numbers: inline-block;
  --section-number-hang: 4.5rem;
  --section-number-gap: 1.1rem;
  --section-number-size: 13px;

  /* Links are ink with an underline in the accent. */
  --link-underline: rgba(114, 149, 170, 0.5);
  --link-underline-hover: var(--accent);
  --link-underline-offset: 3px;

  /* Cool neutral grays on a cool near-white page. */
  --ink: #161616;
  --paper: #f7f8f9;
  --ink-muted: #525252;
  --ink-fill: #262626;
  --line: #e0e0e0;
  --wash: rgba(22, 22, 22, 0.045);  /* translucent: shows on the tinted page */
  --ink-press: #393939;
  --disabled: #a8a8a8;
}

/* Print on white: the PDF matches the white-backed figure exports. */
@media print {
  :root {
    --paper: #ffffff;
  }
}
