/* Self-hosted, latin subset. An external font stylesheet blocks the first paint
   and costs two extra connections before any glyph can appear. */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 600 800;
  font-stretch: 100% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plexmono.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}

/* Blindspot design tokens. Every later surface reads from this file. */

:root {
  /* Canvas */
  --void: #07070b;
  --panel: #0e0e16;
  --panel-2: #14141f;
  --line: #1e1e2b;
  --line-soft: #16161f;

  /* Ink */
  --ink: #ececf5;
  --muted: #8a8aa3;
  --faint: #55556a;

  /* Exposure, the data side */
  --org: #f97316;
  --org-2: #fb923c;
  --org-dim: rgba(249, 115, 22, 0.14);

  /* Privacy, the eye side */
  --blue: #0052ff;
  --blue-lift: #5a8dff;
  --blue-dim: rgba(0, 82, 255, 0.16);

  /* Semantics only. Never decorative. */
  --up: #22c55e;
  --down: #ef4444;

  /* Type */
  --display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --data: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --gut: 20px;
  --max: 1160px;
  --r: 14px;
  --r-lg: 20px;
}

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

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

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
video,
svg { max-width: 100%; display: block; }

/* Any `display` declaration outranks the hidden attribute's user-agent rule, so
   `el.hidden = true` silently does nothing on a flex or grid element. This is the
   fix, and it has to sit above the layout rules that would otherwise win. */
[hidden] { display: none !important; }

a {
  color: var(--ink);
  text-decoration-color: rgba(249, 115, 22, 0.5);
  text-underline-offset: 3px;
}

a:hover { text-decoration-color: var(--org); }

:focus-visible {
  outline: 2px solid var(--org);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-variation-settings: "wdth" 118;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gut);
}

/* Section eyebrow. It labels what the section is, it does not decorate. */
.eyebrow {
  font-family: var(--data);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--org);
  flex: none;
}

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

/* Any wide child scrolls inside its own container. The page body never does. */
.scroll-x {
  overflow-x: auto;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

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

/* =============================================================================
   The sticky header, shared by every page that is not the terminal.

   Mobile first: one row, the mark on the left, one action on the right, and
   nothing that needs a second line at 390px. The terminal has its own topbar,
   and both pick up the same elevation and the same 3D on the mark.
   ============================================================================= */

.sitehead {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 16px;
  background: rgba(7, 7, 11, 0.78);
  backdrop-filter: blur(14px) saturate(1.2);
  transition: min-height 200ms ease, background 200ms ease, box-shadow 260ms ease;
}

/* The hairline reads as part of a ring passing through, not as a border. */
.sitehead::after,
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.45) 20%, rgba(0, 82, 255, 0.28) 62%, transparent);
  opacity: 0.7;
  transition: opacity 260ms ease;
}

/* Once the page has moved, the bar becomes a layer above it rather than a strip
   painted on it. */
.sitehead.is-scrolled,
.topbar.is-scrolled {
  background: rgba(7, 7, 11, 0.93);
  box-shadow: 0 14px 34px -22px rgba(0, 0, 0, 0.95);
}
.sitehead.is-scrolled { min-height: 48px; }
.sitehead.is-scrolled::after,
.topbar.is-scrolled::after { opacity: 1; }

.sitehead__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  /* The perspective lives on the anchor so the mark inside can turn. */
  perspective: 420px;
}
.sitehead__logo,
.topbar__brand img {
  width: 26px;
  height: 26px;
  transform: rotateX(var(--mrx, 0deg)) rotateY(var(--mry, 0deg));
  transform-style: preserve-3d;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.sitehead__brand b {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: -0.01em;
}
.sitehead__where {
  font-family: var(--data);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  /* Hidden at 390px: the mark already says where you are, and a second label
     pushes the action off the row. */
  display: none;
}
.sitehead__spacer { flex: 1; }
.sitehead__action {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease, border-color 160ms ease;
}
.sitehead__action:hover { color: var(--ink); border-color: rgba(249, 115, 22, 0.5); }

@media (min-width: 560px) {
  .sitehead { padding-inline: 22px; }
  .sitehead__where { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  .sitehead, .sitehead__logo, .topbar__brand img, .sitehead::after, .topbar::after { transition: none; }
}
