@font-face {
  font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('fonts/instrument-sans-400-600-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: 'Instrument Sans'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('fonts/instrument-sans-400-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/ibm-plex-mono-400-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: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/ibm-plex-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/ibm-plex-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;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/ibm-plex-mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}


/* ── TOKENS · the only place this environment holds a value ──────────────── */

:root {
  color-scheme: light dark;

  --paper:  #FDFCFA;
  --ink:    #111316;
  --muted:  #61656C;
  --hair:   #E2E0DC;

  /* The lecture notes' two colours, so that the notes and this environment
     read as one seminar: mainblue RGB(10,55,115) and maingreen RGB(15,95,55).
     Navy carries structure — headings, the primary action, focus, the meter.
     Green means "a worked thing you follow", which is what the notes' green
     bar means beside an Example and what our green bar means beside a task.
     Two accents and no more; the notes' purple and red are left in the notes,
     because four accents in an interface this small is noise. */
  --accent:  #0A3773;
  --example: #0F5F37;

  --font: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "DejaVu Sans Mono", monospace;

  --t-title:   clamp(2.1rem, 4.4vw, 3rem);
  --t-h2:      clamp(1.5rem, 2.4vw, 1.9rem);
  --t-h3:      1.14rem;
  --t-lead:    clamp(1.1rem, 1.5vw, 1.28rem);
  --t-body:    1.02rem;
  --t-small:   .9rem;
  --t-label:   .69rem;

  --gap:  1.5rem;
  --run:  4.5rem;
  --page: 100rem;      /* the frame, the same on every screen */
  --col:  36rem;       /* the reading measure inside it */

  --line:  1px;        /* the hairline's weight; --hair is its colour */
  --tempo: .15s;       /* every transition in the system; none is longer */
}

/* Every scope redeclares all six colours and nothing else — which is why no
   rule below needs a light, dark or print variant. The notes have no dark
   theme and this does, so navy and green each need a lighter twin: #0A3773 on
   a near-black ground is all but invisible. */

:root[data-theme="dark"] {
  --paper: #0E0F11; --ink: #E9EBED; --muted: #969CA4; --hair: #24272C;
  --accent: #9DC0EA; --example: #6FBF95;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E0F11; --ink: #E9EBED; --muted: #969CA4; --hair: #24272C;
    --accent: #9DC0EA; --example: #6FBF95;
    }
}

@media print {
  :root {
    --paper: #FFFFFF; --ink: #000000; --muted: #3A3A3A; --hair: #BBBBBB;
    --accent: #000000; --example: #000000;
  }
}


/* ── BASE ────────────────────────────────────────────────────────────────── */

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

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

/* Read but not seen. clip-path rather than display:none or visibility:hidden,
   both of which take the text out of the accessibility tree along with the
   layout — which is the opposite of what this is for. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden;
           clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: -9999px; }
.skip:focus { position: static; display: inline-block; padding: .5rem 0; color: var(--ink); }

[id] { scroll-margin-top: 2rem; }


/* ── TYPE ────────────────────────────────────────────────────────────────── */

/* Headings are navy, as the notes' sections are. Body text stays ink: the
   notes colour their headings and not their prose, and so does this. */
h1 { font-size: var(--t-title); font-weight: 600; letter-spacing: -.03em;
     line-height: 1.05; margin: 0; text-wrap: balance; color: var(--accent); }
h2 { font-size: var(--t-h2); font-weight: 600; letter-spacing: -.02em;
     line-height: 1.2; margin: 0; text-wrap: balance; color: var(--accent); }
h3 { font-size: var(--t-h3); font-weight: 600; letter-spacing: -.01em; margin: 0; }
p  { margin: 0; text-wrap: pretty; }
a  { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: .88em; }

.lead  { font-size: var(--t-lead); line-height: 1.45; color: var(--muted); }
.small { font-size: var(--t-small); color: var(--muted); }

.label { font-family: var(--mono); font-size: var(--t-label); font-weight: 500;
         letter-spacing: .17em; text-transform: uppercase; color: var(--muted);
         font-variant-numeric: tabular-nums; }
.label-em { color: var(--accent); }

/* appearance:none because a native control keeps the operating system's shape,
   rounded on Safari, even once you have set its background. The system draws no
   global reset — enclosure is a theme now, not a law — so each control that can
   inherit native chrome squares itself. */
button.label { appearance: none; -webkit-appearance: none;
               background: 0; border: 0; padding: 0; cursor: pointer; }
/* A label that acts, whichever element it is: the game's Map button and the
   practice screen's Skill tree link do the same job in the same corner, and a
   reader should not have to know which one is a button to see it respond. */
button.label:hover,
a.label:hover { color: var(--ink); }

/* ── HAIRLINE — the only structural device ───────────────────────────────── */

.rule { height: var(--line); background: var(--hair); border: 0; margin: 0; }


/* ── LAYOUT ──────────────────────────────────────────────────────────────── */

/* One width for the whole app. It used to be two — a 60rem reading page for the
   map, statistics and settings, and a 100rem one for the screens with an editor
   — and moving between them made the masthead and the hairlines jump, which read
   as two different sites rather than one. So the frame is fixed and the measure
   is what narrows: `col` and `prose` hold text to 36rem wherever they sit, and
   only the things that are genuinely a full-width row — a tree, a meter, a rule
   — use all of it. */
.page { width: min(100% - 2.5rem, var(--page)); margin-inline: auto; }
.col  { max-width: var(--col); }

/* A figure groups a heading, a table of rows and a caption — the statistics
   sections are the only ones. It is here for the margin: a browser insets
   <figure> by 40px of its own accord, which left those sections standing in
   from the headings above them and from every hairline on the page. */
.figure { margin: 0; }

.run       { padding-block: var(--run); }
.run-tight { padding-block: 2rem; }

.stack       > * + * { margin-top: var(--gap); }
.stack-tight > * + * { margin-top: .5rem; }

.between { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.actions { display: flex; align-items: center; gap: 1.6rem; }

/* The index that opens a row — mono, tabular, and quiet. */
.index { font-family: var(--mono); font-size: var(--t-label); letter-spacing: .1em;
         color: var(--muted); font-variant-numeric: tabular-nums; }


/* ── MASTHEAD ────────────────────────────────────────────────────────────── */

.masthead { display: flex; align-items: center; justify-content: space-between;
            gap: 2rem; flex-wrap: wrap; padding-block: 1.6rem; }
.masthead nav { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
.masthead nav a { font-size: var(--t-small); color: var(--muted); }
.masthead nav a:hover { color: var(--ink); }

/* The mark is sized in em, so the lockup keeps its proportion if the type scale
   moves — about 1.6x cap height, where a mark reads as balanced against a name
   rather than dominating it. */
.brand { display: flex; align-items: center; gap: .7rem; }
/* The mark takes the accent; the wordmark beside it stays ink, so the pair
   reads as a mark and a name rather than as one coloured lump. */
.brand svg { width: 1.6em; height: 1.6em; flex: none; color: var(--accent); }
.wordmark { font-size: var(--t-body); font-weight: 600; letter-spacing: -.015em; }


/* ── FOOTER ──────────────────────────────────────────────────────────────── */

/* A band of nothing under the closing rule, the same height as the masthead's,
   so the page is framed by two hairlines with equal air behind them. Its whole
   job is to stop the content ending at the bottom of the window with no edge.
   On the working screens that band goes — see the wide layout below. */
.footer { padding-block: 1.6rem; }


/* ── COMPONENTS — §5, pruned to what this environment exercises ──────────────
   Copied, not linked. If one of these looks wrong, the design system is right
   and this file is stale — never the other way round. */

/* Link · the underline is always drawn and only gains contrast on hover. One
   that appears on hover shifts the text's baseline box and feels twitchy. */
.link { text-decoration: underline; text-decoration-color: var(--hair);
        text-decoration-thickness: 1px; text-underline-offset: .22em;
        transition: text-decoration-color var(--tempo) ease; }
.link:hover { text-decoration-color: var(--ink); }

/* Hairline, second form · a mark down the left of a block. This is how the
   system says "aside" without drawing a box — and it is only used for hints,
   so it takes the weight of the task's bar in grey rather than green. The
   notes pair their Example and Remark boxes exactly this way: same bar, one
   coloured and one not. */
.mark { border-left: 3px solid var(--hair); padding-left: var(--gap); }

/* Button · primary is the accent filled, the only filled shape the system
   draws.
   Secondary carries no border, because a bordered button is a box — it is a
   text button, and the arrow is what marks it as an action. */
.button { appearance: none; -webkit-appearance: none;
          display: inline-block; padding: .62rem 1.15rem;
          font: 500 var(--t-small)/1.2 var(--font);
          background: var(--accent); color: var(--paper); border: 0; cursor: pointer;
          transition: background var(--tempo) ease; }
.button:hover { background: var(--muted); }

.button-text { appearance: none; -webkit-appearance: none;
               display: inline-block; padding: .62rem 0;
               font: 500 var(--t-small)/1.2 var(--font);
               background: 0; border: 0; color: var(--ink); cursor: pointer; }
.button-text::after { content: " →"; color: var(--muted); }
.button-text:hover { text-decoration: underline; text-underline-offset: .22em; }

/* Back is the one text button that points the other way, so it takes the arrow
   on its other side. And it needs a disabled look, which no other text button
   has ever needed: it is disabled on the first step of every level, and a
   control that looks live and does nothing is worse than no control. */
.button-back::after { content: none; }
.button-back::before { content: "← "; color: var(--muted); }
.button-text:disabled { color: var(--muted); cursor: default; }
.button-text:disabled:hover { text-decoration: none; }

/* Row · a list, never a card grid. The index, the body, the tail; a hairline
   above each row and one below the last closes the set. */
.row { display: grid; grid-template-columns: 2.6rem 1fr auto; gap: var(--gap);
       align-items: baseline; padding-block: 1.6rem;
       border-top: var(--line) solid var(--hair); }
/* Rows in one list must all be the same element, so :last-of-type closes it. */
.row:last-of-type { border-bottom: var(--line) solid var(--hair); }
.row .tail { text-align: right; white-space: nowrap; }

@media (max-width: 44rem) {
  .row { grid-template-columns: 1fr; gap: .7rem; }
  .row .tail { text-align: left; }
}

/* Meter · a hairline that is partly accent. No track, no bar, no container —
   the rule the page already uses, filled to a fraction on the inner element. */
.meter { display: grid; grid-template-columns: 1fr auto; gap: .8rem;
         align-items: center; min-width: 8rem; }
.meter i { display: block; height: var(--line); background: var(--hair); position: relative; }
.meter i::before { content: ""; position: absolute; inset: 0 auto 0 0;
                   width: clamp(0%, var(--p, 0%), 100%); background: var(--accent); }

/* State · every one carries a glyph, which is what makes it survive greyscale.
   The colour is the second signal, never the first. */
.state { font-family: var(--mono); font-size: var(--t-label); letter-spacing: .14em;
         text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.state-ok         { color: var(--accent); }
.state-ok::before { content: "✓ "; }
.state-no         { color: var(--ink); font-weight: 600; }
.state-no::before { content: "✕ "; }


/* ── THIS ENVIRONMENT'S OWN — four components §5 does not have ────────────────
   An environment is specific to what it does, so it may invent. All four are
   built from the 1px hairline and the label voice and nothing else; none adds a
   colour value, so a change of palette leaves them untouched. */


/* ── THE TREE · the map's rows ────────────────────────────────────────────────
   Born in the quiz environment's catalog and reused for the map and for the
   settings choices. Deliberately not built on .row: a .row closes its list with
   :last-of-type, and that needs every row to be the same element — these are a
   button, an anchor and a div by turns, depending on whether a thing can be
   pressed, followed, or neither. So the tree draws the closing hairline itself.

   Depth is a custom property rather than a class per level; the map does not
   nest today, and the rule costs nothing until something does. */

.tree { border-bottom: var(--line) solid var(--hair); }

.tree-row { appearance: none; -webkit-appearance: none;
            display: grid; grid-template-columns: 2.6rem 1fr auto; gap: var(--gap);
            align-items: baseline; width: 100%; text-align: left;
            padding: 1.1rem 0 1.1rem calc(var(--depth, 0) * var(--gap));
            background: 0; border: 0; border-top: var(--line) solid var(--hair);
            font: inherit; color: inherit; cursor: pointer;
            transition: border-top-color var(--tempo) ease; }

.tree-row .tail { text-align: right; white-space: nowrap; }
.tree-name     { font-weight: 600; }
.tree-question { font-size: var(--t-small); }

/* §4, "this is interactive": the hairline firms up and the text underlines.
   Two signals, neither of them a colour. */
.tree-row:hover { border-top-color: var(--ink); }
.tree-row:hover .tree-name,
.tree-row:hover .tree-question { text-decoration: underline;
                                 text-underline-offset: .2em; }

/* A locked level. Listed, because seeing the whole plan is the reason to show
   a map at all; inert, because there is nothing to open yet. */
.tree-row-off { color: var(--muted); cursor: default; }
.tree-row-off:hover { border-top-color: var(--hair); }
.tree-row-off:hover .tree-question { text-decoration: none; }

/* A row that only reports. Statistics list the same levels and areas the map
   and the tree do, but a count is something to read, not a door — so these keep
   the ink of an ordinary row and drop every sign of being pressable. They are
   plain divs, so they are out of the tab order as well as out of the pointer's
   way. */
.tree-row-still { cursor: default; }
.tree-row-still:hover { border-top-color: var(--hair); }
.tree-row-still:hover .tree-name,
.tree-row-still:hover .tree-question { text-decoration: none; }

@media (max-width: 44rem) {
  .tree-row { grid-template-columns: 1.7rem 1fr; }
  .tree-row .tail { grid-column: 2; text-align: left; }
}


/* ── THE PROSE · a rendered step ──────────────────────────────────────────────
   The one thing §5 has no component for: a long document of markdown somebody
   else wrote. Measure comes from --col, so a line stays readable however wide
   the window is; everything else is vertical rhythm and the same hairline the
   rest of the page uses. */

.prose { max-width: var(--col); }
.prose > * + * { margin-top: var(--gap); }

.prose h2 { font-size: var(--t-h2); margin-top: var(--run); }
.prose h3 { font-size: var(--t-h3); margin-top: 2rem; }
.prose h4 { font-size: var(--t-body); font-weight: 600; margin-top: 1.6rem; }

/* A heading belongs to what follows it, not to what came before. */
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .8rem; }

.prose ul, .prose ol { margin: 0; padding-left: 1.4rem; }
.prose li + li { margin-top: .5rem; }
.prose li > ul, .prose li > ol { margin-top: .5rem; }

/* An accented mark, because a pull quote in a card is the author insisting. */
.prose blockquote { margin: 0; padding-left: var(--gap);
                    border-left: var(--line) solid var(--accent); }

.prose pre { font-family: var(--mono); font-size: .8rem; line-height: 1.7;
             margin: 0; padding: 0 0 0 var(--gap);
             border-left: var(--line) solid var(--hair);
             overflow-x: auto; }

.prose img { display: block; max-width: 100%; height: auto; }
.prose hr.rule { margin-block: var(--run); }

/* Wide content scrolls inside its own box; the page never scrolls sideways. */
.scroller { overflow-x: auto; }

.prose table { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.prose th, .prose td { text-align: left; vertical-align: top;
                       padding: .7rem var(--gap) .7rem 0;
                       border-bottom: var(--line) solid var(--hair); }
.prose thead th { font-family: var(--mono); font-size: var(--t-label);
                  font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
                  color: var(--muted); border-bottom-color: var(--ink); }


/* ── THE OPTIONS · a few answers, one of them right ───────────────────────────
   Copied from the sibling quiz environment, where it was born: a hairline above
   each row, one below the last to close the set, and a mono column on the left.
   No box, no radio, no filled shape — a chosen answer is not a selected form
   field, it is a claim. Here it draws the quick checks inside a level.

   ── THE MARK COLUMN CARRIES THE VERDICT ─────────────────────────────────────
   It reads A, B, C while the question is open and ✓ or ✕ once it is answered,
   written by the view rather than by CSS so that a screen reader hears it in the
   same place a reader sees it. Weight is the second signal and colour the third,
   which is what keeps the result legible in greyscale and to anyone who cannot
   separate the two hues. */

.options { border-bottom: var(--line) solid var(--hair); }

.option { appearance: none; -webkit-appearance: none;
          display: grid; grid-template-columns: 2.6rem 1fr; gap: var(--gap);
          align-items: baseline; width: 100%; text-align: left;
          padding: 1.15rem 0; background: 0; border: 0;
          border-top: var(--line) solid var(--hair);
          font: inherit; color: inherit;
          transition: border-top-color var(--tempo) ease; }

.option-mark { font-family: var(--mono); font-size: var(--t-label);
               letter-spacing: .1em; color: var(--muted);
               font-variant-numeric: tabular-nums; }

/* Everything about being interactive is scoped to the button, because the same
   three rows are drawn as divs on the read-only card screen — where there is
   nothing to press. A pointer cursor and a hover underline on something inert is
   a promise the page cannot keep. */
button.option { cursor: pointer; }
button.option:disabled { cursor: default; }

/* §4, "this is interactive" — the hairline firms up and the text underlines.
   Two signals, neither of them a colour. */
button.option:hover:not(:disabled) { border-top-color: var(--ink); }
button.option:hover:not(:disabled) .option-text { text-decoration: underline;
                                                  text-underline-offset: .2em; }

.option-right .option-mark,
.option-right .option-text { color: var(--accent); font-weight: 600; }

/* The one you chose, when it was not the right one. Kept at full ink rather than
   greyed: it is the most important thing on the screen for the next few seconds. */
.option-wrong .option-mark { color: var(--ink); font-weight: 600; }

/* The answers nobody chose and nobody needed. */
.option-quiet .option-mark,
.option-quiet .option-text { color: var(--muted); }

@media (max-width: 44rem) {
  .option { grid-template-columns: 1.7rem 1fr; gap: 1rem; }
}


/* ── THE PLAY SCREEN · the walkthrough and the playground ─────────────────────
   The one screen that wants the whole window: a reading column on the left and
   a real editor on the right do not fit inside a 60rem page. app.js widens the
   page for this screen alone, and the grid below splits it — the guide keeps a
   readable measure, the playground takes the rest and stays put while the
   story scrolls beside it.

   All of it is built from the 1px hairline and the label voice; the iframe's
   border is the same hairline, so the embedded editor sits in the page the way
   a table does rather than floating on it. */

.play { display: grid; grid-template-columns: minmax(24rem, var(--col)) 1fr;
        gap: calc(var(--gap) * 2); align-items: start; }

.play-guide { min-width: 0; }

/* Never sticky, at any width. The editor stands still because its column does
   — see the note above the wide media query below, which is also the reason
   `position: sticky` is not allowed to come back here. */
.play-editor { position: static; min-width: 0; }

.play-editor iframe { display: block; width: 100%;
                      height: calc(100vh - 8rem); min-height: 24rem;
                      margin-top: .8rem; border: var(--line) solid var(--hair);
                      background: var(--paper); }

.play-step { margin-top: var(--run); }
.play-step > * + * { margin-top: var(--gap); }

/* A task is an aside the player acts on, and it wears the notes' Example bar:
   the same green, and the same weight — thicker than a hairline, because in the
   notes it is the one rule drawn heavy. Green here means what it means there:
   a worked thing to follow. */
.task { border-left: 3px solid var(--example); padding-left: var(--gap); }
.task > * + * { margin-top: 1rem; }
.task pre { font-family: var(--mono); font-size: .8rem; line-height: 1.7;
            margin: 0; overflow-x: auto; }

.play-hint { margin-top: var(--gap); }

.play-quiz { margin-top: var(--gap); }

.play-foot { margin-top: var(--run); padding-top: var(--gap);
             border-top: var(--line) solid var(--hair); }

.play-notice { color: var(--ink); }

/* A held Continue is still a fact on the page: greyed, not hidden, because the
   button saying "not yet" is what tells the player the tasks gate it. */
.button:disabled { background: var(--hair); color: var(--muted); cursor: default; }

/* ── WHY THE WIDE PLAY SCREEN DOES NOT SCROLL THE PAGE ────────────────────
   It is a working surface rather than a document, so it fills the window and
   scrolls inside its own columns. That is partly taste and mostly a bug fix.

   The earlier layout let the document scroll and pinned the editor with
   `position: sticky`. Those two together make the editor jitter on every
   keystroke, and the loop is this: typing moves the caret, the browser scrolls
   the document to keep the caret in view, the sticky pane re-pins itself, which
   moves the caret's position on screen, so the browser scrolls again. It is
   invisible while the guide is short enough that the document does not scroll,
   and it appears the moment the guide grows past the window — which is exactly
   what happened when day one's levels got longer.

   Removing either half would stop it. This removes both: the document has no
   scroll to fight over, and the editor stands still because its column does,
   not because it is pinned. */

/* The lock is asked for by what is on screen, not by which address is in the
   bar. Every screen that holds a playground draws the `.play` grid, and those
   are exactly the screens that want the window: a reading column next to a live
   editor has to be one viewport tall, or the two scroll against each other. The
   map draws no such grid. It is a list at a wide measure and an ordinary
   document, and locking it to the window only cut its foot off. */
@media (min-width: 64.0625rem) {
  .page:has(.play) { display: flex; flex-direction: column;
                     height: 100vh; height: 100dvh; }

  /* The guide is the only thing that scrolls, and it keeps its scrolling to
     itself — so reaching its end does not start scrolling something else. */
  .page:has(.play) > #main { flex: 1; min-height: 0; padding-block: var(--gap); }

  .play { height: 100%; align-items: stretch; }

  .play-guide { overflow-y: auto; overscroll-behavior: contain;
                padding-right: var(--gap); }

  .play-editor { position: static; min-height: 0;
                 display: grid; grid-template-rows: auto 1fr; }

  .play-editor iframe { height: 100%; min-height: 0; }
}

@media (max-width: 64rem) {
  .play { grid-template-columns: 1fr; }
  .play-editor { position: static; }
  .play-editor iframe { height: 34rem; }
}


/* ── PRINT — drop the furniture, keep the content ────────────────────────── */

@media print {
  .masthead nav, .skip { display: none !important; }
  .page { width: auto; }
  body { font-size: 10.5pt; line-height: 1.5; }
  .run { padding-block: 1.2rem; }
}
