/* Reset, type, shell, and the shared structural devices. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Declared, not defaulted. There is no dark variant because the identity is a paper
   * artefact: the whole scheme rests on ink being permanent and pencil being a
   * correction, and neither gesture survives inversion — pencil on black is not the
   * same mark. Saying so here means scrollbars and form controls match the page instead
   * of fighting it. The ground is a mid grey-green rather than white, which is what
   * makes a light-only page tolerable at night. */
  color-scheme: light;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--type-display);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-feature-settings: "cv05" 1;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, dt, ol, ul, figure, figcaption { margin: 0; }
ol, ul { padding: 0; list-style: none; }
b, strong { font-weight: 600; }
code { font-family: var(--type-mono); font-size: 0.9em; }
time { font-variant-numeric: tabular-nums; }

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 50;
  padding: var(--sp-3) var(--sp-4);
  background: var(--ink);
  color: var(--sheet);
  font: 500 var(--fs-mono)/1 var(--type-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.skip:focus { left: var(--sp-4); top: var(--sp-4); }

/* ── Type roles ───────────────────────────────────────────────────────────────
 * Three faces, each earning its place: the grotesque is the instrument's own
 * voice, the serif appears ONLY inside the generated report because the report is
 * a document and not chrome, and the mono is reserved for measurement. Nothing is
 * set in a face for decorative reasons.
 */

.display {
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: -0.032em;
  text-wrap: balance;
  max-width: 24ch;
}

.h2 {
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.022em;
  text-wrap: balance;
  max-width: 30ch;
}

.lede {
  font-size: var(--fs-lede);
  color: var(--ink-soft);
  max-width: var(--measure);
  margin-top: var(--sp-4);
}
.lede--close { margin-top: var(--sp-5); }

.standfirst {
  font-size: var(--fs-lede);
  color: var(--ink-soft);
  max-width: 46ch;
  margin-top: var(--sp-5);
}

.mono { font-family: var(--type-mono); font-variant-numeric: tabular-nums; }

/* The eyebrow carries a rule that reads as a register mark on a drawing. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font: 500 var(--fs-mono)/1 var(--type-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--rule);
  flex: none;
}
.eyebrow--bare::before { display: none; }

/* ── Shell ─────────────────────────────────────────────────────────────────── */

.rail {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-3) var(--sp-5);
  background: color-mix(in srgb, var(--desk) 88%, transparent);
  backdrop-filter: saturate(120%) blur(6px);
  border-bottom: 1px solid var(--rule);
}

.rail__mark { display: flex; flex-direction: column; line-height: 1.2; }
.rail__name { font-weight: 600; letter-spacing: -0.02em; }
.rail__sub {
  font: 400 var(--fs-micro)/1.3 var(--type-mono);
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.rail__nav { display: flex; gap: var(--sp-5); margin-left: auto; }
.rail__nav a {
  font: 500 var(--fs-mono)/1 var(--type-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms var(--ease), color 160ms var(--ease);
}
.rail__nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }

.conn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font: 500 var(--fs-micro)/1 var(--type-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}
.conn__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink-faint) 18%, transparent);
}
.conn[data-mode="live"] .conn__dot {
  background: var(--ink);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 20%, transparent); }
  50%      { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ink) 0%, transparent); }
}

@media (max-width: 60rem) {
  .rail__nav { display: none; }
  .conn { margin-left: auto; }
}
@media (max-width: 34rem) {
  /* The strapline wrapped to three words on three lines, which reads as a broken
   * wordmark rather than a subtitle. */
  .rail__sub { display: none; }
  .rail { padding-inline: var(--sp-4); }
}
