/* ==========================================================================
   Parallel Machines / base.css
   Reset, typography defaults, links, selection, focus, skip link, utilities,
   reduced-motion overrides.
   ========================================================================== */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  hanging-punctuation: first last;
}
@media (prefers-reduced-motion: no-preference) {
  html:focus-within { scroll-behavior: smooth; }
}
body {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  font-kerning: normal;
  font-optical-sizing: auto;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
img, video { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
:where(ul, ol)[role="list"], :where(ul, ol).list-reset { list-style: none; padding: 0; }
table { border-collapse: collapse; border-spacing: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
textarea { resize: vertical; }
[hidden] { display: none !important; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: .2em; cursor: help; }
hr { border: 0; border-top: var(--hair) solid var(--line); }
sup, sub { font-size: .7em; line-height: 0; position: relative; vertical-align: baseline; }
sup { top: -.5em; }
sub { bottom: -.25em; }
:target { scroll-margin-top: calc(var(--header-h) + 24px); }

/* every surface paints its own text colour */
.surface-paper, .surface-mist, .surface-sky, .surface-deep, .surface-ultra, .on-blue, .on-paper { color: var(--fg); }

/* ---------- typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  line-height: var(--lh-heading);
  text-wrap: balance;
  color: inherit;
}
h1, .h1 {
  font-family: var(--font-serif);
  font-size: var(--fs-h1);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-heading);
}
h2, .h2 {
  font-family: var(--font-serif);
  font-size: var(--fs-h2);
  line-height: 1.04;
  letter-spacing: var(--tr-heading);
}
h3, .h3 {
  font-family: var(--font-sans);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
}
h4, .h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-h4);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.005em;
}
.display {
  font-family: var(--font-serif);
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: var(--lh-display);
  letter-spacing: var(--tr-display);
}
.serif { font-family: var(--font-serif); font-weight: 400; }
.serif-italic, em.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.sans { font-family: var(--font-sans); }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: var(--tr-mono); }
.doto { font-family: var(--font-dots); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

p { text-wrap: pretty; }
p + p { margin-top: 1em; }
.lead {
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--fg-2);
  letter-spacing: -.005em;
}
.small, small { font-size: var(--fs-small); line-height: 1.5; }
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
}
.caption {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  line-height: 1.55;
  letter-spacing: .01em;
  color: var(--fg-3);
}
.muted { color: var(--fg-2); }
.subtle { color: var(--fg-3); }
.num, .tabular { font-variant-numeric: tabular-nums lining-nums; }
.nowrap { white-space: nowrap; }
.measure { max-width: var(--measure); }
.measure-narrow { max-width: var(--measure-narrow); }
strong, b { font-weight: 600; }
code, kbd, samp {
  font-family: var(--font-mono);
  font-size: .88em;
  letter-spacing: 0;
}
code { padding: .08em .32em; border-radius: var(--r-1); background: var(--well-strong); }
kbd {
  padding: .05em .4em;
  border: var(--hair) solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-1);
  font-size: .8em;
}
blockquote { margin: 0; }

/* long-form prose */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--fg-3); font-family: var(--font-mono); font-size: .85em; }

/* ---------- links: an underline that draws in ---------- */
a {
  color: inherit;
  text-decoration: none;
}
.link,
.prose a,
.footnotes a:not(.fn-back) {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(var(--line-strong), var(--line-strong));
  background-size: 0% 1px, 100% 1px;
  background-position: 0 100%, 0 100%;
  background-repeat: no-repeat;
  padding-bottom: .06em;
  transition: background-size var(--dur-2) var(--ease), color var(--dur-1) var(--ease);
}
.link:hover,
.prose a:hover,
.footnotes a:not(.fn-back):hover { background-size: 100% 1px, 100% 1px; }
.surface-paper .link:hover, .surface-paper .prose a:hover,
.surface-mist .link:hover, .on-paper .link:hover { color: var(--accent); }

/* ---------- selection ---------- */
::selection { background: var(--selection-bg); color: var(--selection-fg); }

/* ---------- focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-1);
}
/* inputs keep the ring snug */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }
/* a mouse click on a focusable container should not draw a ring */
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
/* the skip-link target (and other programmatic focus targets) never draws a page-sized ring */
main[tabindex="-1"]:focus, [data-focus-target]:focus { outline: none; }

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  left: var(--page-margin);
  top: 10px;
  z-index: var(--z-skip);
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  border-radius: var(--r-1);
  transform: translateY(-160%);
  transition: transform var(--dur-1) var(--ease);
}
.skip-link:focus, .skip-link:focus-visible {
  transform: none;
  outline: 2px solid var(--white);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--electric);
}

/* ---------- utilities ---------- */
.sr-only, .visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.sr-only-focusable:focus, .sr-only-focusable:focus-visible {
  position: static !important; width: auto !important; height: auto !important;
  margin: 0 !important; overflow: visible !important; clip: auto !important; clip-path: none !important; white-space: normal !important;
}
html:not(.js) .js-only { display: none !important; }
html.js .no-js-only { display: none !important; }
.flow > * + * { margin-top: var(--flow-space, 1em); }
.stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--space-4)); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--space-3)); }
.center { text-align: center; }
.upper { text-transform: uppercase; }
.balance { text-wrap: balance; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer__nav, .grain, .skip-link, .drawer, .menu-sheet { display: none !important; }
  .surface-sky, .surface-deep, .surface-ultra { background: #fff !important; color: #000 !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; }
}
