/* randymichak.com — The Process Map
   One person drawn as a swimlane process: Build, Teach, Secure. */

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  --paper: #ffffff;
  --ink: #111111;
  --ink-2: #363636;
  --dot: rgba(17, 17, 17, 0.13);

  --build: #2340ff;
  --build-tint: #eef0ff;
  --build-on: #ffffff;
  --build-ink-2: #262c5c;

  --teach: #ffb000;
  --teach-tint: #fff4d6;
  --teach-on: #111111;
  --teach-ink-2: #4a3608;

  --secure: #00a36c;
  --secure-tint: #e2f5ec;
  --secure-on: #111111;
  --secure-ink-2: #173f2f;

  --stroke: 2px;
  --radius: 10px;

  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 40px;
  --s5: 64px;
  --s6: 104px;

  --gutter: clamp(16px, 3vw, 40px);
  --max: 1360px;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1.02; text-wrap: balance; }
:focus-visible { outline: 3px solid var(--build); outline-offset: 3px; border-radius: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--gutter); top: -60px; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px;
  text-decoration: none; font-weight: 650;
}
.skip:focus { top: 12px; }

/* Notation: the small condensed caps a diagram uses for labels on flows. */
.note {
  font-size: 0.75rem;
  font-weight: 650;
  font-variation-settings: "wdth" 75;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ── Nav ────────────────────────────────────────────────────────── */
.site-nav { border-bottom: var(--stroke) solid var(--ink); background: var(--paper); }
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 64px; }
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 850; font-size: 1.125rem; letter-spacing: -0.01em;
  font-variation-settings: "wdth" 112; text-decoration: none;
}
.wordmark svg { flex: none; }
.nav-links { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; font-weight: 600; font-size: 0.9375rem;
  padding: 6px 0; border-bottom: 2px solid transparent;
  transition: border-color 0.2s var(--ease-out);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { border-bottom-color: var(--ink); }
.swatch { width: 10px; height: 10px; border: 2px solid var(--ink); flex: none; }
.swatch--build { background: var(--build); }
.swatch--teach { background: var(--teach); }
.swatch--secure { background: var(--secure); }
@media (max-width: 760px) {
  .nav-links .nav-lane { display: none; }
}

/* ── The map (first viewport) ───────────────────────────────────── */
.map { padding: var(--s3) 0 var(--s5); }
.pool {
  position: relative;
  display: grid;
  border: var(--stroke) solid var(--ink);
  background: var(--paper);
  /* desktop columns: pool label · lane heads · router · 3 task columns · end */
  grid-template-columns: 46px minmax(0, 35fr) 170px repeat(3, minmax(0, 17fr)) 142px;
  grid-template-rows: repeat(3, minmax(176px, 1fr));
  height: clamp(600px, calc(100svh - 64px - 64px), 800px);
}
.pool-label {
  grid-column: 1; grid-row: 1 / 4;
  display: flex; align-items: center; justify-content: center;
  border-right: var(--stroke) solid var(--ink);
}
.pool-label span {
  writing-mode: vertical-rl; transform: rotate(180deg);
  white-space: nowrap;
}

/* The headline is the three lane headers. */
.lane-heads {
  grid-column: 2; grid-row: 1 / 4;
  display: grid; grid-template-rows: repeat(3, 1fr);
  container-type: inline-size;
  border-right: var(--stroke) solid var(--ink);
  font-size: 1rem; /* reset; spans size themselves */
}
.lane-head {
  display: flex; align-items: center;
  padding: 0 clamp(16px, 4cqi, 32px);
  font-size: min(6rem, 16.5cqi);
  font-weight: 850;
  font-variation-settings: "wdth" 92;
  letter-spacing: -0.035em;
  line-height: 0.86;
}
.lane-head + .lane-head { border-top: var(--stroke) solid var(--ink); }
.lane-head--build { background: var(--build); color: var(--build-on); }
.lane-head--teach { background: var(--teach); color: var(--teach-on); }
.lane-head--secure { background: var(--secure); color: var(--secure-on); }

.lane-band {
  grid-column: 3 / -1;
  background-color: var(--band);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.3px);
  background-size: 18px 18px;
  background-position: 9px 9px;
}
.lane-band--build { grid-row: 1; --band: var(--build-tint); }
.lane-band--teach { grid-row: 2; --band: var(--teach-tint); border-top: var(--stroke) solid var(--ink); }
.lane-band--secure { grid-row: 3; --band: var(--secure-tint); border-top: var(--stroke) solid var(--ink); }
.lane-band--seam { display: none; }

.flows {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1; overflow: visible;
}
.flows .flow-paths path {
  fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round;
  marker-end: url(#arrow-ink);
  transition: stroke 0.25s var(--ease-out);
}
.pool[data-lane="build"] .flow-paths path[data-lane="build"],
.flow-paths path.is-hot[data-lane="build"] { stroke: var(--build); stroke-width: 3; marker-end: url(#arrow-build); }
.pool[data-lane="teach"] .flow-paths path[data-lane="teach"],
.flow-paths path.is-hot[data-lane="teach"] { stroke: #c98a00; stroke-width: 3; marker-end: url(#arrow-teach); }
.pool[data-lane="secure"] .flow-paths path[data-lane="secure"],
.flow-paths path.is-hot[data-lane="secure"] { stroke: #008a5b; stroke-width: 3; marker-end: url(#arrow-secure); }

.router { grid-column: 3; grid-row: 1 / 4; position: relative; z-index: 2; }
.branches { display: contents; }
.branches-label { display: none; }
.event {
  display: block; border: var(--stroke) solid var(--ink); border-radius: 50%; background: var(--paper);
}
.event--start { position: absolute; left: 10px; top: 50%; width: 34px; height: 34px; margin-top: -17px; }
.gateway { position: absolute; left: 56px; top: 50%; width: 46px; height: 46px; margin-top: -23px; }
.gateway svg { display: block; width: 100%; height: 100%; overflow: visible; }
.router-label { position: absolute; white-space: nowrap; color: var(--ink); }
.router-label--start { left: 4px; top: calc(50% + 24px); }
.router-label--gate { left: 86px; top: calc(50% + 26px); }
.branch {
  position: absolute; right: 2px; transform: translateY(-50%);
  border: var(--stroke) solid var(--ink); border-radius: 999px;
  padding: 4px 10px 5px; cursor: pointer;
  font-family: var(--font);
  transition: box-shadow 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.branch:hover { box-shadow: 0 6px 14px -6px rgba(17,17,17,0.45); transform: translateY(calc(-50% - 1px)); }
.branch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.branch--build { top: 16.667%; background: var(--build); color: var(--build-on); }
.branch--teach { top: 50%; background: var(--teach); color: var(--teach-on); }
.branch--secure { top: 83.333%; background: var(--secure); color: var(--secure-on); }

/* Tasks: rounded boxes, the way the notation draws an activity. */
.task {
  position: relative; z-index: 2;
  justify-self: center; align-self: center;
  width: calc(100% - 26px); max-width: 236px;
  display: flex; flex-direction: column; gap: 5px;
  padding: 12px 14px 13px;
  background: var(--paper); color: var(--ink);
  border: var(--stroke) solid var(--ink); border-radius: var(--radius);
  text-decoration: none;
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out), box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.task:hover, .task:focus-visible { box-shadow: 0 0 0 2px var(--ink), 0 14px 26px -14px rgba(17,17,17,0.5); transform: translateY(-2px); }
.task-title { font-weight: 780; font-size: 1.0625rem; line-height: 1.12; letter-spacing: -0.01em; font-variation-settings: "wdth" 90; }
.task-line { font-size: 0.8125rem; line-height: 1.35; color: var(--ink-2); }
.task-meta { margin-top: 2px; }
.task.is-active[data-lane="build"] { background: var(--build); color: var(--build-on); }
.task.is-active[data-lane="teach"] { background: var(--teach); }
.task.is-active[data-lane="secure"], .task.is-active[data-lane="both"] { background: var(--secure); }
.task.is-active .task-line { color: inherit; }

#n-modus { grid-column: 4; grid-row: 1; }
#n-econ { grid-column: 5; grid-row: 1; }
#n-skills { grid-column: 6; grid-row: 1; }
#n-warden {
  grid-column: 4; grid-row: 2 / 4;
  align-self: stretch;
  margin-block: clamp(40px, 6vh, 62px);
  justify-content: center;
}
#n-warden .task-title { font-size: 1.25rem; }
#n-z2w { grid-column: 5; grid-row: 2; }
#n-lessons { grid-column: 6; grid-row: 2; }
#n-certs { grid-column: 5; grid-row: 3; }
#n-reading { grid-column: 6; grid-row: 3; }
#n-end { grid-column: 7; grid-row: 1 / 4; justify-self: end; margin-right: 12px; }
#n-merge { position: relative; z-index: 2; grid-column: 7; grid-row: 1 / 4; align-self: center; justify-self: start; margin-left: 10px; width: 40px; height: 40px; left: auto; top: auto; margin-top: 0; }

/* Event and data-object nodes: a shape with its label underneath. */
.node {
  position: relative; z-index: 2;
  justify-self: center; align-self: center;
  display: grid; justify-items: center;
  text-decoration: none; color: var(--ink); text-align: center;
  padding: 0;
}
.node-shape { display: block; transition: transform 0.25s var(--ease-out); }
.node:hover .node-shape, .node:focus-visible .node-shape { transform: scale(1.08); }
.node-label {
  position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 170px;
  font-weight: 650; font-size: 0.875rem; line-height: 1.25;
}
.node-label .note { display: block; margin-top: 3px; font-weight: 600; }
.ring-mid {
  width: 46px; height: 46px; border-radius: 50%;
  border: var(--stroke) solid var(--ink);
  background: var(--paper);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 5px var(--ink);
}
.node.is-active .ring-mid { background: var(--secure); }
.doc-shape { width: 40px; height: 50px; }
.doc-shape path { fill: var(--paper); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; transition: fill 0.3s; }
.node.is-active .doc-shape path:first-child { fill: var(--secure); }
.ring-end {
  width: 54px; height: 54px; border-radius: 50%;
  border: 6px solid var(--ink); background: var(--paper);
}
.node--end.is-hit .ring-end { animation: hit 0.9s var(--ease-out); }
@keyframes hit {
  0% { box-shadow: 0 0 0 0 rgba(17,17,17,0.45); background: var(--ink); }
  100% { box-shadow: 0 0 0 22px rgba(17,17,17,0); background: var(--paper); }
}

.token {
  position: absolute; left: 0; top: 0; z-index: 3;
  width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--ink), 0 6px 14px -4px rgba(17,17,17,0.55);
  pointer-events: none; will-change: transform;
  opacity: 0; transition: opacity 0.3s var(--ease-out), background-color 0.3s;
}
.token.is-on { opacity: 1; }
.token[data-lane="build"] { background: var(--build); }
.token[data-lane="teach"] { background: var(--teach); }
.token[data-lane="secure"] { background: var(--secure); }

.map-caption { margin-top: var(--s2); display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; color: var(--ink-2); font-size: 0.9375rem; }
.map-caption .note { color: var(--ink); }

/* ── Map, stacked (tablet + phone) ──────────────────────────────── */
@media (max-width: 1179px) {
  .pool {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto;
  }
  .pool-label { display: none; }
  .lane-heads { grid-column: 1; grid-row: 1; border-right: 0; border-bottom: var(--stroke) solid var(--ink); }
  .lane-head { padding-block: clamp(16px, 4cqi, 28px); font-size: min(6rem, 15cqi); }
  .router { grid-column: 1; grid-row: 2; height: 178px; }
  .router-label--gate { display: block; left: calc(50% + 34px); top: 36px; }
  .branches {
    position: absolute; left: 0; right: 0; top: 116px;
    display: flex; justify-content: center; align-items: center; gap: 26px;
    padding: 0 12px;
  }
  .branches-label { display: none; }
  .branch, .branch--build, .branch--teach, .branch--secure { position: static; transform: none; top: auto; right: auto; left: auto; }
  .branch:hover { transform: translateY(-1px); }
  .event--start { left: calc(50% - 96px); top: 44px; margin-top: -17px; }
  .gateway { left: calc(50% - 23px); top: 44px; margin-top: -23px; }
  .router-label--start { left: calc(50% - 79px); top: 68px; transform: translateX(-50%); }
  #n-merge { display: none; }
  .node-label { position: static; transform: none; width: auto; margin-top: 8px; }
  .lane-band { grid-column: 1; border-top: var(--stroke) solid var(--ink); position: relative; }
  .lane-band--build { grid-row: 3 / 6; }
  .lane-band--teach { grid-row: 6 / 8; }
  .lane-band--seam {
    display: block; grid-row: 8;
    background: linear-gradient(to bottom, var(--teach-tint) 50%, var(--secure-tint) 50%);
    background-image:
      linear-gradient(to bottom, transparent calc(50% - 1px), var(--ink) calc(50% - 1px), var(--ink) calc(50% + 1px), transparent calc(50% + 1px)),
      linear-gradient(to bottom, var(--teach-tint) 50%, var(--secure-tint) 50%);
    background-size: auto;
    border-top: 0;
  }
  .lane-band--secure { grid-row: 9 / 11; border-top: 0; }

  #n-modus { grid-column: 1; grid-row: 3; }
  #n-econ { grid-column: 1; grid-row: 4; }
  #n-skills { grid-column: 1; grid-row: 5; }
  #n-z2w { grid-column: 1; grid-row: 6; }
  #n-lessons { grid-column: 1; grid-row: 7; }
  #n-warden { grid-column: 1; grid-row: 8; align-self: center; margin-block: 22px; }
  #n-certs { grid-column: 1; grid-row: 9; }
  #n-reading { grid-column: 1; grid-row: 10; }
  #n-end { grid-column: 1; grid-row: 11; }
  .task { max-width: 340px; width: calc(100% - 48px); margin-block: 26px; }
  #n-modus, #n-z2w { margin-top: 36px; }
  .node { margin-block: 22px; }
  #n-certs { margin-top: 26px; }
  #n-end { margin-block: 30px 34px; }
}

/* ── Lane sections (the detail below the map) ──────────────────── */
.lane-strip {
  border-block: var(--stroke) solid var(--ink);
  background: var(--lane);
  color: var(--lane-on);
}
.lane-strip .wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
  gap: var(--s3) var(--s5); align-items: end;
  padding-top: var(--s5); padding-bottom: var(--s4);
}
.lane-strip h2 {
  font-size: clamp(3.25rem, 8.5vw, 6rem);
  font-weight: 850; font-variation-settings: "wdth" 92;
  letter-spacing: -0.035em; line-height: 0.86;
}
.lane-strip p { font-size: 1.1875rem; line-height: 1.45; font-weight: 500; max-width: 30rem; padding-bottom: 6px; }
.lane--build { --lane: var(--build); --lane-on: var(--build-on); --lane-tint: var(--build-tint); --lane-ink-2: var(--build-ink-2); }
.lane--teach { --lane: var(--teach); --lane-on: var(--teach-on); --lane-tint: var(--teach-tint); --lane-ink-2: var(--teach-ink-2); }
.lane--secure { --lane: var(--secure); --lane-on: var(--secure-on); --lane-tint: var(--secure-tint); --lane-ink-2: var(--secure-ink-2); }
@media (max-width: 860px) {
  .lane-strip .wrap { grid-template-columns: 1fr; padding-top: var(--s4); padding-bottom: var(--s3); }
}

.lane-body { padding: var(--s5) 0 var(--s6); }
.lane-body > .wrap > * + * { margin-top: var(--s6); }

/* A piece of work: screenshot + text, alternating sides. */
.work {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: var(--s4) var(--s5); align-items: center;
}
.work--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
.work--flip .shot { order: 2; }
.work h3 {
  font-size: clamp(2.25rem, 4vw, 3.375rem); font-weight: 820;
  letter-spacing: -0.03em; line-height: 0.95;
}
.work .lead { margin-top: var(--s2); font-size: 1.3125rem; line-height: 1.38; font-weight: 560; max-width: 34ch; }
.work .body { margin-top: var(--s2); color: var(--ink-2); max-width: 60ch; }
.work .tags { margin-top: var(--s3); color: var(--ink); display: flex; flex-wrap: wrap; gap: 6px 14px; }
@media (max-width: 960px) {
  .work, .work--flip { grid-template-columns: 1fr; }
  .work--flip .shot { order: 0; }
}

.shot {
  margin: 0; position: relative;
  border: var(--stroke) solid var(--ink); border-radius: var(--radius);
  overflow: hidden; background: var(--paper);
}
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.shot figcaption {
  position: absolute; left: 12px; bottom: 12px;
  background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: 999px;
  padding: 4px 11px 5px;
}

/* Outgoing flows: links drawn as a line with an arrowhead. */
.outs { margin-top: var(--s3); display: flex; flex-wrap: wrap; gap: 12px 28px; list-style: none; padding: 0; }
.out {
  display: inline-flex; align-items: center; gap: 0;
  font-weight: 700; font-size: 1rem; text-decoration: none;
  padding: 4px 0;
}
.out::before {
  content: ""; width: 28px; height: 2px; background: currentColor; flex: none;
  transform-origin: left center;
  transition: transform 0.35s var(--ease-out);
}
.out::after {
  content: ""; width: 9px; height: 10px; flex: none;
  background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%);
  order: 1; margin-left: -2px;
  transition: transform 0.35s var(--ease-out);
}
.out span { order: 2; margin-left: 10px; }
.out:hover::before, .out:focus-visible::before { transform: scaleX(1.5); }
.out:hover::after, .out:focus-visible::after { transform: translateX(14px); }
.out:hover span, .out:focus-visible span { transform: translateX(14px); }
.out span { transition: transform 0.35s var(--ease-out), border-color 0.2s; }
.out span { border-bottom: 2px solid transparent; }
.out:hover span { border-bottom-color: currentColor; }
.out--primary { font-size: 1.0625rem; }

/* An expanded sub-process: a frame holding a row of small tasks. */
.subprocess {
  border: var(--stroke) solid var(--ink); border-radius: calc(var(--radius) + 6px);
  padding: var(--s4);
  background-color: var(--paper);
  background-image: radial-gradient(circle, rgba(17,17,17,0.09) 1px, transparent 1.3px);
  background-size: 18px 18px;
}
.subprocess-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2) var(--s4); align-items: end; }
.subprocess-head h3 { font-size: clamp(2rem, 3.4vw, 2.75rem); font-weight: 820; letter-spacing: -0.03em; line-height: 0.95; }
.subprocess-head p { color: var(--ink-2); max-width: 54ch; margin-top: 12px; }
.chain { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: 22px 34px; align-items: start; }
.chain--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chain--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chain--tools { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); }
.chain > li {
  position: relative;
  background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: var(--radius);
  padding: 12px 14px 14px;
}
.chain > li > strong { display: block; font-size: 1.0625rem; font-weight: 760; letter-spacing: -0.005em; }
.chain > li > span { display: block; margin-top: 4px; font-size: 0.875rem; line-height: 1.45; color: var(--ink-2); }
.chain > li > em { display: inline-block; margin-top: 12px; font-style: normal; }
.chain--tools > li { padding: 16px 18px 18px; }
.chain--tools > li > strong { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; }
.chain--tools > li > span { font-size: 0.9375rem; }
.chain > li + li::before {
  content: ""; position: absolute; left: -34px; top: 30px; width: 32px; height: 2px; background: var(--ink);
}
.chain > li + li::after {
  content: ""; position: absolute; left: -10px; top: 26px; width: 9px; height: 10px;
  background: var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.chain--3 > li:nth-child(3n+1)::before, .chain--3 > li:nth-child(3n+1)::after { display: none; }
@media (max-width: 960px) {
  .chain--4, .chain--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chain--3 > li:nth-child(4)::before, .chain--3 > li:nth-child(4)::after { display: block; }
  .chain--4 > li:nth-child(2n+1)::before, .chain--4 > li:nth-child(2n+1)::after,
  .chain--3 > li:nth-child(2n+1)::before, .chain--3 > li:nth-child(2n+1)::after { display: none; }
  .chain--tools { grid-template-columns: 1fr; }
  .chain--tools > li + li::before { left: 26px; top: -22px; width: 2px; height: 20px; }
  .chain--tools > li + li::after { left: 21px; top: -10px; width: 12px; height: 9px; clip-path: polygon(0 0, 100% 0, 50% 100%); }
}
@media (max-width: 760px) {
  .subprocess { padding: var(--s3); }
  .subprocess-head { grid-template-columns: 1fr; }
  .chain--4, .chain--3 { grid-template-columns: 1fr; }
  .chain > li + li::before, .chain--4 > li:nth-child(n)::before, .chain--3 > li:nth-child(n)::before { display: block; left: 26px; top: -22px; width: 2px; height: 20px; }
  .chain > li + li::after, .chain--4 > li:nth-child(n)::after, .chain--3 > li:nth-child(n)::after { display: block; left: 21px; top: -10px; width: 12px; height: 9px; clip-path: polygon(0 0, 100% 0, 50% 100%); }
  .chain--4 > li:first-child::before, .chain--4 > li:first-child::after,
  .chain--3 > li:first-child::before, .chain--3 > li:first-child::after { display: none; }
}

/* Lessons strip: a sequence of real lesson thumbnails. */
.lessons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; }
.lessons li { position: relative; }
.lessons img { border: var(--stroke) solid var(--ink); border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.lessons li + li::before {
  content: ""; position: absolute; left: -30px; top: 50%; width: 28px; height: 2px; background: var(--ink);
}
.lessons li + li::after {
  content: ""; position: absolute; left: -9px; top: calc(50% - 5px); width: 9px; height: 10px;
  background: var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.lessons .note { display: block; margin-top: 10px; }
.course { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--s3) var(--s5); align-items: end; margin-bottom: var(--s4); }
.course h3 { font-size: clamp(2.25rem, 4vw, 3.375rem); font-weight: 820; letter-spacing: -0.03em; line-height: 0.95; }
.course .lead { margin-top: var(--s2); font-size: 1.3125rem; line-height: 1.38; font-weight: 560; max-width: 30ch; }
.course .body { color: var(--ink-2); max-width: 60ch; }
@media (max-width: 960px) {
  .course { grid-template-columns: 1fr; }
  .lessons { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 30px; }
  .lessons li:nth-child(3)::before, .lessons li:nth-child(3)::after { display: none; }
}

/* Classroom tools: one wide task with its own little process, two plain ones. */
.tools { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s3); align-items: stretch; }
.tool {
  border: var(--stroke) solid var(--ink); border-radius: var(--radius); background: var(--paper);
  padding: var(--s3) var(--s3) calc(var(--s3) + 2px);
}
.tool h3 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; }
.tool p { margin-top: 10px; color: var(--ink-2); max-width: 58ch; }
.tool .note { display: inline-block; margin-top: 14px; }
.tool-stack { display: grid; gap: var(--s3); }
.tool--wide { background-color: var(--lane-tint); }
.ministeps { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; counter-reset: step; }
.ministeps li {
  position: relative; background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: 8px;
  padding: 10px 10px 11px; font-size: 0.875rem; line-height: 1.3; font-weight: 600;
}
.ministeps li + li::before { content: ""; position: absolute; left: -22px; top: 50%; width: 20px; height: 2px; background: var(--ink); }
.ministeps li + li::after { content: ""; position: absolute; left: -8px; top: calc(50% - 5px); width: 8px; height: 10px; background: var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%); }
@media (max-width: 960px) {
  .tools { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .ministeps { grid-template-columns: 1fr 1fr; }
  .ministeps li:nth-child(3)::before, .ministeps li:nth-child(3)::after { display: none; }
}

/* Collapsed sub-process: courses, with the notation's [+] marker. */
.courses { border: var(--stroke) solid var(--ink); border-radius: calc(var(--radius) + 6px); background: var(--paper); }
.courses summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) var(--s4);
}
.courses summary::-webkit-details-marker { display: none; }
.courses summary h3 { font-size: clamp(1.75rem, 3vw, 2.375rem); font-weight: 820; letter-spacing: -0.025em; }
.courses summary p { color: var(--ink-2); margin-top: 6px; }
.plus {
  flex: none; width: 34px; height: 34px; border: var(--stroke) solid var(--ink); border-radius: 4px;
  position: relative; background: var(--paper);
}
.plus::before, .plus::after { content: ""; position: absolute; left: 50%; top: 50%; background: var(--ink); transform: translate(-50%, -50%); }
.plus::before { width: 16px; height: 2px; }
.plus::after { width: 2px; height: 16px; transition: transform 0.3s var(--ease-out); }
.courses[open] .plus::after { transform: translate(-50%, -50%) scaleY(0); }
/* (course-list retired) */
.course-list-retired {
  list-style: none; margin: 0; padding: 0 var(--s4) var(--s4);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s4);
}
.course-list li { padding: var(--s2) 0; border-top: var(--stroke) solid var(--ink); }
.course-list strong { display: block; font-size: 1.1875rem; font-weight: 760; }
.course-list span { display: block; margin-top: 4px; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.45; }
@media (max-width: 960px) { .course-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .courses summary { padding: var(--s3); }
  .course-list { grid-template-columns: 1fr; padding: 0 var(--s3) var(--s3); }
}

/* ── Seam: Code Warden sits across Teach and Secure ────────────── */
.seam {
  position: relative;
  border-top: var(--stroke) solid var(--ink);
  background: linear-gradient(to bottom, var(--teach-tint) 50%, var(--secure-tint) 50%);
  padding: var(--s6) 0;
}
.seam::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--ink);
}
.seam-lanes { position: absolute; left: var(--gutter); top: 0; bottom: 0; display: grid; grid-template-rows: 1fr 1fr; pointer-events: none; }
.seam-lanes span { display: flex; align-items: center; }
.seam-lanes span em {
  font-style: normal; writing-mode: vertical-rl; transform: rotate(180deg);
  padding: 4px 6px; border: var(--stroke) solid var(--ink); border-radius: 999px;
}
.seam-lanes span:first-child em { background: var(--teach); }
.seam-lanes span:last-child em { background: var(--secure); }
.seam .wrap { position: relative; z-index: 1; }
.seam-task {
  margin-left: clamp(0px, 4vw, 56px);
  background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: calc(var(--radius) + 6px);
  padding: clamp(20px, 3vw, 40px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: var(--s4) var(--s5); align-items: center;
  box-shadow: 0 30px 60px -40px rgba(17, 17, 17, 0.5);
}
.seam-task h2 { font-size: clamp(2.75rem, 5.6vw, 4.75rem); font-weight: 850; font-variation-settings: "wdth" 92; letter-spacing: -0.035em; line-height: 0.9; }
.seam-task .lead { margin-top: var(--s2); font-size: 1.3125rem; line-height: 1.38; font-weight: 560; max-width: 30ch; }
.seam-task .body { margin-top: var(--s2); color: var(--ink-2); max-width: 56ch; }
.seam-task .tags { margin-top: var(--s3); display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; border: var(--stroke) solid var(--ink); border-radius: 999px; padding: 3px 10px 4px; }
.chip--teach { background: var(--teach); }
.chip--secure { background: var(--secure); }
.chip--build { background: var(--build); color: var(--build-on); }
@media (max-width: 960px) {
  .seam-task { grid-template-columns: 1fr; margin-left: 34px; }
  .seam { padding: var(--s5) 0; }
}

/* ── Security lane ──────────────────────────────────────────────── */
.statement {
  font-size: clamp(1.625rem, 3.2vw, 2.5rem); line-height: 1.18; font-weight: 640;
  letter-spacing: -0.02em; max-width: 30ch;
}
.statement + .body { margin-top: var(--s3); color: var(--ink-2); max-width: 62ch; }
.certs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4) var(--s3); }
.certs li { display: grid; justify-items: center; align-content: start; text-align: center; gap: var(--s2); position: relative; }
.cert-ring {
  width: 152px; height: 152px; border-radius: 50%;
  border: var(--stroke) solid var(--ink); background: var(--paper);
  box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 7px var(--ink);
  display: grid; place-items: center;
}
.cert-ring img { width: 96px; height: 96px; object-fit: contain; }
.certs strong { display: block; font-size: 1.0625rem; font-weight: 760; line-height: 1.2; }
.certs .cert-note { display: block; margin-top: 4px; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.4; max-width: 24ch; }
.certs li + li::before {
  content: ""; position: absolute; top: 75px; height: 2px; background: var(--ink);
  left: calc(-1 * var(--s3) - (100% - 152px) / 2); width: calc(100% - 152px + var(--s3));
}
.certs-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--s3); margin-bottom: var(--s4); }
.certs-head h3, .readings-head h3 { font-size: clamp(2rem, 3.4vw, 2.75rem); font-weight: 820; letter-spacing: -0.03em; line-height: 0.95; }
@media (max-width: 900px) {
  .certs { grid-template-columns: 1fr 1fr; }
  .certs li + li::before { display: none; }
}

.readings-head { display: flex; justify-content: space-between; align-items: end; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.doc {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); align-items: end;
  padding: var(--s4) var(--s5) var(--s4) var(--s4);
  border: var(--stroke) solid var(--ink); background: var(--paper);
  clip-path: polygon(0 0, calc(100% - 46px) 0, 100% 46px, 100% 100%, 0 100%);
  text-decoration: none; color: var(--ink);
  transition: background-color 0.3s var(--ease-out);
}
.doc::after {
  content: ""; position: absolute; top: -2px; right: -2px; width: 48px; height: 48px;
  background: linear-gradient(to bottom left, transparent calc(50% - 1px), var(--ink) calc(50% - 1px), var(--ink) calc(50% + 1px), var(--lane-tint, #eee) calc(50% + 1px));
}
.doc:hover { background: var(--lane-tint); }
.doc h4, .doc .doc-title { font-size: clamp(1.625rem, 3vw, 2.375rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.02; max-width: 24ch; }
.doc p { margin-top: var(--s2); color: var(--ink-2); max-width: 60ch; }
.doc .doc-meta { display: block; margin-top: var(--s2); }
.doc .out { white-space: nowrap; }
@media (max-width: 760px) {
  .doc { grid-template-columns: 1fr; padding: var(--s3) var(--s4) var(--s3) var(--s3); }
}

/* ── End event: say hello ───────────────────────────────────────── */
.hello { border-top: var(--stroke) solid var(--ink); padding: var(--s6) 0; }
.hello .wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s4) var(--s5); align-items: start; }
.hello-ring { --ring-b: clamp(10px, 1.3vw, 16px); width: clamp(96px, 12vw, 152px); aspect-ratio: 1; border-radius: 50%; border: var(--ring-b) solid var(--ink); }
.hello h2 { font-size: clamp(3.25rem, 8.5vw, 6rem); font-weight: 850; font-variation-settings: "wdth" 92; letter-spacing: -0.035em; line-height: 0.86; }
.hello p { margin-top: var(--s2); font-size: 1.1875rem; color: var(--ink-2); }
.mail {
  display: inline-block; margin-top: var(--s3);
  font-size: clamp(1.5rem, 4.2vw, 3rem); font-weight: 760; letter-spacing: -0.025em;
  text-decoration: none; border-bottom: 4px solid var(--build); line-height: 1.15;
  overflow-wrap: anywhere;
  transition: border-color 0.2s;
}
.mail:hover { border-bottom-color: var(--ink); }
.socials { list-style: none; margin: var(--s4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 26px; }
.socials a { font-weight: 650; text-decoration: none; border-bottom: 2px solid var(--ink); padding-bottom: 1px; }
.socials a:hover { border-bottom-color: var(--build); }
@media (max-width: 640px) { .hello .wrap { grid-template-columns: 1fr; } }

.site-foot { border-top: var(--stroke) solid var(--ink); padding: var(--s3) 0 var(--s4); color: var(--ink-2); font-size: 0.875rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }

/* ── Blog index + article (Read mode) ───────────────────────────── */
.page-head { border-bottom: var(--stroke) solid var(--ink); background-color: var(--secure-tint); background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.3px); background-size: 18px 18px; }
.page-head .wrap { padding-top: var(--s5); padding-bottom: var(--s4); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30rem); gap: var(--s3) var(--s5); align-items: end; }
.page-head h1 { font-size: clamp(3.25rem, 8.5vw, 6rem); font-weight: 850; font-variation-settings: "wdth" 92; letter-spacing: -0.035em; line-height: 0.86; }
.page-head p { font-size: 1.1875rem; line-height: 1.45; font-weight: 500; color: var(--secure-ink-2); }
@media (max-width: 860px) { .page-head .wrap { grid-template-columns: 1fr; } }
.post-list { padding: var(--s5) 0 var(--s6); }
.post-list .wrap > * + * { margin-top: var(--s4); }

.article-head { border-bottom: var(--stroke) solid var(--ink); background-color: var(--secure-tint); background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.3px); background-size: 18px 18px; }
.article-head .wrap { max-width: 980px; padding-top: var(--s5); padding-bottom: var(--s5); }
.article-head .meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: var(--s3); }
.article-head h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 850; font-variation-settings: "wdth" 92; letter-spacing: -0.035em; line-height: 0.92; max-width: 18ch; }
.article-head .subtitle { margin-top: var(--s3); font-size: 1.3125rem; line-height: 1.42; font-weight: 540; color: var(--secure-ink-2); max-width: 44ch; }
.article-figure { max-width: 980px; margin: var(--s5) auto 0; padding: 0 var(--gutter); }
.article-figure img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border: var(--stroke) solid var(--ink); border-radius: var(--radius); }
.prose { max-width: calc(68ch + 2 * var(--gutter)); margin: 0 auto; padding: var(--s5) var(--gutter) var(--s6); font-size: 1.125rem; line-height: 1.7; }
.prose p { margin: 0 0 1.15em; }
.prose h2 { font-size: clamp(1.625rem, 3vw, 2.125rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 2.2em 0 0.6em; }
.prose h3 { font-size: 1.375rem; font-weight: 780; margin: 1.8em 0 0.5em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--secure-ink-2); }
.prose strong { font-weight: 720; }
.prose a { text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--secure); }
.prose a:hover { text-decoration-color: var(--ink); }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; background: var(--secure-tint); border: 1px solid rgba(17,17,17,0.18); border-radius: 4px; padding: 0.08em 0.35em; }
.prose blockquote { margin: 1.6em 0; padding: 0 0 0 1.1em; border-left: 1px solid var(--ink); font-size: 1.25rem; }
.prose .callout { margin: 0 0 2em; padding: var(--s3); border: var(--stroke) solid var(--ink); border-radius: var(--radius); background: var(--secure-tint); }
.prose .callout-title { font-size: 0.75rem; font-weight: 650; font-variation-settings: "wdth" 75; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
.prose .callout p:last-child, .prose .callout ul:last-child { margin-bottom: 0; }
.prose .back { margin-top: var(--s5); }

/* Security statement beside its detail */
.stance { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s3) var(--s5); align-items: end; }
.stance .statement + .body { margin-top: 0; }
@media (max-width: 900px) { .stance { grid-template-columns: 1fr; } }

/* Code Warden in the map carries a glimpse of itself */
.task-thumb { display: none; }
@media (min-width: 1180px) {
  #n-warden { justify-content: flex-start; padding-top: 0; overflow: hidden; }
  #n-warden .task-thumb {
    display: block; margin: 0 -14px 8px; width: calc(100% + 28px); max-width: none;
    aspect-ratio: 4 / 3; object-fit: cover; object-position: left top;
    border-bottom: var(--stroke) solid var(--ink);
  }
}

.courses .chain { margin: 0; padding: 0 var(--s4) var(--s4); }
.courses:not([open]) .when-open, .courses[open] .when-closed { display: none; }
@media (max-width: 600px) { .courses .chain { padding: 0 var(--s3) var(--s3); } }

/* ── The process continues below the map ───────────────────────── */
.lane-body {
  --ink-2: var(--lane-ink-2);
  background-color: var(--lane-tint);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.3px);
  background-size: 18px 18px;
  background-position: 9px 9px;
}
.lane-body > .wrap > * { position: relative; }
.lane-body > .wrap > *::before {
  content: ""; position: absolute; left: 30px; width: 2px; background: var(--ink);
  top: calc(-1 * var(--s6)); height: calc(var(--s6) - 4px);
}
.lane-body > .wrap > *:first-child::before { top: calc(-1 * var(--s5) - 2px); height: calc(var(--s5) - 2px); }
.lane-body > .wrap > *::after {
  content: ""; position: absolute; left: 25px; top: -11px; width: 12px; height: 10px;
  background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.seam-task { position: relative; }
.seam-task::before {
  content: ""; position: absolute; left: 30px; width: 2px; background: var(--ink);
  top: calc(-1 * var(--s6) - 2px); height: calc(var(--s6) - 2px);
}
.seam-task::after {
  content: ""; position: absolute; left: 25px; top: -11px; width: 12px; height: 10px;
  background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.hello-ring { position: relative; }
.hello-ring::before {
  content: ""; position: absolute; left: 50%; margin-left: -1px; width: 2px; background: var(--ink);
  bottom: calc(100% + var(--ring-b)); height: calc(var(--s6) - 2px);
}
.hello-ring::after {
  content: ""; position: absolute; left: 50%; margin-left: -6px; bottom: calc(100% + var(--ring-b)); width: 12px; height: 10px;
  background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
@media (max-width: 960px) { .seam-task::before { top: calc(-1 * var(--s5) - 2px); height: calc(var(--s5) - 2px); } }
@media (max-width: 640px) { .hello-ring::before, .hello-ring::after { display: none; } }

/* Code Warden in the map: picture in the Teach half, words in the Secure half */
@media (min-width: 1180px) {
  #n-warden { padding-bottom: 12px; }
  #n-warden .task-thumb { aspect-ratio: auto; height: calc(50% + 7px); flex: none; margin-bottom: 10px; }
}

/* Post figure: the post's argument as a short flow */
.process-figure {
  margin-top: var(--s5);
}
.process-figure .chain {
  margin: 0; padding: var(--s4);
  border: var(--stroke) solid var(--ink); border-radius: calc(var(--radius) + 6px);
  background-color: var(--secure-tint);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.3px);
  background-size: 18px 18px;
}
.process-figure .chain > li:last-child { border-width: 5px; border-radius: 999px; text-align: center; }
.process-figure figcaption { margin-top: 12px; }
@media (max-width: 760px) { .process-figure .chain { padding: var(--s3); } }

/* ── Databases to the web: two lessons in sequence ─────────────── */
.lesson-pair-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--s3) var(--s5); align-items: end; margin-bottom: var(--s4); }
.lesson-pair-head h3 { font-size: clamp(2.25rem, 4vw, 3.375rem); font-weight: 820; letter-spacing: -0.03em; line-height: 0.95; }
.lesson-pair-head .lead { margin-top: var(--s2); font-size: 1.3125rem; line-height: 1.38; font-weight: 560; max-width: 32ch; }
.lesson-pair-head .body { color: var(--ink-2); max-width: 60ch; }
.lesson-seq { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) 56px; }
.lesson-seq > li { position: relative; }
.lesson-seq > li + li::before {
  content: ""; position: absolute; left: -56px; top: 25%; width: 54px; height: 2px; background: var(--ink);
}
.lesson-seq > li + li::after {
  content: ""; position: absolute; left: -11px; top: calc(25% - 5px); width: 10px; height: 12px;
  background: var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%); margin-top: 0;
}
.shot--lesson img { aspect-ratio: 1574 / 838; }
.lesson-seq h4 { margin-top: var(--s3); font-size: 1.625rem; font-weight: 800; letter-spacing: -0.02em; }
.lesson-seq p { margin-top: 8px; color: var(--ink-2); max-width: 52ch; }
.lesson-seq .out { margin-top: var(--s2); }
.lesson-hint { margin-top: var(--s3); }
@media (max-width: 960px) {
  .lesson-pair-head { grid-template-columns: 1fr; }
  .lesson-seq { grid-template-columns: 1fr; gap: 56px; }
  .lesson-seq > li + li::before { left: 30px; top: -54px; width: 2px; height: 50px; }
  .lesson-seq > li + li::after { left: 25px; top: -12px; width: 12px; height: 10px; clip-path: polygon(0 0, 100% 0, 50% 100%); }
}

/* Courses run side by side, not in order: parallel multi-instance tasks, no flows between them */
.courses .chain > li { padding-bottom: 30px; }
.courses .chain > li::before { display: none; }
.courses .chain > li::after {
  display: block; content: ""; position: absolute; left: 50%; top: auto; bottom: 9px;
  width: 10px; height: 11px; margin: 0; transform: translateX(-50%); clip-path: none;
  background: linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 6px, transparent 6px 8px, var(--ink) 8px 10px);
}
