/* ATFS Strategy: reset, type and the pixel component kit */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, canvas { display: block; max-width: 100%; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 3px dashed var(--accent-ink); outline-offset: 10px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sec { padding-block: var(--sec); }
.band { background: var(--paper-2); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.02; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 4.6vw, 4.25rem); }
@media (max-width: 420px) { h1 { font-size: 9.6vw; } }   /* "Small answers." stays on one line down to 360px */
h2 { font-size: clamp(2.1rem, 4.2vw, 3.6rem); }
h3 { font-size: clamp(1.35rem, 2vw, 1.7rem); line-height: 1.1; }
p { max-width: 60ch; text-wrap: pretty; }
.lede { font-size: clamp(1.0625rem, 1.4vw, 1.25rem); color: var(--ink-2); max-width: 48ch; }
.muted { color: var(--ink-2); }
.label { font: 400 0.8125rem/1.3 var(--font-label); letter-spacing: 0.02em; }
.eyebrow { font: 700 0.875rem/1.3 var(--font-label); color: var(--accent-ink); letter-spacing: 0.02em; }
.mark { background: var(--mark); color: var(--ink); padding: 0 0.12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

.skip { position: absolute; left: 16px; top: -80px; z-index: 100; background: var(--btn); color: var(--btn-ink); padding: 12px 16px; font-weight: 700; }
.skip:focus { top: 16px; }

/* ---------- pixel boxes ----------
   Four 1-pixel-offset copies of the box draw a border with the corners knocked out,
   and two more draw a hard, notched drop shadow. No images, no rounded corners. */
.px {
  --b: var(--px-line); --s: var(--px-shadow);
  box-shadow:
    0 calc(-1 * var(--p)) 0 0 var(--b), 0 var(--p) 0 0 var(--b),
    calc(-1 * var(--p)) 0 0 0 var(--b), var(--p) 0 0 0 var(--b),
    var(--p) calc(2 * var(--p)) 0 0 var(--s), calc(2 * var(--p)) var(--p) 0 0 var(--s);
}
.px--flat {
  box-shadow:
    0 calc(-1 * var(--p)) 0 0 var(--b), 0 var(--p) 0 0 var(--b),
    calc(-1 * var(--p)) 0 0 0 var(--b), var(--p) 0 0 0 var(--b);
}
.card { background: var(--card); }

/* ---------- icons (pixelarticons, MIT), recoloured with currentColor ---------- */
.ico { display: inline-block; flex: none; width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ico--lg { width: 32px; height: 32px; }
/* inlined as data URIs so the icons also work when the page is opened straight from disk */
.i-analytics { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M3 3h18v18H3V3zm16 2H5v14h14V5zM7 12h2v5H7v-5zm10-5h-2v10h2V7zm-6 3h2v2h-2v-2zm2 4h-2v3h2v-3z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-arrow-right { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M4 11v2h12v2h2v-2h2v-2h-2V9h-2v2H4zm10-4h2v2h-2V7zm0 0h-2V5h2v2zm0 10h2v-2h-2v2zm0 0h-2v2h2v-2z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-briefcase-search { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M16 3H8v4H2v14h10v-2H4V9h16v2h2V7h-6V3zm-2 4h-4V5h4v2zm6 6h-6v6h6v2h2v-2h-2v-6zm-4 4v-2h2v2h-2z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-chat { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M20 2H2v20h2V4h16v12H6v2H4v2h2v-2h16V2h-2z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-chess { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M2 2h20v20H2V2zm2 2v4h4v4H4v4h4v4h4v-4h4v4h4v-4h-4v-4h4V8h-4V4h-4v4H8V4H4zm8 8H8v4h4v-4zm0-4v4h4V8h-4z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-close { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M5 5h2v2H5V5zm4 4H7V7h2v2zm2 2H9V9h2v2zm2 0h-2v2H9v2H7v2H5v2h2v-2h2v-2h2v-2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm2-2v2h-2V9h2zm2-2v2h-2V7h2zm0 0V5h2v2h-2z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-cloud-upload { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M10 4h6v2h-6V4zM8 8V6h2v2H8zm-4 2V8h4v2H4zm-2 2v-2h2v2H2zm0 6H0v-6h2v6zm0 0h7v2H2v-2zM18 8h-2V6h2v2zm4 4h-4V8h2v2h2v2zm0 6v-6h2v6h-2zm0 0v2h-7v-2h7zM11 9h2v2h2v2h2v2h-4v5h-2v-5H7v-2h2v-2h2V9z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-colors-swatch { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M14 2h8v20H12V2h2zm6 2h-6v16h6V4zM10 20H4v-6h6v-2H6v-2H4V8h2V6h2V4h2V2H8v2H6v2H4v2H2v2h2v2H2v10h8v-2zm8-4h-2v2h2v-2z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-dashboard { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M3 3h8v10H3V3zm2 2v6h4V5H5zm8-2h8v6h-8V3zm2 2v2h4V5h-4zm-2 6h8v10h-8V11zm2 2v6h4v-6h-4zM3 15h8v6H3v-6zm2 2v2h4v-2H5z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-git-branch { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M5 2h2v12h3v3h7v-7h-3V2h8v8h-3v9h-9v3H2v-8h3V2zm15 6V4h-4v4h4zM8 19v-3H4v4h4v-1z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-lock { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M15 2H9v2H7v4H4v14h16V8h-3V4h-2V2zm0 2v4H9V4h6zm-6 6h9v10H6V10h3zm4 3h-2v4h2v-4z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-mail { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M22 4H2v16h20V4zM4 18V6h16v12H4zM8 8H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8V8z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-menu { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M4 6h16v2H4V6zm0 5h16v2H4v-2zm16 5H4v2h16v-2z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-moon { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'%3E %3Cpath d='M6 2h8v2h-2v2h-2V4H6V2ZM4 6V4h2v2H4Zm0 10H2V6h2v10Zm2 2H4v-2h2v2Zm2 2H6v-2h2v2Zm10 0v2H8v-2h10Zm2-2v2h-2v-2h2Zm-2-4h2v4h2v-8h-2v2h-2v2Zm-6 0v2h6v-2h-6Zm-2-2h2v2h-2v-2Zm0 0V6H8v6h2Z'/%3E %3C/svg%3E"); }
.i-search { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M6 2h8v2H6V2zM4 6V4h2v2H4zm0 8H2V6h2v8zm2 2H4v-2h2v2zm8 0v2H6v-2h8zm2-2h-2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm0-8h2v8h-2V6zm0 0V4h-2v2h2z' fill='currentColor'/%3E %3C/svg%3E"); }
.i-sun { --i: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M13 3h-2v2h2V3zm4 2h2v2h-2V5zm-6 6h2v2h-2v-2zm-8 0h2v2H3v-2zm18 0h-2v2h2v-2zM5 5h2v2H5V5zm14 14h-2v-2h2v2zm-8 2h2v-2h-2v2zm-4-2H5v-2h2v2zM9 7h6v2H9V7zm0 8H7V9h2v6zm0 0v2h6v-2h2V9h-2v6H9z' fill='currentColor'/%3E %3C/svg%3E"); }

/* ---------- buttons: a bevel that presses in ---------- */
.btn {
  --b: var(--btn-line);
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 22px; margin: var(--p) calc(3 * var(--p)) calc(3 * var(--p)) var(--p);
  border: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  font: 700 0.9375rem/1 var(--font-label); letter-spacing: 0.02em;
  background: var(--btn); color: var(--btn-ink);
  box-shadow:
    inset calc(-1 * var(--p)) calc(-1 * var(--p)) 0 0 var(--btn-lo), inset var(--p) var(--p) 0 0 var(--btn-hi),
    0 calc(-1 * var(--p)) 0 0 var(--b), 0 var(--p) 0 0 var(--b), calc(-1 * var(--p)) 0 0 0 var(--b), var(--p) 0 0 0 var(--b),
    var(--p) calc(2 * var(--p)) 0 0 var(--px-shadow), calc(2 * var(--p)) var(--p) 0 0 var(--px-shadow);
}
.btn:hover { filter: brightness(1.06); }
.btn:active {
  transform: translate(var(--p), var(--p));
  box-shadow:
    inset var(--p) var(--p) 0 0 var(--btn-lo),
    0 calc(-1 * var(--p)) 0 0 var(--b), 0 var(--p) 0 0 var(--b), calc(-1 * var(--p)) 0 0 0 var(--b), var(--p) 0 0 0 var(--b);
}
.btn .ico { width: 20px; height: 20px; }
.btn--alt { --btn: var(--btn-2); --btn-ink: var(--ink); --btn-hi: var(--btn-2); --btn-lo: var(--btn-2-lo); --b: var(--px-line); }
.btn--sm { min-height: 44px; padding: 0 14px; font-size: 0.8125rem; }

.tlink { font-weight: 700; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; text-decoration-color: var(--accent); }
.tlink:hover { text-decoration-color: currentColor; }

/* ---------- pixel art frames ---------- */
.stage { position: relative; background: var(--card); }
.stage canvas { width: 100%; height: auto; }

/* photos that start as a few dozen palette pixels (see dither.js) */
.dx { position: relative; overflow: hidden; background: var(--paper-2); cursor: pointer; }
.dx img { width: 100%; height: 100%; object-fit: cover; }
.dx canvas { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.18s steps(3); }
.dx .hi { opacity: 0; }
.dx.is-resolving .lo { opacity: 0; }
.dx.is-resolving .hi { opacity: 1; }
.dx.is-resolved .hi, .dx.is-resolved .lo { opacity: 0; }

/* ---------- reveal on scroll: stepped, like a sprite entering ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.4s steps(4), transform 0.4s steps(4); transition-delay: calc(var(--i, 0) * 90ms); }
.js [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
