/* Blockulator's theme: the one file with colour literals (scripts/check-sdr-colors.mjs). Everything else uses these tokens.
   Light and dark follow the system; there is no theme script, so the first paint is already the right theme.
   templates/base.html repeats --bg in an inline style so the page is the right colour before this file arrives. */
:root {
  color-scheme: light dark;
  /* fixed primitives, the same in both themes */
  --ink: #0a0a0a; --ink-2: #171717; --ink-3: #262626;
  --g-700: #525252; --g-500: #737373; --g-300: #a3a3a3; --g-200: #d4d4d4; --g-100: #e5e5e5; --g-50: #f5f5f5; --white: #ffffff;
  --on-dark: #ffffff;
  /* the four site colours; dark mode lifts them (below) */
  --emerald: #00694e; --red: #d4002a; --gold: #8f8750; --sapphire: #3f6d9c;

  /* the page */
  --bg: #f3f4f0;
  --text-strong: #0b0c0c; --text: #1b1c1c; --muted: #4c4e4c; --faint: #5f615e;
  --line: rgb(16 20 18 / .08); --line-2: rgb(16 20 18 / .15); --rule: #a5a8a3;
  --tint: rgb(16 20 18 / .035);
  /* glass: a translucent surface, its inner edge, and the solid colour used where backdrop-filter is missing */
  --surface: rgb(255 255 255 / .62); --surface-hi: rgb(255 255 255 / .8); --surface-solid: #fbfbf9;
  --edge: rgb(255 255 255 / .85);
  --blur: saturate(160%) blur(18px);
  --shadow: 0 1px 2px rgb(16 20 18 / .05), 0 8px 24px -10px rgb(16 20 18 / .14);
  --shadow-lift: 0 2px 6px rgb(16 20 18 / .07), 0 22px 44px -18px rgb(16 20 18 / .26);
  /* the background: three soft pools of the site colours on paper, fixed behind every page */
  --mesh:
    radial-gradient(56% 42% at 6% -4%, rgb(0 105 78 / .13), transparent 72%),
    radial-gradient(48% 40% at 100% 6%, rgb(64 112 160 / .13), transparent 70%),
    radial-gradient(60% 46% at 74% 104%, rgb(160 152 96 / .14), transparent 72%),
    radial-gradient(40% 34% at 0% 92%, rgb(64 112 160 / .07), transparent 70%);

  --sans: "Instrument Sans", "Instrument Sans Fallback", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1680px; --measure: 49rem; /* rem, not em: the same column for a heading as for its text */ --radius: 20px; --radius-s: 12px;
  /* motion: every transition and animation on the site uses these. Things ease out as they arrive and ease in as they
     leave; hover and state changes are fast, arrivals medium; leaving is quicker than arriving. */
  --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-in: cubic-bezier(.4, 0, 1, 1);
  --t-fast: 160ms; --t-in: 240ms; --t-out: 90ms; --t-slow: 450ms;
}
@media (prefers-color-scheme: dark) {
  :root {
    --emerald: #43b592; --red: #ff6079; --gold: #d3c68a; --sapphire: #86b4e2;
    --bg: #0c0e10;
    --text-strong: #f6f6f3; --text: #e2e3df; --muted: #b3b5b0; --faint: #9a9d97;
    --line: rgb(255 255 255 / .08); --line-2: rgb(255 255 255 / .16); --rule: #5a5e62;
    --tint: rgb(255 255 255 / .045);
    --surface: rgb(26 29 33 / .58); --surface-hi: rgb(36 40 45 / .78); --surface-solid: #16191c;
    --edge: rgb(255 255 255 / .07);
    --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 12px 32px -14px rgb(0 0 0 / .6);
    --shadow-lift: 0 2px 6px rgb(0 0 0 / .4), 0 26px 50px -18px rgb(0 0 0 / .75);
    --mesh:
      radial-gradient(56% 42% at 6% -4%, rgb(0 105 78 / .30), transparent 72%),
      radial-gradient(48% 40% at 100% 6%, rgb(64 112 160 / .22), transparent 70%),
      radial-gradient(60% 46% at 74% 104%, rgb(160 152 96 / .12), transparent 72%),
      radial-gradient(40% 34% at 0% 92%, rgb(64 112 160 / .12), transparent 70%);
  }
}

/* metric-matched stand-ins: a first visit that paints before the web font lays out the same lines (sizes from fontTools against Arial / Liberation Sans) */
@font-face { font-family: "Instrument Sans Fallback"; src: local("Arial"), local("Liberation Sans"), local("Helvetica Neue"); size-adjust: 102.97%; ascent-override: 94.2%; descent-override: 24.28%; line-gap-override: 0%; }
@font-face { font-family: "JetBrains Mono Fallback"; src: local("Menlo"), local("Consolas"), local("DejaVu Sans Mono"), local("Liberation Mono"); size-adjust: 100%; ascent-override: 102%; descent-override: 30%; line-gap-override: 0%; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: transparent; color: var(--text); font-family: var(--sans); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
/* the mesh sits on its own fixed layer: identical on every page, so a page change cross-fades content over a background that does not move */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--mesh), var(--bg); pointer-events: none; }
a { color: inherit; }
::selection { background: color-mix(in oklab, var(--emerald) 28%, transparent); }
:focus-visible { outline: 2px solid var(--emerald); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }

/* glass: one recipe for every card, with a solid fallback */
.glass, .card, .figure {
  background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .card, .figure { background: var(--surface); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 1px 0 var(--edge), var(--shadow); }
}

/* top bar: frosted, sticky, the same element on every page (named for the view transition, so it holds still) */
.topbar { position: sticky; top: 0; z-index: 10; view-transition-name: topbar; border-bottom: 1px solid var(--line); background: color-mix(in oklab, var(--bg) 92%, transparent); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar { background: color-mix(in oklab, var(--bg) 62%, transparent); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
}
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: var(--wrap); margin-inline: auto; padding: 12px clamp(16px, 4vw, 32px); color: var(--text-strong); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; font-size: 19px; letter-spacing: -.015em; }
.brand img { width: 36px; height: 36px; border-radius: 9px; filter: brightness(0); } /* the mark is a white mask: ink on the light bar */
@media (prefers-color-scheme: dark) { .brand img { filter: none; } }
.links { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 15px; }
.links a { text-decoration: none; color: var(--muted); padding: 7px 12px; border-radius: 999px; transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.links a:hover { color: var(--text-strong); background: var(--tint); }
.links a[aria-current] { color: var(--text-strong); background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); }
.links .cta { color: var(--bg); background: var(--text-strong); margin-left: 6px; }
.links .cta:hover { color: var(--bg); background: var(--text-strong); transform: translateY(-1px); box-shadow: var(--shadow); }

/* the banner: the head of every page, a rounded card of cloth on ink (hero.js), the same in both themes. Its gradient is
   the first paint and stands in where WebGL is missing; the canvas fades in over it at about the same brightness. One
   element, named for the view transition, so a page change holds the dark card in place instead of fading through paper. */
.banner { position: relative; isolation: isolate; overflow: hidden; margin: clamp(12px, 2vw, 20px) 0 0; border-radius: 28px;
  min-height: clamp(300px, 38vh, 400px); display: flex; align-items: flex-end; color: var(--on-dark); view-transition-name: banner;
  background: radial-gradient(70% 90% at 28% 35%, #0f3a2f 0%, transparent 60%), radial-gradient(55% 75% at 78% 65%, #172c44 0%, transparent 62%),
    radial-gradient(40% 50% at 62% 20%, #2c2a1c 0%, transparent 60%), var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 24px 48px -24px rgb(0 0 0 / .45); }
.banner canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -2; }
.banner::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgb(10 10 10 / .62) 0%, rgb(10 10 10 / .32) 52%, rgb(10 10 10 / 0) 82%); }
.banner-inner { position: relative; width: 100%; padding: clamp(28px, 4.4vw, 60px); }
.banner h1, .banner .sub, .banner .lead, .banner .eyebrow { max-width: 760px; text-shadow: 0 1px 2px rgb(0 0 0 / .4); }
.banner h1 { margin: 0 0 .3em; color: var(--on-dark); font-weight: 600; text-wrap: balance; font-size: clamp(34px, 5vw, 56px); line-height: 1.04; letter-spacing: -.035em; }
.banner .lead, .banner .sub { margin: 0; color: rgb(255 255 255 / .8); font-size: clamp(17px, 1.9vw, 20px); line-height: 1.5; text-wrap: pretty; }
.eyebrow { font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 0 0 14px; }
.banner .eyebrow { color: rgb(255 255 255 / .62); }
/* home: the larger head */
.hero { min-height: clamp(420px, 58vh, 560px); }
.hero h1 { font-size: clamp(42px, 7vw, 80px); line-height: 1; letter-spacing: -.04em; margin-bottom: 20px; }
.hero .sub { margin-bottom: 30px; max-width: 36em; }
.banner .btn.primary { background: var(--on-dark); color: var(--ink); }
.banner .btn.ghost { color: var(--on-dark); border-color: rgb(255 255 255 / .35); background: rgb(255 255 255 / .06); }
.banner .btn.ghost:hover { border-color: var(--on-dark); }
/* the page group's tabs, inside the banner */
.banner .tabs { margin: 22px 0 0; }
.banner .tabs a { color: var(--on-dark); border-color: rgb(255 255 255 / .24); background: rgb(255 255 255 / .07); }
.banner .tabs a:hover { border-color: var(--on-dark); }
.banner .tabs a.on { color: var(--ink); background: var(--on-dark); border-color: var(--on-dark); }
@media (prefers-color-scheme: dark) { .banner { box-shadow: inset 0 0 0 1px rgb(255 255 255 / .07), 0 24px 48px -24px rgb(0 0 0 / .8); } }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15.5px; line-height: 1;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out); }
.btn.primary { background: var(--text-strong); color: var(--bg); box-shadow: var(--shadow); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn.ghost { color: var(--text-strong); border: 1px solid var(--line-2); background: var(--surface); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.btn.ghost:hover { border-color: var(--text-strong); transform: translateY(-1px); }
.btn.solid { background: var(--text-strong); color: var(--bg); text-decoration: none; }
.btn.solid:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }

/* body sections */
.block { padding-block: clamp(48px, 7vw, 88px) 0; }
.block h2, .askcard h2 { margin: 0 0 14px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; letter-spacing: -.03em; font-weight: 600; color: var(--text-strong); text-wrap: balance; max-width: 22em; }
.prose p { margin: 0 0 1.1em; }
.prose strong { color: var(--text-strong); font-weight: 600; }
.note { color: var(--muted); max-width: 46em; margin-top: 22px; }
.note a { color: var(--text-strong); }

.card { padding: 24px 24px 22px; transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 var(--edge), var(--shadow-lift); }
.step h3, .story h3 { margin: 8px 0 8px; font-size: 19px; letter-spacing: -.015em; font-weight: 600; color: var(--text-strong); }
.step p, .story p { margin: 0; color: var(--muted); font-size: 15.5px; }
.label { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.story { display: grid; align-content: start; }
.story .more { margin-top: 16px; font-size: 14px; color: var(--text-strong); font-weight: 600; text-decoration: none; }
.story .about { color: var(--faint); font-size: 14px; margin: 0 0 8px; }

/* ask: a second banner at the foot of the home page */
.ask { padding-block: clamp(56px, 8vw, 96px); }
.askcard.banner { min-height: 0; margin: 0; }
.askcard h2 { color: var(--on-dark); }
.askcard p { color: rgb(255 255 255 / .8); font-size: 18px; max-width: 34em; }
.askcard p a, .askcard p code { color: var(--on-dark); }
.askcard .actions { margin-top: 24px; }

/* document pages: the article is one frosted sheet */
.doc { max-width: 46em; padding-block: clamp(36px, 5vw, 64px); }
.doc h1 { font-size: clamp(32px, 4.4vw, 46px); letter-spacing: -.035em; line-height: 1.08; margin: 0 0 .5em; color: var(--text-strong); font-weight: 600; }
.doc ul, .doc ol { padding-left: 1.2em; }
.doc li { margin: .35em 0; }
.doc a { text-decoration-color: var(--rule); text-underline-offset: 3px; transition: text-decoration-color var(--t-fast) var(--ease-out); }
.doc a:hover { text-decoration-color: var(--text-strong); }

@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } .stories { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
/* the one reduced-motion rule: nothing moves or fades, anywhere */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; transition: none !important; }
}

.figure { margin: 1.4em 0 1.6em; padding: 18px 18px 12px; }
.figure svg text { font-family: var(--sans); }
.figure figcaption { margin-top: 10px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
