/* Pero's site — what every page shares: the fonts, the paper ground, the header and the footer. Colours, type,
   radii and shadows are DS tokens (tokens.css, a copy of design/bundle/ds/tokens.css). Light or dark follows the
   system setting until the visitor picks one with the header's switch: theme.js then puts data-theme on <html>,
   and build.mjs repeats the DS's dark roles for a :root with no light pick under prefers-color-scheme. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-mono-500-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --gutter: clamp(20px, 5vw, 64px);
  --top: clamp(64px, 8vw, 96px);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg-canvas);
  color: var(--color-text-primary);
  font: 400 1.0625rem/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul { margin: 0; }
p, li { text-wrap: pretty; }
ol, ul { padding: 0; list-style: none; }
img { display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: var(--border-strong) solid var(--color-focus-ring); outline-offset: 4px; border-radius: var(--radius-s); }
::selection { background: var(--color-marker-band); color: var(--color-text-on-highlight); }

.wrap { width: min(100% - 2 * var(--gutter), 1240px); margin-inline: auto; }

/* Header: the icon and the name — on the landing a line of text, on the other pages the way home — and the
   theme switch, which theme.js shows. */
.top { display: flex; align-items: center; justify-content: space-between; height: var(--top); }
.brand { display: flex; align-items: center; gap: var(--space-3); min-height: var(--size-touch-min); font-size: 1.25rem; line-height: 1; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
/* The icon is ink: the hairline keeps its edge on the dark ground. */
.brand img { width: 36px; height: 36px; border-radius: var(--radius-s); box-shadow: 0 0 0 var(--border-hairline) var(--color-border-hairline); }
/* A 44 px target around a 24 px glyph; pulled right so the glyph, not its target, meets the gutter. */
.theme { display: grid; place-items: center; width: var(--size-touch-min); height: var(--size-touch-min); margin-right: -10px; padding: 0; border: 0; border-radius: var(--radius-full); background: none; color: inherit; cursor: pointer; }
.theme[hidden] { display: none; }
.theme:hover { background: var(--color-overlay-pressed); }

/* Footer */
.foot { display: grid; gap: var(--space-3); padding-block: var(--space-8) var(--space-12); border-top: var(--border-hairline) solid var(--color-border-hairline); font-size: 0.9375rem; color: var(--color-text-secondary); }
.foot nav { display: flex; flex-wrap: wrap; column-gap: var(--space-6); }
.foot a { display: inline-flex; align-items: center; min-height: var(--size-touch-min); color: var(--color-text-primary); }
