/* 40-peil.css - Noord Type on Vlak.
   Vlak supplies the paint, the controls and the field grid (10-30). This file sets
   the site in the typeface it shows and adds the specimen pieces. It is unlayered,
   so it wins over Vlak's layers without !important. Class prefix: pe-. */

:root {
  --pe-sans: "NT Strak Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --pe-serif: "NT Chiq Serif", "NT Strak Sans", Georgia, serif;
  --pe-slab: "NT Vet Slab", "NT Strak Sans", system-ui, sans-serif;
  --pe-mono: "NT Binair Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* the style a specimen is shown in; a style switch sets it on a container */
  --pe-spec: var(--pe-sans);
  /* display tracking: a little tight in the Sans, none where serifs and slabs already meet */
  --pe-track: -.02em;
}
/* Vlak sets its page word at -.045em, which crowds this face */
.pl-face { letter-spacing: -.02em; }

body {
  font-family: var(--pe-sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.rs-code, .rs-kbd, .rs-code-block-pre, .rs-code-block-pre code { font-family: var(--pe-mono); }

/* ── Chrome: as on noord.dev. The Noord mark at the page's edge; on the first content column
   the crumb Noord / Type, then the page's sections in the quieter weight ──── */
.pe-crumbs { display: inline-flex; align-items: center; gap: 8px; margin-right: 12px; }
.pl-nav .pe-crumbs a { font-weight: 600; color: var(--text); }
.pl-nav .pe-crumbs a:hover { opacity: .6; }
.pe-crumbs i, .pe-phone-crumb i { font-style: normal; font-weight: 500; color: var(--text-secondary); }
.pe-phone-crumb { color: var(--text) !important; font-size: 13px !important; font-weight: 600 !important; }
.pe-phone-crumb i { margin: 0 4px; }
.pe-footer-svg { display: block; width: var(--pl-mark); height: var(--pl-mark); }
.pl-footer-about a { border-bottom: 1px solid var(--divider); }
.pl-footer-links a { gap: .3em; }

/* A 44px target for the bar links without moving their text, and Vlak's ring on them. */
.pl-nav a { position: relative; }
.pl-nav a::after { content: ""; position: absolute; inset: -15.5px -10px; }
.pl-nav a:focus-visible, .pl-meta a:focus-visible, .pl-footer-about a:focus-visible {
  outline: 2px solid var(--text); outline-offset: 2px;
}

/* ── Specimen pieces ─────────────────────────────────────────────────────── */
.pl-cell:has(.pe-glyphs, .pe-ag, .pe-word, .pe-line) { container-type: inline-size; }
.pe-spec { font-family: var(--pe-spec); }
/* a cell, a row or a block shown in one of the four styles */
.pe-in-sans { --pe-spec: var(--pe-sans); --pe-track: -.02em; }
.pe-in-serif { --pe-spec: var(--pe-serif); --pe-track: -.01em; }
.pe-in-slab { --pe-spec: var(--pe-slab); --pe-track: 0em; }
.pe-in-mono { --pe-spec: var(--pe-mono); --pe-track: 0em; }

/* A cell with a label on top and the specimen settled at the bottom (after Vlak's kit cell). */
.pe-cell { justify-content: space-between; align-items: stretch; gap: 16px; }
.pe-label {
  margin: 0;
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3;
  color: var(--text-secondary);
}
.pe-label b { font-weight: 600; color: var(--text); }
.pe-label span { font-variant-numeric: tabular-nums; }

/* a few characters, large */
.pe-glyphs {
  margin: 0 0 0 -0.04em;
  font-family: var(--pe-spec);
  font-size: clamp(3.25rem, 25cqw, 6.5rem);
  font-weight: 500; line-height: .95; letter-spacing: -.02em;
  white-space: nowrap;
}
/* one word, as large as the cell allows */
.pe-word {
  margin: 0 0 0 -0.05em;
  font-family: var(--pe-spec);
  font-size: clamp(3.5rem, 21cqw, 15rem);
  font-weight: 600; line-height: .86; letter-spacing: var(--pe-track);
}
/* the same word in each style: sized so the widest style (the Slab) still fits its cell */
.pe-word.pe-word-style { font-size: clamp(3rem, 17cqw, 9rem); line-height: .9; letter-spacing: var(--pe-track); }
/* one line of display type */
.pe-line {
  margin: 0 0 0 -0.03em;
  font-family: var(--pe-spec);
  font-size: clamp(1.75rem, 6.4cqw, 4.75rem);
  font-weight: 600; line-height: 1; letter-spacing: var(--pe-track);
  text-wrap: balance;
}
/* the weight ladder */
.pe-ag {
  margin: 0 0 0 -0.05em;
  font-family: var(--pe-spec);
  font-size: clamp(3.5rem, 52cqw, 6.25rem);
  line-height: .9; letter-spacing: var(--pe-track);
}
/* running text at interface sizes */
.pe-text { margin: 0; font-family: var(--pe-spec); max-width: 34em; text-wrap: pretty; }
.pe-text + .pe-text { margin-top: .7em; }
.pe-13 { font-size: 13px; line-height: 1.5; letter-spacing: -.01em; font-weight: 400; }
.pe-15 { font-size: 15px; line-height: 1.6; letter-spacing: -.01em; font-weight: 400; }
.pe-17 { font-size: 17px; line-height: 1.5; letter-spacing: -.015em; font-weight: 400; }
.pe-22 { font-size: 22px; line-height: 1.3; letter-spacing: -.02em; font-weight: 500; }

/* source code, set in the Mono */
.pe-code {
  margin: 0; padding: 0; max-width: 100%;
  font-family: var(--pe-mono); font-size: 13px; line-height: 1.55; font-weight: 400;
  color: var(--text); white-space: pre; overflow-x: auto; scrollbar-width: none; tab-size: 4;
}
.pe-code::-webkit-scrollbar { display: none; }
.pe-code code { font: inherit; }
.pe-code:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }

/* a table of figures, hairlines only */
.pe-table { width: 100%; border-collapse: collapse; font-family: var(--pe-spec); font-size: 15px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.pe-table th, .pe-table td { padding: 9px 0; border-top: 1px solid var(--divider); text-align: left; font-weight: 400; vertical-align: baseline; }
.pe-table th { font-size: 12px; font-weight: 600; color: var(--text-secondary); border-top: 0; padding-top: 0; }
.pe-table .pe-num { text-align: right; white-space: nowrap; }
.pe-table td:first-child, .pe-table th:first-child { white-space: nowrap; }
.pe-table td + td, .pe-table th + th { padding-left: 16px; }
/* the same figures in every style, one above the other: they share one cell, so they line up */
.pe-cells tr { font-family: var(--pe-spec); }
.pe-cells td { font-size: 22px; line-height: 1.2; letter-spacing: 0; }
.pe-cells td:first-child { font-size: 15px; }
.pe-cells .pe-num { font-variant-numeric: tabular-nums; font-feature-settings: "kern" 0; }

/* drawings made from the outlines */
.pe-diagram { margin: 0; width: 100%; min-width: 0; }
.pe-diagram svg { display: block; width: 100%; height: auto; overflow: visible; }
.pe-diagram svg + svg { margin-top: 8px; }
.pe-ink { fill: var(--text); }
.pe-outline { fill: none; stroke: var(--text); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pe-guide { fill: none; stroke: var(--text-secondary); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pe-guide-soft { fill: none; stroke: var(--divider); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pe-diagram text { fill: var(--text-secondary); font-weight: 500; letter-spacing: 0; }
.pe-node { fill: var(--bg); stroke: var(--text); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* a whole cell that is a link (after Vlak's start tile) */
a.pe-link-cell { color: var(--text); text-decoration: none; transition: var(--transition); }
a.pe-link-cell:hover { background: var(--control-fill); }
a.pe-link-cell:focus-visible { outline: 2px solid var(--text); outline-offset: -4px; }

/* an editable line */
[contenteditable] { outline: none; caret-color: var(--text); }
[contenteditable]:focus-visible { box-shadow: 0 1px 0 var(--text); }

@media (max-width: 640px) {
  .pe-label { font-size: 13px; }
}

/* Cells of running text take the whole row while the grid has two narrow columns. */
@media (min-width: 481px) and (max-width: 640px) { .pl-cell.pe-wide-two { --pl-two: 2; } }
