/* DarkProof site, new style: the base every page starts from. Typefaces (Geist and Geist Mono, served from this
   site), the tokens for color, spacing and radius, the text styles, and the few parts every page uses. Black and
   white; color only means something: green is safe or connected, red is help or an outage. No outside requests.
   This file takes the place of the old site's shared stylesheet. */
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --mono: "Geist Mono", ui-monospace, monospace;
  --soft: #D1D1D1;
  --rule: #595A5A;
  /* Surfaces */
  --bg: #000000;
  --s1: #181818;
  --s2: #1F1F1F;
  --s3: #272727;
  --s4: #313131;
  /* Text */
  --fg: #FFFFFF;
  --dim: #A3A3A3;
  --faint: #8A8A8A;
  --decor: #616161;
  /* Color only means something: green = safe or connected, red = help. */
  --safe: #33D64A;
  --help: #FF453B;
  /* Spacing */
  --sp-25: 2px; --sp-50: 4px; --sp-75: 8px; --sp-100: 12px; --sp-200: 16px; --sp-300: 24px;
  --sp-400: 32px; --sp-500: 40px; --sp-600: 48px; --sp-700: 64px; --sp-800: 80px; --sp-900: 96px;
  /* Radius */
  --r-md: 6px; --r-lg: 8px; --r-xl: 12px; --r-2xl: 16px; --r-3xl: 24px; --r-4xl: 32px; --r-full: 9999px;
  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--sp-900); }
body {
  margin: 0;
  background: #000;
  color: var(--fg);
  font-family: "Geist", system-ui, sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; }
img, svg { display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: var(--r-md); }
[hidden] { display: none !important; }

/* Text styles */
.body-3 { font-size: 16px; line-height: 24px; font-weight: 400; }
.body-4 { font-size: 14px; line-height: 20px; font-weight: 600; }
.body-5 { font-size: 14px; line-height: 20px; font-weight: 500; }
.caption-2 { font-size: 14px; line-height: 20px; font-weight: 400; }
.caption-5 { font-size: 12px; line-height: 16px; font-weight: 400; }
.dim { color: var(--dim); }
/* Equipment labels: small mono capitals, as on an instrument panel */
.label { font-family: var(--mono); font-size: 12px; line-height: 16px; font-weight: 400; text-transform: uppercase; color: var(--dim); }
/* Dot matrix lettering: ordinary letters seen through a grid of dots */
.dots {
  font-family: var(--mono); font-weight: 700; text-transform: uppercase;
  -webkit-mask-image: radial-gradient(circle, #000 var(--dot, 1.1px), transparent calc(var(--dot, 1.1px) + 0.3px));
  mask-image: radial-gradient(circle, #000 var(--dot, 1.1px), transparent calc(var(--dot, 1.1px) + 0.3px));
  -webkit-mask-size: var(--pitch, 3px) var(--pitch, 3px); mask-size: var(--pitch, 3px) var(--pitch, 3px);
}

/* Icons (Phosphor, inlined in the page) */
.ic { width: 20px; height: 20px; flex: none; fill: currentColor; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip {
  position: absolute; left: var(--sp-200); top: var(--sp-200); z-index: 100; padding: var(--sp-75) var(--sp-100);
  background: var(--fg); color: #000; border-radius: var(--r-lg); font-weight: 600; text-decoration: none;
  transform: translateY(-96px); transition: transform 500ms var(--ease);
}
.skip:focus { transform: none; }

/* A fade between pages */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 300ms; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skip { transition: none; }
  @view-transition { navigation: none; }
}

/* ---- The background: an ASCII field, the apps' "style C" ----
   Two pictures made of plain monospace characters, drawn by site-src/make-backdrop.py. It sits behind everything and
   takes no clicks. The opacity is the apps' "strength": how much of it shows.
   The pictures are still, and they are what every page shows first. On a wide screen with a mouse or a trackpad,
   on the pages that load field.js, that script then draws the same picture on a canvas (.ascii-field), where the clouds
   drift slowly and the characters light up around the pointer; once its first picture is there it marks the page
   (ascii-live) and the still one steps back. Everywhere else the still picture stays. */
body::before {
  content: "";
  position: fixed; z-index: -1; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh;
  pointer-events: none;
  background: url("backdrop-narrow.svg?v=1") right bottom / 902px 1406px no-repeat;
  opacity: 0.7;
}
.ascii-field { position: fixed; z-index: -1; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.7; }
@media (min-width: 900px) {
  body::before { background: url("backdrop-wide.svg?v=1") center top / 2398px 1406px no-repeat; }
  .ascii-live body::before { display: none; }
}
/* The moving one only where field.js runs it: never on a narrow screen, where the still picture is another one. */
@media (max-width: 899px) { .ascii-field { display: none; } }
/* Not on paper, and not for visitors who ask for more contrast or use their own colours. And nothing moves for
   visitors who ask for less motion: they keep the still picture. */
@media print, (prefers-contrast: more), (forced-colors: active) {
  body::before, .ascii-field { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ascii-field { display: none; }
  .ascii-live body::before { display: block; }
}
