/* Sloucher-boy: one stylesheet for every page. Black, one signal colour, tall type. */
@font-face { font-family: "Big Shoulders Display"; src: url("fonts/BigShouldersDisplay.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #000;
  --bg-2: #0b0b0b;
  --text: #f7f7f5;
  --muted: #9b9b98;
  --faint: #5e5e5b;
  --line: #1f1f1f;
  --accent: #ffd60a;          /* signal yellow: the alert colour */
  --accent-dim: rgba(255, 214, 10, .12);
  --display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", ui-monospace, Consolas, "SF Mono", monospace;
}

/* one language at a time: bilingual text comes in [lang="en"] / [lang="fr"] pairs */
html:not([lang="fr"]) body [lang="fr"], html[lang="fr"] body [lang="en"] { display: none; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; text-decoration-color: var(--faint); text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3, p { margin: 0; }
h1, h2, .display { font-family: var(--display); font-weight: 800; letter-spacing: .005em; line-height: .92; }
em { }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } }

/* top line: a wordmark and a language switch, nothing else */
.top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
.top .wrap { display: flex; justify-content: space-between; align-items: center; height: 76px; font-size: 14px; }
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: .01em; }
.mark img { width: 22px; height: 22px; border-radius: 6px; }
.switch { background: none; border: 0; padding: 6px 0; color: var(--muted); font: inherit; cursor: pointer; }
.switch:hover { color: var(--text); }

/* links that read as text, with an arrow */
.go { display: inline-flex; gap: .4em; align-items: baseline; text-decoration: none; border-bottom: 1px solid var(--faint); padding-bottom: 2px; transition: border-color .2s, color .2s; }
.go:hover { border-color: var(--accent); color: var(--accent); }
.go::after { content: "→"; transition: transform .2s; }
.go:hover::after { transform: translateX(3px); }

footer { border-top: 1px solid var(--line); padding: 28px 0 44px; font-size: 13.5px; color: var(--faint); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer a { text-decoration: none; color: var(--muted); }
footer a:hover { color: var(--text); }
footer .switch { padding: 0; font-size: inherit; line-height: inherit; }

/* long-form pages (story, extra resources, privacy) */
.page-head { padding: 168px 0 64px; }
.page-head .label { font-size: 14px; color: var(--accent); margin-bottom: 20px; }
.page-head h1 { font-size: clamp(48px, 8vw, 104px); max-width: 14ch; }
.page-head .dek { font-size: clamp(19px, 2.2vw, 23px); color: var(--muted); margin-top: 26px; max-width: 34em; line-height: 1.5; }
.byline { font-size: 14px; color: var(--faint); margin-top: 28px; }
.prose > * { max-width: 680px; }   /* left-aligned with the page heading */
.prose p { color: #d8d8d5; margin-top: 1.1em; }
.prose h2 { font-size: clamp(30px, 4vw, 42px); margin-top: 2.2em; }
.prose .n { display: block; font-family: var(--display); font-weight: 800; color: var(--accent); font-size: 22px; margin-bottom: 6px; letter-spacing: 0; }
.prose code, .err { font-family: var(--mono); font-size: 13.5px; }
.err { display: block; margin-top: 1.1em; padding: 12px 14px; border-left: 2px solid var(--accent); background: var(--accent-dim); color: #fff3b8; overflow-wrap: anywhere; }
.prose .lesson { font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.12; color: var(--text); margin-top: 1.2em; }
.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section > .wrap > h2 { font-size: clamp(34px, 4.6vw, 54px); }
.section .sub { color: var(--muted); margin-top: 12px; max-width: 40em; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* smooth page changes: the browser crossfades between pages (no script), and the logo stays put */
@view-transition { navigation: auto; }
.mark { view-transition-name: mark; }
::view-transition-old(root) { animation: .28s ease-in both page-out; }
::view-transition-new(root) { animation: .42s cubic-bezier(.2, .8, .2, 1) .06s both page-in; }
@keyframes page-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
