/* peterstieg.com · Admiring complexity. Loving simplicity. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {                                          /* the torch's code and the keys card – loaded on first use */
  font-family: "Atkinson Hyperlegible Mono";
  src: url("fonts/atkinson-hyperlegible-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --paper: #F7F6F3;
  --ink: #1A1C1E;
  --muted: #565B60;
  --line: #DCDAD4;
  --accent: #7A1A2C;
  --accent-soft: #E8C3CA;
  --bar: #C4C6C9;
  --bar-lit: #6E7378;
  --lit: #FFFFFF;                                     /* the paper under the torch's light */
  color-scheme: light dark;                         /* the browser's own surfaces (scrollbars, canvas) follow the system */
}
:root[data-theme="light"] { color-scheme: light; }  /* a pick pins them */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #181A1C;
    --ink: #F5F4F2;
    --muted: #A3A8AD;
    --line: #2F3337;
    --accent: #C98593;
    --accent-soft: #4E0E1B;
    --bar: #3A3F44;
    --bar-lit: #8E949A;
    --lit: #25282C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #181A1C;
  --ink: #F5F4F2;
  --muted: #A3A8AD;
  --line: #2F3337;
  --accent: #C98593;
  --accent-soft: #4E0E1B;
  --bar: #3A3F44;
  --bar-lit: #8E949A;
  --lit: #25282C;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
  font-kerning: normal;
}

::selection { background: var(--accent-soft); color: var(--ink); }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover { text-decoration-color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 0.75rem; z-index: 10; text-decoration: none;
}
.skip:focus { top: 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- frame ---------- */

.wrap {
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 48rem) { .wrap { padding-inline: 2.5rem; } }
@media (min-width: 74rem) { .wrap { padding-right: 8rem; } }

.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
}
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 3.5rem;
}
.home {
  position: relative; flex: none;
  font-weight: 700; text-decoration: none; white-space: nowrap;
  font-size: 1rem;
}
/* logo: the lockup >_ P/S, 28 px tall – its clear space (one stem, 158 of 813 units: 5.4 px) is inside the
   header's height and gaps. overflow: visible lets the wordmark reach out while it condenses (site.js). */
.home .lockup { display: block; height: 1.75rem; width: auto; overflow: visible; }
.lockup .acc { fill: var(--accent); }
.lockup .ink { fill: var(--ink); }
/* the wordmark the hero name docks into: measured, never shown – site.js draws it into the lockup instead */
.home .word { position: absolute; left: 0; top: 50%; transform: translateY(-50%); visibility: hidden; pointer-events: none; }
.home .caret { display: inline-block; color: var(--accent); margin-right: 0.45em; }
.home .name { display: inline-block; text-transform: uppercase; letter-spacing: 0.055em; }
.nav { display: flex; align-items: center; gap: 1.25rem; font-size: 0.95rem; }
@media (max-width: 47.99rem) { .nav { gap: 0.5rem; } .top .wrap { gap: 0.75rem; } }

/* docking: the hero name and its prompt become the header logo (see site.js) */
.js .top.dock .home { visibility: hidden; }
.js .top.dock.docked .home { visibility: visible; }
.hero h1, .hero .prompt .caret { transform-origin: 0 0; }
.hero.flying h1, .hero.flying .prompt .caret { position: relative; z-index: 6; will-change: transform; }
.hero.docked h1, .hero.docked .prompt .caret { opacity: 0; pointer-events: none; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }
/* menu numbers match the headings ("01 Profile"). You are here (site.js): the section being read looks like
   its heading – number in accent, label in ink and bold. A hidden bold copy of the label (data-label)
   reserves the width, so the menu never shifts. */
.nav .sect { white-space: nowrap; }
.nav .sect .no { font-variant-numeric: tabular-nums; }
.nav .sect .label { display: inline-grid; }
.nav .sect .label::after { content: attr(data-label); font-weight: 700; height: 0; overflow: hidden; visibility: hidden; }
.nav .sect[aria-current] { color: var(--ink); }
.nav .sect[aria-current] .no { color: var(--accent); }
.nav .sect[aria-current] .label { font-weight: 700; }
.langs {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.1rem 0.3rem;
}
.langs > * { padding: 0 0.35rem; line-height: 1.6; }
.nav .langs a { color: var(--muted); }
.nav .langs a:hover { color: var(--ink); }
.langs [aria-current] { color: var(--ink); font-weight: 700; }

/* theme switch: same pill as the languages */
.themes {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.1rem 0.2rem;
}
.themes button {
  display: inline-grid; place-items: center;
  width: 1.7rem; height: 1.5rem; padding: 0; margin: 0;
  border: 0; border-radius: 999px; background: none;
  color: var(--muted); cursor: pointer;
}
.themes button:hover { color: var(--ink); }
.themes button[aria-pressed="true"] { color: var(--ink); }
.themes svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.themes button[aria-pressed="true"] svg { stroke-width: 2; }
/* touch screens: the language and theme buttons take taps 44 px high – the header has room above and below them */
@media (pointer: coarse) {
  .themes button, .langs a { position: relative; }
  .themes button::after, .langs a::after { content: ""; position: absolute; inset: -10px 0; }
}
html:not(.js) .themes { display: none; }
@media (max-width: 47.99rem) { .nav .sect { display: none; } }
@media (max-width: 55.99rem) { .nav .sect .no { display: none; } }  /* narrow desktops: labels only, so the header fits */

/* ---------- hero ---------- */

.hero { padding-block: clamp(3.5rem, 13vh, 8.5rem) clamp(3rem, 9vh, 6rem); }
.hero h1 {
  margin: 0 0 1.1rem;
  font-size: clamp(2.6rem, 9.2vw, 5.75rem);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.tagline {
  margin: 0 0 0.35rem;
  font-size: clamp(1.3rem, 3.3vw, 2rem);
  line-height: 1.25;
}
.claim {
  margin: 0 0 1.6rem;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  line-height: 1.3;
  color: var(--muted);
}
.prompt {
  margin: 0;
  font-size: clamp(1rem, 2.1vw, 1.25rem);
  min-height: 1.6em;
}
.prompt .caret { display: inline-block; color: var(--accent); font-weight: 700; margin-right: 0.45em; }
.cursor {
  display: inline-block; width: 0.55em; height: 1.05em;
  margin-left: 0.12em; vertical-align: -0.16em;
  background: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .typed .cursor { animation: blink 1.1s steps(2, start) 3; }
}
@keyframes blink { to { visibility: hidden; } }

/* ---------- sections ---------- */

.sec {
  display: grid;
  gap: 0.75rem 2.5rem;
  padding-block: 3rem;
  border-top: 1px solid var(--line);
}
@media (min-width: 48rem) {
  .sec { grid-template-columns: 11rem minmax(0, 1fr); padding-block: 3.75rem; }
  .sec > h2 { position: sticky; top: 5rem; align-self: start; }
}
.sec > h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 700;
}
/* phones: the heading of the section being read sticks under the header, as one bar with it – a heading
   is always in view. site.js marks the stuck one (.stuck): it takes over the header's hairline (.ext).
   Stacked above its content, the heading is larger than on desktop, where its own column sets it apart:
   26 px, above the headword (24 px) and the P⁴ headings (22 px). */
@media (max-width: 47.99rem) {
  html { scroll-padding-top: 3.5rem; }            /* a jump to a section lands its border on the header's */
  .hero { padding-block: 2.5rem; }                /* the first screen reaches the profile text */
  .sec { padding-block: 2rem; }
  .sec > h2 {
    font-size: 1.625rem;
    margin-inline: -1rem; padding: 0.5rem 1rem;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    border-bottom: 1px solid transparent;
  }
}
/* the bar sticks only where the screen is tall enough – in landscape, header and bar would cover a third of it */
@media (max-width: 47.99rem) and (min-height: 30rem) {
  .sec > h2 { position: sticky; top: calc(3.5rem + 1px); z-index: 3; }
  .sec > h2.stuck { border-bottom-color: var(--line); }
  .top.ext { border-bottom-color: transparent; }
  /* jump targets and focused links clear the stuck heading – Shift+Tab no longer hides a link behind it */
  .role, .projects > li, .fnref a, .notes li, .sec .body :is(a[href], summary) { scroll-margin-top: 3.75rem; }
}
/* chapter number, like a slide deck's parts: "01 Profile" – equal-width digits keep the titles aligned.
   The other sections of a chapter carry the same number invisibly (.ghost), so their titles line up with it. */
.sec > h2 .no { color: var(--accent); font-weight: 400; font-variant-numeric: tabular-nums; }
.sec > h2 .ghost { visibility: hidden; }
.body { max-width: 42rem; container: body / inline-size; }   /* its grids switch on its own width, not the window's */
/* line breaks: headings in lines of even length, paragraphs without a lone word on the last line.
   Not the section headings (the phone bar has a background) and not the hero's name (one line). Ignored where unsupported. */
h3, h4, .tagline, .claim, .lost h1, .legal h1, .legal h2 { text-wrap: balance; }
:where(.body) p, .tree li, .notes li, .facts dd { text-wrap: pretty; }
.body > :first-child { margin-top: 0; }
.body > :last-child { margin-bottom: 0; }
:where(.body) p { margin: 0 0 1em; }

h3 { margin: 0 0 0.3rem; font-size: 1.125rem; line-height: 1.35; font-weight: 700; }

.muted { color: var(--muted); }

/* ledger of results */
.ledger { margin: 2rem 0 0; padding: 0; }
.ledger div {
  display: grid; gap: 0.15rem 1.5rem;
  padding-block: 0.9rem;
  border-top: 1px solid var(--line);
}
.ledger dt {
  font-size: 1.5rem; font-weight: 700; line-height: 1.2;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ledger dd { margin: 0; color: var(--muted); }
.ledger dd a { white-space: nowrap; }
@media (max-width: 22rem) { .ledger dt { font-size: 1.3rem; } }   /* the longest result still fits a 320px screen */
/* ↓ after the company: the link stays on this page – superscript and in accent, like the footnote numbers */
.ledger .jmp { display: inline-block; width: 0.6em; height: 0.6em; margin-left: 0.1em; position: relative; top: -0.5em; color: var(--accent); }
/* ↗ after a link that leaves the site: it opens in a new tab. Quieter than the ↓ – muted, in accent on hover */
.newtab { display: inline-block; width: 0.55em; height: 0.55em; margin-left: 0.1em; position: relative; top: -0.5em; color: var(--muted); }
a:hover .newtab, a:focus-visible .newtab { color: var(--accent); }
.nw { white-space: nowrap; }                     /* the last word and its ↗ stay together */
.newtab.sym { width: 0.8em; height: 0.8em; top: -0.42em; }   /* envelope and pin: more detail than the ↗ … */
.newtab.sym svg { stroke-width: 1.5; }                       /* … drawn in the same line weight */
.ledger .jmp svg, .newtab svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }

/* fields of work */
.fields { display: grid; gap: 1.75rem 2.5rem; }
@container body (inline-size >= 34rem) { .fields { grid-template-columns: 1fr 1fr; } }
.fields p { margin: 0; color: var(--muted); }

/* experience timeline */
.roles { list-style: none; margin: 0; padding: 0; }
.role { display: grid; gap: 0.2rem 1.5rem; padding-bottom: 2rem; }
.role + .role { padding-top: 2rem; border-top: 1px solid var(--line); }
.role:last-child { padding-bottom: 0; }
@container body (inline-size >= 30rem) { .role { grid-template-columns: 9.5rem 1fr; } }
.when {
  margin: 0; color: var(--muted); font-size: 0.95rem;
  font-variant-numeric: tabular-nums; padding-top: 0.15rem; white-space: nowrap;
}
.when .dur { font-size: 0.85rem; }               /* the duration, on its own line under the dates */
.role h3 { margin-bottom: 0.1rem; }
.org { margin: 0 0 0.5rem; }
.org .place { color: var(--muted); }
.ctx { margin: 0 0 0.6rem; color: var(--muted); font-size: 1rem; }
/* reached from the ledger: dates and title in accent */
.role:target > .when, .role:target > div > h3 { color: var(--accent); }

/* behind a disclosure: the titles within one role (Posterlounge), the positions one entry sums up (2010–2014) */
.more { margin-top: 0.75rem; }
.more summary {
  display: inline-flex; align-items: center; gap: 0.5em;
  list-style: none; cursor: pointer; color: var(--muted); font-size: 1rem;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::before {                           /* a chevron: points right, turns down when open */
  content: ""; width: 0.42em; height: 0.42em; margin-top: -0.1em;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
.more[open] summary::before { transform: rotate(45deg); margin-top: -0.3em; }
.more summary:hover { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) { .more summary::before { transition: transform 0.2s, margin 0.2s; } }
.more .tree { margin-top: 0.5rem; }              /* the steps inside one entry, newest first */
.more .tree li { padding-bottom: 0.45rem; }
.more .tree .at { color: var(--muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; }   /* dates · duration */

/* projects */
.group + .group { margin-top: 2.5rem; }
.group > h3 { color: var(--muted); font-weight: 400; font-size: 1rem; margin-bottom: 1rem; }
.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.4rem; }
.projects h4 { margin: 0 0 0.15rem; font-size: 1.125rem; font-weight: 700; }
.projects p { margin: 0; }
.projects .stack { color: var(--muted); font-size: 0.95rem; margin-top: 0.2rem; }

/* education */
.facts { margin: 0; }
.facts div { display: grid; gap: 0.1rem 1.5rem; padding-block: 0.75rem; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; padding-top: 0; }
@container body (inline-size >= 30rem) { .facts div { grid-template-columns: 9.5rem 1fr; } }
.facts dt { color: var(--muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; padding-top: 0.15rem; }
.facts dd { margin: 0; }
.lines { list-style: none; margin: 0; padding: 0; }    /* languages: one per line */

/* dictionary entry: the word on GitHub, defined like Merriam-Webster, Duden or Treccani would */
.entry { margin: 0 0 1.75rem; }
.hw { margin: 0 0 0.4rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.8rem; }
.hw dfn { font-style: normal; font-weight: 700; font-size: clamp(1.7rem, 4.4vw, 2.3rem); line-height: 1.15; }
@media (max-width: 47.99rem) { .hw dfn { font-size: 1.5rem; } }   /* phones: below the section heading above it */
.hw .syl { color: var(--muted); font-weight: 400; margin: 0 0.03em; }
.pos { font-style: italic; color: var(--muted); }
.ety { color: var(--muted); font-size: 1rem; }
.def { margin: 0; font-size: 1.25rem; line-height: 1.5; }
.ety i { font-style: italic; }

/* P⁴ */
.sec > h2 sup { font-size: 0.62em; line-height: 0; vertical-align: 0.55em; margin-left: 0.04em; }
.fields h3 { font-size: 1.375rem; margin-bottom: 0.25rem; }

/* #JobAlert tree: ├── and └── drawn with borders, so they align in any font */
.tree { list-style: none; margin: 0.35rem 0 0; padding: 0; }
.tree li { position: relative; padding-left: 1.7em; margin: 0; padding-bottom: 0.2rem; }
.tree li::before {
  content: ""; position: absolute; left: 0.3em; top: 0; bottom: 0;
  border-left: 1px solid var(--muted);
}
.tree li:last-child::before { bottom: auto; height: 0.8em; }
.tree li::after {
  content: ""; position: absolute; left: 0.3em; top: 0.8em; width: 0.95em;
  border-top: 1px solid var(--muted);
}
.tree .k { font-weight: 700; }

/* drawn arrow: → is not part of Atkinson Hyperlegible */
.arr { display: inline-block; width: 0.95em; height: 0.62em; margin: 0 0.12em; vertical-align: 0.06em; }
.arr svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.ledger dt .arr svg { stroke-width: 2.1; }

/* footnotes */
.fnref { font-size: 0.68em; line-height: 0; vertical-align: 0.6em; margin-left: 0.08em; }
.fnref a { text-decoration: none; color: var(--accent); font-weight: 700; padding: 0 0.1em; }
.fnref a:hover { text-decoration: underline; }
.notes { margin: 0; padding-left: 1.4em; color: var(--muted); font-size: 0.95rem; display: grid; gap: 0.5rem; }
.notes li::marker { color: var(--ink); font-weight: 700; }
.notes .back { text-decoration: none; color: var(--accent); font-weight: 700; margin-right: 0.15em; }
.notes li:target { color: var(--ink); }

/* 404 */
.lost { padding-block: clamp(3.5rem, 13vh, 8.5rem) clamp(3rem, 9vh, 6rem); }
.lost .code { margin: 0; font-size: clamp(3rem, 10vw, 6rem); line-height: 1; font-weight: 700; letter-spacing: 0.04em; }
.lost h1 { margin: 0.6rem 0 0.35rem; font-size: clamp(1.3rem, 3.3vw, 2rem); line-height: 1.25; font-weight: 400; }
.dki { font-family: inherit; font-size: inherit; color: var(--accent); }

/* up · sections · down: appears once the name has docked; on wide screens it sits under the minimap.
   site.js points up and down at the section above and below, the middle shows the chapter and opens the list. */
.jump {
  position: fixed; z-index: 5;
  right: max(1rem, calc(env(safe-area-inset-right, 0px) + 1rem));
  bottom: max(1rem, calc(env(safe-area-inset-bottom, 0px) + 1rem));
  display: flex; flex-direction: column;
  width: 2.75rem; border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  opacity: 0; visibility: hidden; transform: translateY(0.5rem);
  transition: opacity 0.2s, transform 0.2s, visibility 0s linear 0.2s;
}
.top.docked ~ .jump { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s, transform 0.2s; }
html:not(.js) .jump { opacity: 1; visibility: visible; transform: none; }
html:not(.js) .jump .down { display: none; }       /* without JavaScript: up to the top and the list */
.jump .up, .jump .down, .jump summary {
  display: grid; place-items: center; height: 2.5rem;
  color: var(--ink); text-decoration: none; cursor: pointer;
}
.jump .up { border-radius: 999px 999px 0 0; }
.jump .down { border-radius: 0 0 999px 999px; }
.jump summary {
  list-style: none;
  background: linear-gradient(var(--line), var(--line)) top / 1.25rem 1px no-repeat,
              linear-gradient(var(--line), var(--line)) bottom / 1.25rem 1px no-repeat;   /* short hairlines between the three */
}
.jump summary::-webkit-details-marker { display: none; }
.jump .up:hover, .jump .down:hover, .jump summary:hover, .jump .menu[open] summary { color: var(--accent); }
.jump [aria-disabled="true"], .jump [aria-disabled="true"]:hover { color: var(--line); cursor: default; }
.jump :focus-visible { outline-offset: -3px; }
.jump svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.jump .cur { font-size: 0.9rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.jump .cur:empty { display: none; }
.jump .cur:not(:empty) + svg { display: none; }    /* the chapter number once there is one, the lines before */
.jump .menu ol {
  position: absolute; right: calc(100% + 0.5rem); bottom: 0;
  margin: 0; padding: 0.4rem 0; list-style: none;
  max-height: calc(100vh - 6rem); overflow: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: 0.5rem;
  box-shadow: 0 0.4rem 1.25rem color-mix(in srgb, var(--ink) 14%, transparent);
  font-size: 0.95rem;
}
.jump .menu a { display: block; padding: 0.35rem 1.1rem 0.35rem 0.9rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.jump .menu a:hover { color: var(--ink); }
.jump .menu .no { color: var(--accent); font-variant-numeric: tabular-nums; }
.jump .menu .ghost { visibility: hidden; }
.jump .menu sup { font-size: 0.62em; line-height: 0; vertical-align: 0.55em; }
.jump .menu [aria-current] { color: var(--ink); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .jump, .top.docked ~ .jump { transition: none; } }
@media (min-width: 74rem) and (min-height: 30rem) {
  .jump { right: calc(1.75rem + (4.25rem - 2.75rem) / 2); bottom: 1.75rem; }
}

/* footer */
.foot { border-top: 1px solid var(--line); padding-block: 2rem 2.5rem; color: var(--muted); font-size: 0.95rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.foot a { color: inherit; }

/* legal pages */
.legal { padding-block: 3rem 4rem; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.15; margin: 0 0 2rem; }
.legal h2 { font-size: 1.25rem; margin: 2.25rem 0 0.5rem; }
.legal .body { max-width: 40rem; }
.legal address { font-style: normal; }
.legal ul { padding-left: 1.2em; }

/* ---------- torch (site.js): the page's code under a light that follows the pointer ---------- */

.torch {
  position: fixed; left: 0; top: 0; z-index: 4;       /* under the header (5): the menu stays readable */
  width: 320px; height: 320px; border-radius: 50%; overflow: hidden;
  background: var(--lit); pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0s 0.25s;
  -webkit-mask-image: radial-gradient(closest-side, #000 84%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 84%, transparent 100%);
}
.torch.on { opacity: 1; visibility: visible; transition: opacity 0.25s; }
.torch-sheet { position: absolute; left: 0; top: 0; }
.torch-box {
  position: absolute; overflow: hidden;
  font-family: "Atkinson Hyperlegible Mono", ui-monospace, monospace; font-weight: 400; line-height: 1.3;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink);
}
.torch-box b { font-weight: 400; color: var(--accent); }
.torch-box i { font-style: normal; color: var(--muted); }
.torch-box .ln { color: var(--muted); }
.torch .g, .torch.deep .h { display: none; }
.torch.deep .g { display: inline; }
.torch-tag {
  position: fixed; left: 0; top: 0; z-index: 4; width: 320px;
  text-align: center; pointer-events: none; opacity: 0;
  font: 400 12px/1.2 "Atkinson Hyperlegible Mono", ui-monospace, monospace; color: var(--accent);
}
.torch-tag.on { opacity: 1; }
.torch-tag span { padding: 0.2em 0.6em; border-radius: 999px; background: var(--lit); }   /* legible over the page's text */
.torch-tag.on span { pointer-events: auto; cursor: pointer; }   /* a tap takes the step it names (site.js) */
.prompt .sudo { cursor: pointer; -webkit-tap-highlight-color: transparent; }   /* tap or click: the torch (site.js) */
@media (prefers-reduced-motion: reduce) { .torch, .torch.on { transition: none; } }

/* ? – the shortcuts, in a card under the header's right end (site.js places it): what it does left, the key right */
.keys {
  position: fixed; inset: auto; margin: 0; padding: 0;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); font-size: 0.95rem; line-height: 1.4;
  box-shadow: 0 0.4rem 1.25rem color-mix(in srgb, var(--ink) 12%, transparent);
}
.keys .head {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  margin: 0; padding: 0.55rem 0.55rem 0.55rem 1rem; border-bottom: 1px solid var(--line);
}
.keys .close {
  display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; padding: 0;
  border: 0; border-radius: 50%; background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--muted); cursor: pointer;
}
.keys .close:hover { color: var(--ink); }
.keys .close svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.keys dl { display: grid; grid-template-columns: auto auto; align-items: center; gap: 0.55rem 1rem; margin: 0; padding: 0.85rem 1rem 1rem; }
.keys dl div { display: contents; }
.keys dt { text-align: right; }
.keys dd { margin: 0; }
.keys kbd {                                           /* a key cap: a box with a heavier lower edge */
  display: inline-block; min-width: 1.75em; padding: 0.05em 0.45em;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  background: color-mix(in srgb, var(--ink) 4%, var(--paper));
  font: 400 0.85em/1.5 "Atkinson Hyperlegible Mono", ui-monospace, monospace; text-align: center;
}

/* ---------- minimap ---------- */

.minimap { display: none; }
@media (min-width: 74rem) and (min-height: 30rem) {
  .minimap {
    display: block;
    position: fixed;
    right: 1.75rem;
    top: 5rem;
    bottom: 10.25rem;                             /* above the jump control */
    width: 4.25rem;
    cursor: pointer;
    touch-action: none;
    z-index: 4;
  }
}
.mm-measure .sec > h2 { position: static; }
.mm-bar {
  position: absolute; left: 0; height: 2px; border-radius: 1px;
  background: var(--bar);
}
.mm-bar.h { background: var(--bar-lit); }
.mm-bar.lit { background: var(--bar-lit); }
.mm-bar.h.lit { background: var(--ink); }
.mm-bar.ch, .mm-bar.ch.lit { background: var(--accent); }   /* the four chapters, like the numbers in their headings */
.mm-view {
  position: absolute; left: -0.5rem; right: -0.5rem;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border: 1px solid var(--line);
  pointer-events: none;
}

/* Windows high-contrast mode: the browser repaints with system colours and drops backgrounds. The logo takes the
   text colour, the minimap's bars become borders in system colours, and the picked theme gets an outline –
   a thicker stroke alone tells nothing apart. */
@media (forced-colors: active) {
  .lockup .acc, .lockup .ink { fill: CanvasText; }
  .mm-bar { background: none; border-top: 2px solid GrayText; }
  .mm-bar.h, .mm-bar.lit, .mm-bar.h.lit { border-top-color: CanvasText; }
  .mm-bar.ch, .mm-bar.ch.lit { border-top-color: Highlight; }
  .mm-view { border-color: CanvasText; }
  .themes button[aria-pressed="true"] { outline: 1px solid ButtonText; }
}
@media print {
  .top, .minimap, .skip, .jump, .torch, .torch-tag, .keys { display: none; }
  .hero h1, .hero .prompt .caret { transform: none !important; opacity: 1 !important; }
  .hero .prompt .cmd, .hero .prompt .cursor { opacity: 1 !important; }
  .sec > h2 { position: static; }
  body { font-size: 11pt; }
}
