/* 15.S23 · AI Foundations Ch.3 — workshop guides, contemporary draft.
   White ground, hairline rules, no cards. Hierarchy comes from size and weight
   in a single ink, never from mixing colours: Sloan red is the one accent, the
   Sloan greys do the structure. The deck's dot-matrix numerals are the only
   retro artifact — used the way a gallery numbers its rooms. */

/* ------------------------------------------------------------------ tokens */
:root {
  --red: #a31f34;
  --red-deep: #8c1a2c;
  --ink: #545759;               /* every heading and every line of body copy */
  --silver: #8a8b8c;            /* metadata, captions, the quiet register */
  --cloud: #c9c8c7;             /* rules and inactive states */
  --panel: #f4f4f4;             /* specimen blocks: prompts, file trees */
  --navy: #041d40;              /* held back for one dark beat and one chip */
  --blue: #00698e;
  --green: #006b67;

  --paper: #ffffff;
  --ground: #fcfcfb;
  --hair: rgba(201, 200, 199, .62);
  --hair-strong: rgba(138, 139, 140, .40);

  --q-direct: var(--navy);
  --q-personal: var(--red);
  --q-trace: var(--blue);
  --q-honest: var(--green);

  --ui: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --display: "Arial Black", "Arial Bold", Arial, sans-serif;
  --mono: Consolas, "SF Mono", Menlo, "Courier New", monospace;

  --rail: 286px;
  --gutter: 132px;             /* room for a hanging "3.2" */
  --measure: 660px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ------------------------------------------------------- the no-JS floor */
/* Every hiding rule below is gated on `.js`, which each page's head sets and
   removes again if alt.js fails to load or throws. Without it the guide is one
   long readable document rather than a blank white overlay. */
.js .step { display: none; }
.js .done { display: none; }
.js .intro { display: flex; }
html:not(.js) .intro,
html:not(.js) .nav,
html:not(.js) .rail__index,
html:not(.js) .meter,
html:not(.js) .rail__read,
html:not(.js) .btn-reset { display: none; }
/* ...but the degraded view is the one a student reaches BECAUSE something broke,
   so it keeps "Stuck? Raise your hand", and the done screen keeps its forward
   link, which is a plain anchor and needs no script. */
html:not(.js) .done .nav { display: flex; }
html:not(.js) .done .nav [data-restart] { display: none; }
html:not(.js) .step + .step,
html:not(.js) .done { margin-top: 64px; padding-top: 40px; border-top: 2px solid var(--hair-strong); }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--red); }

.label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--silver);
}

/* ---------------------------------------------------------- dot numerals */
/* sloan.ghost_numeral, ported: a 5x7 matrix of separate squares, each set in
   82% of its cell so the gaps are what read as pixels. */
.dots {
  display: inline-grid;
  grid-template-columns: repeat(var(--cols, 5), var(--dot, 8px));
  grid-auto-rows: var(--dot, 8px);
  gap: calc(var(--dot, 8px) * .22);
  color: var(--red);
  line-height: 0;
}
.dots i { display: block; }
.dots i.on { background: currentColor; opacity: 1; }
.dots--anim i.on { opacity: 0; transition: opacity .34s ease; }
.dots--anim.is-in i.on { opacity: 1; }

/* ------------------------------------------------------------------- intro */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(28px, 9vw, 150px);
  cursor: pointer;
  transition: opacity .7s ease, visibility .7s;
}
/* visibility only flips at the END of the transition, so without this the
   dismissed overlay eats clicks for 700ms — long enough to lose a real one */
.intro.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }

/* the one flourish: a hairline sweeps the page like a seconds hand */
.intro__sweep {
  position: absolute;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--red);
  transition: width 1.1s cubic-bezier(.22, .61, .36, 1);
}
.intro__sweep.is-in { width: 100%; }

.intro__inner { max-width: 820px; }
.intro__eyebrow {
  margin: 0 0 clamp(26px, 5vh, 52px);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .6s ease .1s, transform .6s ease .1s;
}
.intro__num {
  --dot: clamp(8px, 1.05vw, 12px);
  margin-bottom: clamp(24px, 3.6vh, 38px);
}
.intro__mark { display: block; width: min(100%, 760px); height: auto; }
.intro__title {
  font-family: var(--display);
  font-size: clamp(30px, 5.4vw, 62px);
  line-height: 1.06;
  letter-spacing: -.012em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}
.intro__title span {
  display: block;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s cubic-bezier(.2, .7, .3, 1),
              transform .7s cubic-bezier(.2, .7, .3, 1);
}
.intro__rule {
  height: 1px;
  width: 0;
  background: var(--cloud);
  margin: clamp(26px, 4vh, 42px) 0 clamp(18px, 2.6vh, 26px);
  transition: width .9s cubic-bezier(.22, .61, .36, 1);
}
.intro__rule.is-in { width: min(100%, 520px); }
.intro__meta, .intro__go {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .6s ease, transform .6s ease;
}
.intro__meta { margin: 0; }
.intro__go { margin-top: clamp(30px, 5vh, 56px); }
.is-in { opacity: 1 !important; transform: none !important; }

.intro__skip {
  position: absolute;
  right: clamp(20px, 4vw, 44px);
  bottom: 26px;
  background: none;
  border: 0;
  padding: 6px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--silver);
}
.intro__skip:hover { color: var(--red); }

/* -------------------------------------------------------------------- rail */
.rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail);
  padding: 40px 30px 26px 40px;
  background: var(--paper);
  border-right: 1px solid var(--hair-strong);
  display: flex;
  flex-direction: column;
  overflow-y: auto;              /* 150% zoom leaves ~720px: the foot was clipped */
  z-index: 40;
}
.rail__tag { height: 17px; width: auto; opacity: .8; }
.rail__track {
  margin: 0;
  font-family: var(--display);
  font-size: 14px;
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--ink);
}
/* The section label and page title belong to the collapsed bar (see the 1080
   query); on the full rail the guide tree below already says where you are. */
.rail__sec { margin: 0 0 9px; display: none; }
.rail__track { display: none; }
/* collapsed-bar orientation; see the 1080 query. margin:0 matters — every other
   rail child sets one, and UA paragraph margins here inflate the sticky bar. */
.rail__now { display: none; margin: 0; }

/* the chapter, one quiet line above the guides, and the way back to the hub */
.rail__chapter { display: block; margin-top: 26px; text-decoration: none; }
.rail__chapter .label { display: block; margin: 0 0 7px; }
.rail__chapter-t {
  display: block;
  font-family: var(--display);
  font-size: 14px;
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--ink);
  transition: color .18s ease;
}
.rail__chapter:hover .rail__chapter-t { color: var(--red); }

/* every guide, always; the one you are in opens into its steps */
.rail__nav {
  margin-top: 30px;
  flex: 1 1 auto;
  /* deliberately NOT min-height:0 — that lets the tree squash and overlap the
     foot. The rail's own overflow-y handles a short viewport by scrolling. */
}
.rail__guides { list-style: none; margin: 0; padding: 0; }
.rail__guide { border-top: 1px solid var(--hair); }
.rail__guide:last-child { border-bottom: 1px solid var(--hair); }
.rail__g {
  display: flex;
  gap: 13px;
  align-items: baseline;
  padding: 11px 0;
  text-decoration: none;
  color: var(--silver);
  font-family: var(--ui);
  font-size: 13.5px;
  line-height: 1.35;
  transition: color .18s ease;
}
.rail__g:hover { color: var(--red); }
/* red is kept for the step you are on; the guide you are in is simply ink */
.rail__guide.is-current > .rail__g { color: var(--ink); font-weight: 700; }
.rail__guide.is-current > .rail__g .rail__n { color: var(--ink); }
.rail__guide.is-current > .rail__g:hover { color: var(--ink); }
/* a finished guide: a small drawn tick, not a glyph Arial doesn't have */
.rail__tick {
  flex: none;
  align-self: center;
  width: 5px;
  height: 9px;
  margin: -3px 2px 0 auto;
  border: solid var(--silver);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.rail__index {
  list-style: none;
  /* indent to the guide's label, past its number and gap */
  margin: -3px 0 0;
  padding: 0 0 12px 27px;
}
.rail__item {
  display: flex;
  gap: 10px;
  align-items: baseline;
  width: 100%;
  padding: 5px 0;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  color: var(--silver);
  font-family: var(--ui);
  font-size: 12.5px;
  line-height: 1.35;
  transition: color .18s ease;
}
.rail__item:hover { color: var(--red); }
.rail__n {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--silver);
  flex: none;
  transition: color .18s ease;
}
.rail__item .rail__n { font-size: 10px; }
.rail__item.is-done { color: var(--ink); }
.rail__item.is-done .rail__n { color: var(--silver); }
.rail__item.is-now { color: var(--red); font-weight: 700; }
.rail__item.is-now .rail__n { color: var(--red); }
/* steps past the first unticked box: still readable, so a student can see what
   is coming, but not reachable */
.rail__item:disabled { cursor: not-allowed; }
.rail__item:disabled:hover { color: var(--silver); }

/* the one classroom instruction that matters, travelling with every step */
.rail__stuck {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--silver);
}

/* power-reserve progress: a hairline track, a red fill, a precise readout */
.rail__foot { margin-top: 26px; }
.meter { height: 2px; background: var(--hair); position: relative; }
.meter__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--red);
  transition: width .45s cubic-bezier(.22, .61, .36, 1);
}
.rail__read {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--silver);
}
/* lives in the colophon, not the rail — visible at every width, beside the line
   that explains what it clears */
.btn-reset {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--silver);
}
.btn-reset:hover { color: var(--red); }

/* ------------------------------------------------------------------- shell */
.sheet {
  margin-left: var(--rail);
  padding: clamp(56px, 9vh, 104px) clamp(28px, 6vw, 88px) 140px;
  min-height: 100vh;
}
.col { max-width: calc(var(--gutter) + var(--measure)); }

/* ------------------------------------------------------------------- steps */
.js .step.is-active { display: block; animation: rise .45s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.step__head {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  align-items: start;
}
.step__num { --dot: 7px; margin-top: 3px; }
.step__eyebrow { margin: 0 0 12px; }
.step__title {
  font-family: var(--display);
  font-size: clamp(25px, 3.3vw, 37px);
  line-height: 1.1;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}
.step__lede { margin: 26px 0 0; font-size: 18px; line-height: 1.6; }
.step__body { margin-left: var(--gutter); max-width: var(--measure); }

h2.sec {
  margin: 58px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--hair-strong);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--silver);
}
h2.sec + * { margin-top: 20px; }

/* ------------------------------------------------------------ numbered dos */
.dos { list-style: none; margin: 0; padding: 0; counter-reset: do; }
.dos > li {
  counter-increment: do;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 0 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--hair);
}
.dos > li:first-child { border-top: 1px solid var(--hair); }
.dos > li::before {
  /* plain digits: a zero-padded "03" is reserved for section numbers, and a
     to-do item reading "03" inside section 03 is exactly the collision to avoid */
  content: counter(do);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--red);
  padding-top: 4px;
}
/* ::before auto-places into the numeral column; everything else is a grid item
   too and would otherwise fall into that 38px column on the next row */
.dos > li > * { grid-column: 2; }
.dos b { color: var(--ink); font-weight: 700; }
.dos small { display: block; color: var(--silver); font-size: 14px; margin-top: 2px; max-width: 58ch; }
/* the grid puts the chip on its own row, where a left indent reads as a mistake */
.dos .qual { margin: 5px 0 0; }

/* h2.sec already draws a rule; the first row of whatever follows drew a second
   one ~50px below it, a dozen times on a long step */
h2.sec + .checks li:first-child,
h2.sec + .dos > li:first-child,
h2.sec + .modes .mode:first-child,
h2.sec + details.help:first-of-type,
/* ...and the same where a clarifying line sits between the heading and the block */
h2.sec + p + .checks li:first-child,
h2.sec + p + .dos > li:first-child,
h2.sec + p + .modes .mode:first-child,
h2.sec + p + details.help:first-of-type { border-top: 0; }

/* ---------------------------------------------------------------- checks */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { border-bottom: 1px solid var(--hair); }
.checks li:first-child { border-top: 1px solid var(--hair); }
.check {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  cursor: pointer;
  user-select: none;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 4px;
  border: 1.5px solid var(--silver);
  background: var(--paper);
  display: grid;
  place-items: center;
  transition: background .18s ease, border-color .18s ease;
}
.check__box::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid var(--paper);
  border-bottom: 2px solid var(--paper);
  transform: rotate(-45deg) scale(.5);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}
.check:hover .check__box { border-color: var(--ink); }
.check input:focus-visible + .check__box { outline: 2px solid var(--red); outline-offset: 3px; }
.check input:checked + .check__box { background: var(--red); border-color: var(--red); }
.check input:checked + .check__box::after { opacity: 1; transform: rotate(-45deg) scale(1); }
/* a press on a locked Next outlines whatever is still unticked */
.check.is-missing .check__box { border-color: var(--red); animation: missing .8s ease 2; }
@keyframes missing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(163, 31, 52, 0); }
  40% { box-shadow: 0 0 0 5px rgba(163, 31, 52, .22); }
}
.check__t { font-size: 16px; color: var(--ink); }
.check input:checked ~ .check__t { color: var(--silver); }
/* these captions are operating instructions ("not all of Documents"), not
   asides — they carry ink, and must fade WITH their row when it is ticked */
.check__t small {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-top: 3px;
  font-weight: 400;
  max-width: 58ch;
}
.check input:checked ~ .check__t small { color: var(--silver); }

/* ------------------------------------------------------------ prompt cards */
.prompt { margin: 22px 0; border: 1px solid var(--cloud); background: var(--paper); }
.prompt__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--hair);
}
.prompt__name {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--silver);
}
.prompt__bar .btn-copy { margin-left: auto; }
.prompt__body {
  margin: 0;
  padding: 24px 26px 26px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.btn-copy {
  border: 1px solid var(--cloud);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 6px 13px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.btn-copy:hover { border-color: var(--red); color: var(--red); }
.btn-copy.is-ok { background: var(--red); border-color: var(--red); color: var(--paper); }

/* ------------------------------------------------------------------- tree */
.tree {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 2;
  margin: 22px 0;
  padding: 22px 26px;
  background: var(--panel);
}
.tree .d { color: var(--ink); font-weight: 700; }
.tree .f { color: var(--ink); }
.tree .i { color: var(--cloud); }
/* .note is also a block-level callout, so reset what that ruleset brings with
   it — otherwise every annotation renders with a tick and a 22px indent */
.tree .note {
  border: 0;
  padding: 0;
  margin: 0 0 0 14px;
  max-width: none;
  font-weight: 400;
  color: var(--silver);
  font-family: var(--ui);
  font-size: 13px;
}

/* -------------------------------------------------------- notes and rails */
.note {
  margin: 24px 0;
  padding: 2px 0 2px 22px;
  border-left: 2px solid var(--cloud);
  font-size: 15.5px;
  max-width: 66ch;
}
.note--warn { border-left-color: var(--red); }
.note b { color: var(--ink); }

.dashed {
  margin: 24px 0;
  padding: 24px;
  border: 1px dashed var(--cloud);
  text-align: center;
  font-size: 15px;
  color: var(--silver);
}
.dashed b { color: var(--ink); display: block; margin-bottom: 6px; }

.rule { border: 0; border-top: 1px solid var(--hair-strong); margin: 46px 0; }

/* term / definition rails */
.modes { margin: 0; }
.mode {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--hair);
}
.mode:first-child { border-top: 1px solid var(--hair); }
.mode__n {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
}
.mode__d { font-size: 15.5px; }
.mode__f {
  grid-column: 3;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
  white-space: nowrap;
}

/* the four advisor qualities keep their fixed deck-wide colours */
.quals { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 20px 0 0; padding: 0; }
.qual {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.qual::before { content: ""; width: 8px; height: 8px; flex: none; }
.q1 { color: var(--q-direct); } .q1::before { background: var(--q-direct); }
.q2 { color: var(--q-personal); } .q2::before { background: var(--q-personal); }
.q3 { color: var(--q-trace); } .q3::before { background: var(--q-trace); }
.q4 { color: var(--q-honest); } .q4::before { background: var(--q-honest); }

/* the single dark beat in the whole site */
.beat { margin: 34px 0; padding: 34px 36px; background: var(--navy); color: var(--cloud); }
.beat .label { color: rgba(201, 200, 199, .8); }
.beat__q {
  font-family: var(--mono);
  font-size: 19px;
  line-height: 1.5;
  color: var(--paper);
  margin: 16px 0 18px;
}
.beat b { color: var(--paper); }
.beat p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------------- help */
details.help { border-bottom: 1px solid var(--hair); }
details.help:first-of-type { border-top: 1px solid var(--hair); }
details.help > summary {
  cursor: pointer;
  padding: 15px 30px 15px 0;
  position: relative;
  font-size: 15.5px;
  color: var(--ink);
  list-style: none;
}
details.help > summary::-webkit-details-marker { display: none; }
details.help > summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 11px;
  height: 1px;
  background: var(--silver);
}
details.help > summary::before {
  content: "";
  position: absolute;
  right: 9px;
  top: 50%;
  width: 1px;
  height: 11px;
  margin-top: -5px;
  background: var(--silver);
  transition: opacity .2s ease;
}
details.help[open] > summary::before { opacity: 0; }
details.help > summary:hover,
details.help[open] > summary { color: var(--red); }
details.help[open] > summary::after { background: var(--red); }
details.help .help__b { padding: 0 40px 22px 0; font-size: 15px; max-width: 66ch; }
details.help .help__b p { margin: 0 0 11px; }
details.help .help__b p:last-child { margin-bottom: 0; }
details.help .help__b code,
code.m { font-family: var(--mono); font-size: 13.5px; color: var(--ink); }

/* -------------------------------------------------------------------- nav */
.nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--hair-strong);
}
.btn {
  display: inline-block;
  font-family: var(--display);
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 15px 30px;
  border: 1px solid var(--red);
  background: var(--red);
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { background: var(--red-deep); border-color: var(--red-deep); color: var(--paper); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--cloud); }
.btn--ghost:hover { background: transparent; border-color: var(--ink); color: var(--ink); }
/* the terminal action of a track — differentiated by weight, not a second red,
   so it keeps a hover state of its own */
.btn--red { padding: 17px 38px; letter-spacing: .22em; }

/* the only focus style in the file used to be the checkbox; everything else
   fell back to the UA ring, which on a red button is the worst pixel on the site */
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.btn:focus-visible { outline-color: var(--ink); }
.check input:focus-visible { outline: none; }
details.help > summary:focus-visible { outline-offset: -2px; }
.step__title[tabindex]:focus,
.done__t[tabindex]:focus { outline: none; }
.nav__spacer { display: none; }
.nav__hint { font-size: 13.5px; color: var(--ink); }
/* A Next that cannot go anywhere yet looks it — but stays pressable, so the
   press can point at what is missing instead of doing nothing. Disabled
   controls are exempt from contrast minimums; the hint beside it is not. */
.btn.is-locked,
.btn.is-locked:hover {
  background: var(--panel);
  border-color: var(--cloud);
  color: var(--silver);
  cursor: not-allowed;
}

/* ------------------------------------------------------------------- done */
.js .done.is-active { display: block; animation: rise .5s cubic-bezier(.2, .7, .3, 1) both; }
.done__num { --dot: 12px; margin-bottom: 28px; }
.done__t {
  font-family: var(--display);
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.08;
  letter-spacing: -.012em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 26px;
  max-width: 17ch;
}
.done__p { max-width: 58ch; font-size: 17px; margin: 0 0 16px; }

.motto {
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 44px 0 0;
}

/* -------------------------------------------------------------------- hub */
.hero { max-width: 860px; margin-bottom: 76px; }
/* The chapter's title wordmark — the deck's VIBE CODING lettering on a
   transparent ground, so it sits directly on the white page. It replaces a
   dot-matrix "3" that read as a step number beside the guides' numerals. */
.hero__t picture, .intro__title picture { display: block; }
.hero__kicker { margin: 0 0 18px; }
.hero__mark { display: block; width: min(100%, 680px); height: auto; }
.hero__t {
  font-family: var(--display);
  font-size: clamp(32px, 5.2vw, 60px);
  line-height: 1.05;
  letter-spacing: -.015em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 26px;
}
.hero__p { font-size: 18.5px; max-width: 54ch; margin: 0; }

/* an exhibition index, not a grid of cards */
.index { margin: 0 0 72px; }
.entry {
  display: grid;
  grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1.5fr) auto;
  gap: 28px;
  align-items: baseline;
  padding: 30px 0;
  border-top: 1px solid var(--hair-strong);
  text-decoration: none;
  color: var(--ink);
  transition: background .2s ease;
}
.index .entry:last-of-type { border-bottom: 1px solid var(--hair-strong); }
a.entry:hover { background: var(--paper); }
a.entry:hover .entry__t { color: var(--red); }
.entry__n { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; color: var(--red); }
.entry__t {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--ink);
  transition: color .2s ease;
}
.entry__d { font-size: 15px; }
.entry__s {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--silver);
  white-space: nowrap;
}
.entry__s.is-done { color: var(--red); }
.entry--soon { opacity: .6; }
.entry--soon .entry__n { color: var(--silver); }

.colophon {
  margin-left: var(--rail);
  padding: 30px clamp(28px, 6vw, 88px) 60px;
  border-top: 1px solid var(--hair);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 12.5px;
  color: var(--silver);
}
.colophon__spacer { flex: 1; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  :root { --rail: 0px; --gutter: 132px; }
  .rail {
    position: sticky;
    top: 0;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    padding: 14px clamp(20px, 5vw, 40px);
    border-right: 0;
    border-bottom: 1px solid var(--hair);
    bottom: auto;
    overflow: hidden;
  }
  .rail__track { display: block; margin: 0; font-size: 12px; white-space: nowrap; }
  .rail__sec { display: block; margin: 0; white-space: nowrap; }
  .rail__chapter, .rail__nav, .rail__stuck { display: none; }
  .rail__foot { margin: 0 0 0 auto; min-width: 150px; }
  /* the forced break is in the track title, not the foot — a two-line title
     would otherwise make the sticky bar twice as tall as it needs to be */
  .rail__track br { display: none; }
  /* the index is gone, so name the current step instead — 1280px at 125% zoom
     lands here, and that student needs orientation more, not less */
  .rail__now {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: var(--ink);
  }
  .sheet, .colophon { margin-left: 0; }
}

@media (max-width: 640px) {
  :root { --gutter: 0px; }
  .step__head { grid-template-columns: 1fr; }
  .step__num { margin-bottom: 20px; }
  .step__body { margin-left: 0; }
  .mode { grid-template-columns: 1fr; gap: 4px; }
  .mode__f { grid-column: 1; justify-self: start; }
  .entry { grid-template-columns: 34px 1fr; gap: 10px 16px; }
  .entry__d, .entry__s { grid-column: 2; }
  .beat { padding: 26px 24px; }

  /* The sticky bar on a phone: the logo, the step you are on, and how far
     along — nothing that can push it wider than the screen. Progress becomes
     a red hairline growing along the bar's bottom edge. */
  .rail { gap: 14px; padding: 12px 20px 13px; }
  .rail__sec { display: none; }
  .rail:has(.rail__now) .rail__track { display: none; }
  .rail__now { flex: 1 1 auto; }
  .rail__foot { min-width: 0; margin: 0; flex: none; }
  .rail__foot > .label { display: none; }
  .meter { position: absolute; left: 0; right: 0; bottom: 0; background: transparent; }
  .rail__read { margin: 0; }
  [data-read-pct] { display: none; }

  /* buttons keep their words on one line, and the gate's hint gets a line of
     its own instead of a sliver beside them */
  .nav { flex-wrap: wrap; gap: 10px; }
  .nav .btn {
    flex: 1 1 auto;
    text-align: center;
    white-space: nowrap;
    padding: 14px 18px;
    letter-spacing: .14em;
  }
  .nav .btn[data-back] { flex: 0 0 auto; }
  .nav__hint { flex-basis: 100%; }

  /* thumbs, not cursors */
  .btn-copy { padding: 10px 16px; }

  /* the file tree keeps each row on one line; annotations scroll sideways
     inside the panel rather than wrapping under the wrong folder */
  .tree { padding: 16px 18px; font-size: 12.5px; overflow-x: auto; }
  .tree div { white-space: nowrap; }

  .done__num { --dot: 9px; }
}

/* A tap leaves :hover stuck on touch screens until the next tap elsewhere, so
   Next would sit in its pressed colour. Undo the hover looks where there is
   no hover — never the states that share those selectors (open, copied). */
@media (hover: none) {
  .btn:hover { background: var(--red); border-color: var(--red); }
  .btn--ghost:hover { background: transparent; border-color: var(--cloud); }
  .btn-copy:not(.is-ok):hover { border-color: var(--cloud); color: var(--ink); }
  a.entry:hover { background: transparent; }
  a.entry:hover .entry__t { color: var(--ink); }
  .rail__g:hover, .rail__item:hover { color: var(--silver); }
  .rail__item.is-done:hover, .rail__guide.is-current > .rail__g:hover { color: var(--ink); }
  .rail__item.is-now:hover { color: var(--red); }
  .rail__chapter:hover .rail__chapter-t { color: var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ?still=1 — set by alt.js on <html>, so the flag stops the CSS transitions as
   well as the scheduled sequence. Same effect, asked for rather than detected. */
html.still *, html.still *::before, html.still *::after {
  animation-duration: .001ms !important;
  transition-duration: .001ms !important;
}
html.still { scroll-behavior: auto; }
