/*
 * The Holotype landing page. Type and color follow press's holotype theme
 * (press/themes/holotype/tokens.css): Martina Plantijn for the describing
 * voice, IBM Plex Sans and Mono for the instrument voice. Unlike the papers,
 * which stay light, the page is dark: the palette's ink as the ground. Labels
 * hang in a left column, like the paper's section numbers.
 */

/* Martina Plantijn (Klim), licensed for holotype.org (see the README). */
@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: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/licensed/martina-plantijn-medium.woff2") format("woff2");
}

/* IBM Plex Serif scaled to Martina Plantijn's x-height, as in the theme, so
   text keeps its size while Martina loads. */
@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: normal;
  font-weight: 500 700;
  font-display: swap;
  size-adjust: 94.2%;
  src: url("fonts/ibm-plex-serif-600.woff2") format("woff2");
}

/* IBM Plex (SIL Open Font License, see fonts/OFL.txt). */
@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 Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-400.woff2") format("woff2");
}

:root {
  --serif: "Martina Plantijn", "Martina Plantijn Fallback", Georgia, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;

  /* The chrome ramp from ../palette (src/styles.css) with its ends swapped:
     the ground is the palette's ink, a blue-tinged charcoal, and the text its
     paper. Muted text and hairlines are the palette's color-mix() steps, taken
     from the light end into the dark. */
  --paper: oklch(0.22 0.008 250);
  --ink: oklch(0.985 0.002 250);
  --ink-muted: color-mix(in oklch, var(--ink) 60%, var(--paper));
  --line: color-mix(in oklch, var(--ink) 15%, var(--paper));
  /* The brand's soft blue, as in the papers: ../palette's color at 0.125,
     deepened to 3:1 against their paper. On this ground it's 5.4:1. */
  --accent: #7295aa;
  --link-underline: color-mix(in oklch, var(--accent) 55%, var(--paper));
  /* The red of a type specimen's label, likewise lightened. */
  --type-red: oklch(0.7 0.15 27);
  color-scheme: dark;

  --width: 1040px;
  --gutter: 40px;
  --label-column: 9rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 120ms ease;
}

a:hover,
a:focus-visible {
  text-decoration-color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- The holotype specimen ---------- */

/* Drawn from holotype.json by specimen.mjs: one body of the form, in colors
   from the palette. It stands very large and faint behind the page, toward the
   left, and fades out toward the bottom. The backdrop spans the page and clips
   the specimen to it, so on a phone it never widens the page. It's at least a
   screen tall, and fades out over the page's last 45vh, so the specimen never
   ends at a hard edge on a page shorter than itself. On a longer page, the
   specimen's own fade ends first. */
body {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
}

.backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, transparent, #000 45vh);
  mask-image: linear-gradient(to top, transparent, #000 45vh);
}

.specimen {
  position: absolute;
  top: -6vh;
  left: 18%;
  width: auto;
  height: 150vh;
  transform: translateX(-50%);
  opacity: 0.12;
  color: var(--ink);
  -webkit-mask-image: linear-gradient(to top, transparent, #000 40%);
  mask-image: linear-gradient(to top, transparent, #000 40%);
}

@media (max-width: 860px) {
  .specimen {
    height: 120vh;
  }
}

.page {
  max-width: calc(var(--width) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(56px, 16vh, 168px) var(--gutter) 96px;
}

/* The menu, at the top right, where the bar has it on other pages
   (scripts/bar.mjs, which styles it). */
body > .site-nav {
  position: absolute;
  top: 0;
  right: 0;
  height: var(--bar-height);
  padding: 0 var(--gutter);
}

body > .site-nav .site-menu {
  right: var(--gutter);
}

/* ---------- Masthead ---------- */

.masthead {
  /* Full size (152px) from about 1216px wide. Below that it shrinks more
     slowly than the page, so on a phone it still spans most of the width:
     about 70px at 390px wide. */
  --wordmark-size: clamp(60px, 31px + 9.93vw, 152px);
  margin-bottom: clamp(64px, 14vh, 144px);
}

.wordmark {
  margin: 0 0 0 -0.03em;
  font-weight: 400;
  font-size: var(--wordmark-size);
  line-height: 0.92;
  letter-spacing: -0.015em;
}

/* With Martina Plantijn, the build replaces the text with an SVG drawn from its
   outlines (scripts/wordmark.py), the t and y joined in one stroke. It's sized
   in em, so it scales with the font size above, and fills the same line box. */
.wordmark-svg {
  display: block;
  overflow: visible;
}

/* Spacing runs from ink, not line boxes. The wordmark's box ends 0.097 of its
   size below the baseline, and the y descends 0.24, overhanging it by 0.143.
   The tagline's caps then sit a fixed step below the descenders. In Martina at
   line-height 1.3, the caps start 0.313em below the line box's top and the
   baseline sits 0.287em above its bottom, so the negative bottom margin ends
   the masthead on the baseline. */
.tagline {
  margin: calc(var(--wordmark-size) * 0.143 + max(14px, var(--wordmark-size) * 0.13) - 0.313em) 0 -0.287em;
  max-width: 34em;
  font-size: clamp(22px, 2.5vw, 30px);
  line-height: 1.3;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

/* ---------- Entries: a hanging mono label and its content ---------- */

.entry {
  display: grid;
  grid-template-columns: var(--label-column) minmax(0, 1fr);
  column-gap: 2rem;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
}

.label {
  margin: 0;
  padding-top: 5px;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.posts,
.people {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post + .post {
  margin-top: 26px;
}

.post-title {
  display: block;
  max-width: 34em;
  margin: 0;
  font-weight: 500;
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.004em;
  text-wrap: pretty;
}

.post-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-muted);
}

/* A post's catalogue number, set as a type specimen's red label. */
.catalogue {
  padding: 1px 6px 0;
  border: 1px solid var(--accent);
  color: var(--accent);
  letter-spacing: 0.04em;
}

.people {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 2rem;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

.contact {
  margin: 0;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  padding-top: 3px;
}

/* ---------- Narrow screens: labels stack above their content ---------- */

@media (max-width: 640px) {
  :root {
    --gutter: 20px;
  }
  .entry {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 10px;
    padding: 18px 0 26px;
  }
  .label {
    padding-top: 0;
  }
  .post-title {
    font-size: 21px;
  }
  .people {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
  }
}
