/* JavaScript, then Node.js: the course index only, loaded after javascript.css (copied from courses/mobile/index.css
   and adapted; design spec section 4). The rule as a manifesto; how a capsule works in five cards; the journey with its
   two parts, its blocks and its labs; the two playgrounds; the films; what the course leans on. Tokens only. */

/* ---------- Course index ---------- */
.hub-hero .lede { max-width: 50ch; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; list-style: none; }
.facts li { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .84rem; font-weight: 500; color: var(--ink-2); padding: 7px 12px 7px 10px; border-radius: 999px; background: var(--surface-glass); border: 1px solid var(--rule-strong); }
.facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--wire-deep); flex: none; }
:where(.wide .slide > p) { max-width: 68ch; }

.rule-card {
  position: relative; isolation: isolate; overflow: hidden; margin: 0; padding: clamp(28px, 4.5vw, 56px) clamp(22px, 5vw, 64px);
  border-radius: var(--r-xl); background: radial-gradient(70% 120% at 0% 0%, var(--glow-2), transparent 60%), radial-gradient(50% 80% at 100% 100%, var(--glow-1), transparent 70%), var(--surface);
  border: 1px solid var(--rule); box-shadow: var(--shadow);
}
.rule-card::before { content: "“"; position: absolute; z-index: -1; right: clamp(14px, 3vw, 44px); top: .02em; font: italic 600 clamp(9rem, 16vw, 15rem)/1 var(--font-display); background: var(--text-grad); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .18; pointer-events: none; }
.rule-card .answer__kicker { margin-bottom: 18px; font-size: .72rem; max-width: none; color: var(--ink-3); }
.rule-card :where(p) { margin: 0 0 .8em; font-size: 1.06rem; max-width: 64ch; color: var(--ink-2); }
.rule-card :where(p:first-of-type + p) { font-size: clamp(1.14rem, 1.04rem + .45vw, 1.34rem); line-height: 1.55; color: var(--ink); max-width: 48ch; }
.rule-card :where(p:last-child) { margin-bottom: 0; }
.rule-card b { color: var(--ink); background: var(--mark) 0 88% / 100% .34em no-repeat; }

.course-group__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 0 0 10px; }
.course-group__head h2 { margin: 0; }
.course-group__head a { font-weight: 600; font-size: .94rem; }
.course-group__lede { margin: 0 0 8px; color: var(--ink-2); font-size: 1.04rem; max-width: 62ch; }
.capsules {
  
  --c2: 28px; --g: 18px; --lead: 0px; --to-rail: calc(-1 * (var(--g) + var(--c2) / 2));
  position: relative; list-style: none; margin: 34px 0 0; padding: 0;
  display: grid; grid-template-columns: var(--c2) minmax(0, 1fr); column-gap: var(--g);
}
.capsules::before { content: ""; position: absolute; left: calc(var(--lead) + var(--c2) / 2 - 1px); top: 12px; bottom: 40px; width: 2px; border-radius: 2px; background: var(--wire-v); }
.capsules > li { position: relative; margin: 0; grid-column: 2; min-width: 0; }

.capsules > li:not(.capsules__group)::before {
  content: ""; position: absolute; z-index: 1; left: calc(var(--to-rail) - 7px); top: 18px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--rule-strong);
}
.capsules > li:has(.capsule-card:not(.capsule-card--soon))::before {
  left: calc(var(--to-rail) - 8px); top: 40px; width: 16px; height: 16px; border: 0; background: var(--wire-deep);
  box-shadow: 0 0 0 5px var(--bg), 0 0 0 6px color-mix(in srgb, #7a5cff 35%, transparent), 0 0 22px 2px rgba(122, 92, 255, .45);
}

.capsules > li:has(.capsule-card--soon)::after,
.capsules > .capsules__group:has(+ li .capsule-card--soon)::after {
  content: ""; position: absolute; left: calc(var(--to-rail) - 3px); top: -1px; bottom: -1px; width: 6px;
  background: linear-gradient(var(--rule-strong) 50%, transparent 0) 2px 0 / 2px 8px repeat-y, var(--bg);
}

.capsules > .capsules__group { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; padding: 38px 0 6px; font: italic 500 clamp(1.25rem, 1.1rem + .6vw, 1.5rem)/1.2 var(--font-display); color: var(--ink); }
.capsules > .capsules__group:first-child { padding-top: 0; }
.capsules > .capsules__group::before {
  content: ""; position: absolute; z-index: 1; left: calc(var(--to-rail) - 6px); top: calc(38px + .32em); width: 12px; height: 12px; border-radius: 3px; transform: rotate(45deg);
  background: var(--bg); border: 2px solid var(--ink-2);
}
.capsules > .capsules__group:first-child::before { top: .32em; }
.capsules > .capsules__group:first-child:has(+ li .capsule-card--soon)::after { top: 12px; }
.capsules__range { font: 500 .72rem/1 var(--font-mono); font-style: normal; letter-spacing: .1em; color: var(--ink-3); }

.capsule-card { position: relative; display: block; padding: 12px 0 18px; }
.capsule-card__eyebrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 6px 12px; margin: 0 0 6px !important; font: 500 .7rem/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.capsule-card__eyebrow .n { color: var(--ink); font-weight: 600; }
.capsule-card h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.12rem, 1.02rem + .4vw, 1.28rem); line-height: 1.24; margin: 0 0 6px; text-wrap: balance; color: var(--ink-2); }
.capsule-card p { margin: 0; color: var(--ink-3); font-size: .95rem; line-height: 1.55; max-width: 62ch; }
.capsule-card .meta { margin-top: 10px; font: 500 .74rem/1.3 var(--font-mono); letter-spacing: .04em; color: var(--ink-3); }

.capsule-card:not(.capsule-card--soon) {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 22px; align-items: start;
  margin: 12px 0 16px; padding: 18px 22px 20px 18px; border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow);
  transition: transform .35s var(--ease-out), box-shadow .35s ease, border-color .35s ease;
}
.capsule-card:not(.capsule-card--soon) > :not(.capsule-card__art) { grid-column: 2; }
.capsule-card:not(.capsule-card--soon) h3 { color: var(--ink); font-size: clamp(1.25rem, 1.1rem + .6vw, 1.55rem); }
.capsule-card:not(.capsule-card--soon) p { color: var(--ink-2); }
.capsule-card:not(.capsule-card--soon) h3 a { color: inherit; text-decoration: none; }
.capsule-card:not(.capsule-card--soon) h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.capsule-card:not(.capsule-card--soon):hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--rule-strong); }
.capsule-card:not(.capsule-card--soon):has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.capsule-card:not(.capsule-card--soon) h3 a:focus-visible { outline: none; }
.capsule-card__art { grid-column: 1; grid-row: 1 / span 4; align-self: stretch; min-height: 96px; border-radius: 18px; overflow: hidden; background: radial-gradient(80% 70% at 20% 0%, rgba(122, 92, 255, .4), transparent 70%), radial-gradient(70% 70% at 100% 100%, rgba(95, 211, 160, .25), transparent 70%), #0c0f1a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.capsule-card__art svg { width: 100%; height: 100%; }
.tag { display: inline-flex; align-items: center; gap: 6px; font: 600 .62rem/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink-3); }
.tag--on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 9%, var(--surface)); }
.tag--on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
@media (min-width: 900px) {
  
  .capsules { --c1: 220px; --lead: calc(var(--c1) + var(--g)); grid-template-columns: var(--c1) var(--c2) minmax(0, 1fr); }
  .capsules > li { grid-column: 3; }
  .capsules > .capsules__group { grid-column: 1; display: block; padding: 26px 0 0; text-align: right; }
  .capsules > .capsules__group:first-child { padding-top: 34px; }
  
  .capsules > .capsules__group::before { left: auto; right: calc(var(--to-rail) + 4px); top: calc(26px + .62em); width: calc(var(--g) - 2px); height: 1px; border: 0; border-radius: 0; transform: none; background: var(--ink-3); }
  .capsules > .capsules__group:first-child::before { top: calc(34px + .62em); }
  .capsules > .capsules__group:has(+ li .capsule-card--soon)::after { display: none; }
  .capsules__range { display: block; margin-top: 8px; }
  .capsules > .capsules__group + li:has(.capsule-card--soon) .capsule-card { padding-top: 22px; }
  .capsules > .capsules__group + li:has(.capsule-card--soon)::before { top: 28px; }
}
@media (max-width: 520px) {
  
  .capsule-card:not(.capsule-card--soon) { grid-template-columns: 52px minmax(0, 1fr); column-gap: 14px; row-gap: 10px; padding: 16px 16px 18px; border-radius: var(--r-lg); }
  .capsule-card:not(.capsule-card--soon) > :not(.capsule-card__art) { grid-column: 1 / -1; }
  .capsule-card:not(.capsule-card--soon) > .capsule-card__eyebrow { grid-column: 2; grid-row: 1; align-self: center; margin: 0 !important; }
  .capsule-card__art { grid-row: 1; min-height: 0; height: 52px; border-radius: 13px; }
  .capsule-card:not(.capsule-card--soon) h3 { margin-top: 2px; }
  .capsule-card__eyebrow { letter-spacing: .06em; }
}

#links .next-grid > div:first-child a { font-family: inherit; font-size: inherit; font-weight: inherit; color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 50%, transparent); }
#links .next-grid > div:first-child a::after { content: none; }

.how-capsule { position: relative; list-style: none; margin-block: 24px 8px; margin-inline: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.how-capsule::before { content: ""; position: absolute; z-index: 0; left: 16%; right: 16%; top: 40px; height: 2px; border-radius: 2px; background: var(--wire); opacity: .85; }
.how-capsule > li {
  position: relative; z-index: 1; margin: 0 !important; padding: 22px 20px 20px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow-sm);
}
.how-capsule__n {
  display: grid; place-items: center; width: 38px; height: 38px; margin: 0 0 14px; border-radius: 12px;
  font: 600 .86rem/1 var(--font-mono); color: #fff; background: var(--wire-deep); box-shadow: 0 0 0 5px var(--surface), 0 8px 18px -8px rgba(74, 52, 190, .6);
}
.how-capsule h3 { margin: 0 0 6px !important; font-family: var(--font-display); font-weight: 600; font-size: 1.22rem !important; line-height: 1.25; color: var(--ink); }
.how-capsule p { margin: 0 !important; font-size: .96rem !important; line-height: 1.5; color: var(--ink-2); }
@media (max-width: 700px) {
  .how-capsule { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .how-capsule::before { left: 38px; right: auto; top: 24px; bottom: 24px; width: 2px; height: auto; background: var(--wire-v); }
  .how-capsule > li { display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 16px; padding: 16px 16px 16px 18px; }
  .how-capsule__n { grid-row: span 2; margin: 0; }
}

/* ---------- Hero ---------- */

.hub-hero h1 em { display: inline-block; }

@media (max-width: 480px) { :root:lang(fr) .wire__pkt { letter-spacing: -.02em; padding-inline: 6px; } }

/* ---------- The rule of this course: three lines, the line to remember, the small print ---------- */
.rule-card .rule-lines {
  margin: 0 0 30px; max-width: 23ch;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 1.1rem + 2.1vw, 2.75rem);
  line-height: 1.12; letter-spacing: -.015em; color: var(--ink); text-wrap: balance;
}
.rule-lines > span { display: block; }
.rule-lines > span + span { margin-top: .12em; }

.rule-lines > span:first-child { margin-bottom: .5em; font-size: .56em; font-weight: 500; line-height: 1.3; letter-spacing: -.005em; color: var(--ink-2); }
.rule-lines em, .rule-close em {
  font-style: italic; font-weight: 500; padding-right: .06em;
  background: var(--text-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.rule-card .rule-close {
  position: relative; margin: 0 0 18px; padding-top: 24px; max-width: 46ch; text-wrap: balance;
  font: italic 500 clamp(1.16rem, 1.02rem + .55vw, 1.42rem)/1.42 var(--font-display); color: var(--ink);
}
.rule-close::before { content: ""; position: absolute; left: 0; top: 0; width: 48px; height: 2px; border-radius: 2px; background: var(--wire); }
.rule-card .rule-small { max-width: 62ch; margin-bottom: .55em; font-size: .98rem; line-height: 1.65; color: var(--ink-2); text-wrap: pretty; }

/* ---------- The capsule map: the upcoming capsules, one line each ---------- */
.course-group__lede { margin-bottom: 4px; }
.capsule-card p { text-wrap: pretty; }
.capsule-card .meta > span { white-space: nowrap; }

.capsule-card .meta { display: flex; flex-wrap: wrap; max-width: none; margin-left: -1.4em; clip-path: inset(0 0 0 1.4em); }
.capsule-card .meta > .meta__sep { display: none; }
.capsule-card .meta > span:not(.meta__sep)::before { content: "·"; content: "·" / ""; display: inline-block; width: 1.4em; text-align: center; }
.capsules > .capsules__group > span:first-child { display: block; text-wrap: balance; }
.capsules__when { display: block; margin-top: 6px; font: 500 .76rem/1.35 var(--font-body); font-style: normal; letter-spacing: .01em; color: var(--ink-3); }

.capsules__when--on { color: var(--ink-2); }

.capsules > li > .capsule-row { padding: 0; }
.capsule-row > summary {
  position: relative; display: flex; align-items: baseline; gap: 14px; min-height: 44px; padding: 9px 40px 9px 0;
  cursor: pointer; list-style: none; border-radius: 10px; -webkit-tap-highlight-color: transparent;
}
.capsule-row > summary::-webkit-details-marker { display: none; }
.capsule-row .n { flex: none; min-width: 2.2ch; font: 600 .78rem/1 var(--font-mono); letter-spacing: .04em; color: var(--ink-3); }
.capsule-row__q {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(1.05rem, .98rem + .3vw, 1.18rem); line-height: 1.35;
  color: var(--ink-2); text-wrap: balance; transition: color .2s ease;
}

.capsule-row > summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%;
  border: 1px solid var(--rule-strong); opacity: .9;
  background: linear-gradient(var(--ink-3), var(--ink-3)) 50% 50% / 9px 1.5px no-repeat, linear-gradient(var(--ink-3), var(--ink-3)) 50% 50% / 1.5px 9px no-repeat;
  transition: transform .25s var(--ease-out), border-color .2s ease;
}
.capsule-row[open] > summary::after { background: linear-gradient(var(--ink-3), var(--ink-3)) 50% 50% / 9px 1.5px no-repeat; transform: rotate(180deg); }
.capsule-row > summary:hover .capsule-row__q, .capsule-row[open] .capsule-row__q { color: var(--ink); }
.capsule-row > summary:hover::after { border-color: var(--ink-3); }
.capsule-row > summary:focus-visible { outline-offset: 2px; }
.capsules .capsule-row > p { margin: 0 40px 12px calc(2.2ch + 14px + .2em) !important; font-size: .94rem; line-height: 1.55; max-width: 60ch; }

.capsules > li:has(> .capsule-row)::before { top: 15px; }

@media (min-width: 900px) {
  
  .capsules > .capsules__group[data-span="2"] { grid-row: span 2; }
  .capsules > .capsules__group[data-span="3"] { grid-row: span 3; }
  .capsules > .capsules__group[data-span="4"] { grid-row: span 4; }
  .capsules > .capsules__group:not(:first-child) { padding-top: 30px; contain: size; }
  .capsules > .capsules__group:not(:first-child)::before { top: calc(30px + .62em); }
  
  .capsules > .capsules__group + li > .capsule-row { padding-top: 24px; }
  .capsules > .capsules__group + li:has(> .capsule-row)::before { top: 39px; }
  .capsules__when { margin-top: 4px; }
}
@media (max-width: 899px) {
  .capsules > .capsules__group { padding-top: 30px; }
  .capsules > .capsules__group::before { top: calc(30px + .32em); }
  .capsules > .capsules__group > span:first-child { flex-basis: 100%; }
  .capsules__when { display: inline; margin: 0; }
  .capsules__range + .capsules__when::before { content: "·"; margin-right: 10px; color: var(--rule-strong); }
}
@media (max-width: 520px) {
  
  .capsule-card:not(.capsule-card--soon) { margin: 8px 0 12px; padding: 14px 14px 15px; row-gap: 8px; }
  .capsule-card:not(.capsule-card--soon) h3 { font-size: 1.2rem; margin-bottom: 4px; }
  .capsule-card p { font-size: .92rem; line-height: 1.5; }
  .capsule-card .meta { margin-top: 6px; font-size: .66rem; letter-spacing: 0; }
  .capsules > li:has(.capsule-card:not(.capsule-card--soon))::before { top: 30px; }
  .capsules > .capsules__group { padding-top: 22px; }
  .capsules > .capsules__group::before { top: calc(22px + .32em); }
  .capsule-row__q { font-size: 1rem; }
  .capsule-row > summary { gap: 10px; padding-right: 34px; padding-block: 8px; }
  .capsule-row > summary::after { right: 2px; }
  .capsules .capsule-row > p { margin-left: calc(2.2ch + 10px + .2em) !important; margin-right: 6px !important; }
  /* A lab's badge takes its own line, so its title keeps the row's full width. */
  .capsule-row--lab > summary { flex-wrap: wrap; row-gap: 6px; }
  .capsule-row--lab .capsule-row__q { flex-basis: 100%; }
  .capsules .capsule-row--lab > p { margin-left: 0 !important; }
}

/* ---------- What this course leans on: a compact strip ---------- */
.leans { margin-top: clamp(64px, 7vw, 104px); }
.leans .leans__h { margin: 0 0 14px; font: 500 .74rem/1.3 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.leans .next-grid p { line-height: 1.6; }

.site-foot a { white-space: nowrap; }

/* ---------- Presentation mode: each slide fits one screen ---------- */
[data-teaching="true"] .leans { display: none; }

[data-teaching="true"] .how-capsule { margin-top: 36px; gap: 22px; }
[data-teaching="true"] .how-capsule > li { padding: 30px 28px 28px; }
[data-teaching="true"] .how-capsule::before { top: 49px; }
[data-teaching="true"] .how-capsule h3 { font-size: clamp(1.4rem, 1rem + 1vw, 1.75rem) !important; }
[data-teaching="true"] .how-capsule p { font-size: 1.12rem !important; }

/* ---------- How a capsule works: five cards, 3 + 2 at 900, one column on a phone ---------- */
.how-capsule--5::before { left: 12%; right: 12%; }
@media (max-width: 1000px) and (min-width: 701px) { .how-capsule--5 > li { padding: 18px 16px 16px; } }
.how-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 0 !important; font-weight: 600; color: var(--ink-2); }

/* ---------- The journey: two parts, each a heading row; the labs carry a badge instead of a number ---------- */
.capsules > .capsules__part {
  grid-column: 1 / -1; padding: 6px 0 0; margin: 0;
  font: 600 .74rem/1.3 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2);
}
.capsules > .capsules__part::before { content: none !important; }
.capsules > .capsules__part--2 { margin-top: 30px; padding-top: 24px; border-top: 1px dashed var(--rule-strong); }
.capsules > .capsules__part + .capsules__group { padding-top: 14px; }
.capsules > .capsules__part + .capsules__group::before { top: calc(14px + .32em); }
.lab-badge { min-width: 0 !important; padding: 3px 8px; border-radius: 999px; border: 1px dashed var(--control); font-size: .62rem !important; letter-spacing: .06em !important; text-transform: uppercase; white-space: nowrap; }
.capsules > li:has(> .capsule-row--lab)::before { border-style: dashed; }
@media (min-width: 900px) {
  .capsules > .capsules__part + .capsules__group { padding-top: 18px; }
  .capsules > .capsules__part + .capsules__group::before { top: calc(18px + .62em); }
  .capsules > .capsules__group[data-span="1"] { grid-row: span 1; }
  .capsules > .capsules__group[data-span="7"] { grid-row: span 7; }
}

/* ---------- The two playgrounds ---------- */
.pg-cards { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 18px 0 14px; max-width: 900px; }
.pg-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 18px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow); min-width: 0; }
.pg-card__shot { display: block; border-radius: 14px; overflow: hidden; background: #0b0d15; box-shadow: inset 0 0 0 1px var(--rule); }
.pg-card__shot img { width: 100%; height: auto; aspect-ratio: 720 / 405; object-fit: cover; object-position: left top; }
.pg-card__label { margin: 4px 4px 0 !important; }
.pg-card__h { margin: 0 4px !important; font-family: var(--font-display); font-weight: 600; font-size: 1.32rem; line-height: 1.25; color: var(--ink); }
.pg-card__sub { font-family: var(--font-body); font-weight: 500; font-size: .95rem; color: var(--ink-3); }
.pg-card > p:not(.pg-row):not(.pg-card__label) { margin: 0 4px !important; font-size: .98rem; line-height: 1.55; color: var(--ink-2); }
.pg-card .pg-row { margin: auto 4px 0; padding-top: 6px; }
.pg-slim { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; max-width: 900px; padding: 14px 18px; border-radius: var(--r); border: 1px dashed var(--rule-strong); }
.pg-slim p { margin: 0 !important; color: var(--ink-2); font-size: .98rem; }
.pg-under { margin-top: 12px !important; font-size: .94rem !important; color: var(--ink-3); }
@media (max-width: 760px) { .pg-cards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- The films ---------- */
.films-links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-weight: 600; }
.films-status { margin-top: 6px !important; }

/* ---------- Presentation mode: the five cards and the map, each on one slide ---------- */
[data-teaching="true"] .how-capsule--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
[data-teaching="true"] .how-capsule--5 > li { padding: 22px 18px 20px; }
[data-teaching="true"] .how-capsule--5 h3 { font-size: 1.3rem !important; }
[data-teaching="true"] .how-capsule--5 p { font-size: 1rem !important; }
[data-teaching="true"] .leans { display: none; }

@media print {
  .rule-lines em, .rule-close em { background: none; color: #16161f; -webkit-text-fill-color: #16161f; }
  .capsule-row > summary::after { display: none; }
  .pg-card, .pg-slim { box-shadow: none; break-inside: avoid; }
}

.capsules > .capsules__part { position: relative; }
.capsules > .capsules__part::after { content: ""; position: absolute; left: calc(var(--lead) + var(--c2) / 2 - 4px); top: -2px; bottom: -2px; width: 8px; background: var(--bg); }
@media (max-width: 480px) { .site-nav a.hide-xs { display: none; } }
@media (max-width: 899px) { .capsules > .capsules__part { padding-left: calc(var(--c2) + var(--g)); } }

[data-teaching="true"] #capsules { --tw: min(1240px, 100vw - 64px); width: var(--tw); margin-left: calc(50% - var(--tw) / 2); }
[data-teaching="true"] .capsules { display: block; columns: 3; column-gap: 34px; margin-top: 8px; }
[data-teaching="true"] .capsules::before, [data-teaching="true"] .capsules > li::before, [data-teaching="true"] .capsules > li::after, [data-teaching="true"] .cj-glint { display: none !important; }
[data-teaching="true"] .capsules > li { break-inside: avoid; }
[data-teaching="true"] .capsules > .capsules__part:first-child, [data-teaching="true"] .capsules > li[data-n="01"],
[data-teaching="true"] .capsules > li[data-n="01"] + .capsules__group, [data-teaching="true"] .capsules > li[data-n="02"] { column-span: all; }
[data-teaching="true"] .capsules > :is(li[data-n="01"], li[data-n="02"]) .capsule-card { margin: 4px 0 6px; padding: 12px 16px; max-width: 760px; }
[data-teaching="true"] .capsules > .capsules__part { padding-left: 0; }
[data-teaching="true"] .capsules > .capsules__part--2 { margin-top: 8px; padding-top: 8px; }
[data-teaching="true"] .capsules > .capsules__group { display: block; contain: none; text-align: left; padding: 8px 0 0; font-size: 1.02rem; }
[data-teaching="true"] .capsules__range, [data-teaching="true"] .capsules__when { display: inline; margin: 0 0 0 8px; }
[data-teaching="true"] .capsule-row > summary { min-height: 28px; padding-block: 2px; gap: 8px; padding-right: 30px; }
[data-teaching="true"] .capsule-row__q { font-size: .9rem; line-height: 1.3; }
[data-teaching="true"] .capsule-row > summary::after { width: 18px; height: 18px; margin-top: -9px; }
[data-teaching="true"] .capsules > .capsules__group + li > .capsule-row { padding-top: 0; }

/* ======================================================================================================================
   Large screens (2026-10-25, docs/js-series/layout-audit.md, "Prototype"). From 1280 px the page frame grows with the
   screen (1216 px at 1280, 1536 at 1920, 1880 at 2560; at most 105rem, so it follows the type) and the hero, the header
   and the body share its left edge; the paragraphs keep their 68ch. From 1280 the rule card splits in two, the five steps
   sit three and two (the two centred), and until 1600 the capsule list keeps 65rem (its "+" stays near its question).
   From 1600 the five steps sit on one row and the journey takes the left of the page, with the playgrounds, the films
   and the links beside it. Presentation mode keeps its 1280 px slide (every rule stops at :root.is-presenting).
   ====================================================================================================================== */
@media screen and (min-width: 1280px) {
  :root:not(.is-presenting) { --hub-w: min(100vw - 2 * var(--gutter) - max(0px, 100vw - 1280px) / 2, 105rem); }
  :root:not(.is-presenting) body > :is(.site-head, .module-main, .site-foot) > .wrap { max-width: calc(var(--hub-w) + 2 * var(--gutter)); }
  :root:not(.is-presenting) .article > .wide { max-width: none; }
  :root:not(.is-presenting) :is(.pg-cards, .pg-slim) { max-width: none; }
  :root:not(.is-presenting) .article > .wide > #capsules { max-width: 65rem; }

  /* The rule: the three lines and the line to remember on the left, the small print on the right */
  :root:not(.is-presenting) .rule-card {
    display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr;
    column-gap: clamp(40px, 5vw, 104px);
  }
  :root:not(.is-presenting) .rule-card > * { grid-column: 1; }
  :root:not(.is-presenting) .rule-card > .rule-small { grid-column: 2; padding-left: 26px; border-left: 1px solid var(--rule-strong); }
  :root:not(.is-presenting) .rule-card > .rule-close + .rule-small { grid-row: 2; align-self: end; margin-bottom: 0; padding-bottom: .55em; }
  :root:not(.is-presenting) .rule-card > .rule-small + .rule-small { grid-row: 3; align-self: start; margin: 0; }

  /* How a capsule works: three steps, then the last two centred under them (five on one row from 1600) */
  :root:not(.is-presenting) .how-capsule--5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  :root:not(.is-presenting) .how-capsule--5 > li { grid-column: span 2; }
  :root:not(.is-presenting) .how-capsule--5 > li:nth-child(4) { grid-column: 2 / span 2; }
  :root:not(.is-presenting) .how-capsule h3 { text-wrap: balance; }
}
@media screen and (min-width: 1600px) {
  :root:not(.is-presenting) .how-capsule--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  :root:not(.is-presenting) .how-capsule--5 > li, :root:not(.is-presenting) .how-capsule--5 > li:nth-child(4) { grid-column: auto; }
  :root:not(.is-presenting) .how-capsule--5::before { left: 8%; right: 8%; }

  /* The journey on the left; the playgrounds, the films and the links stacked beside it (reading order unchanged) */
  :root:not(.is-presenting) .article > .wide {
    display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); grid-template-rows: repeat(4, auto) 1fr;
    column-gap: clamp(48px, 4vw, 104px); align-items: start;
  }
  :root:not(.is-presenting) .article > .wide > * { grid-column: 1 / -1; }
  :root:not(.is-presenting) .article > .wide > #capsules { grid-column: 1; grid-row: 3 / -1; max-width: none; }
  :root:not(.is-presenting) .article > .wide > :is(#playgrounds, #films, #links) { grid-column: 2; }
  :root:not(.is-presenting) .article > .wide > #films { margin-top: clamp(48px, 4vw, 72px); }
  :root:not(.is-presenting) .article > .wide > #links { margin-top: clamp(48px, 4vw, 72px); }
  :root:not(.is-presenting) #playgrounds .pg-cards, :root:not(.is-presenting) #links .next-grid { grid-template-columns: minmax(0, 1fr); }
  /* "The films, on TMIMI Explains" goes under the capsules' intro line: at the end of the heading's row it sat right
     beside the playgrounds' column and read as part of it */
  :root:not(.is-presenting) #capsules { display: flex; flex-direction: column; }
  :root:not(.is-presenting) #capsules > .course-group__head { display: contents; }
  :root:not(.is-presenting) #capsules > .course-group__head > h2 { margin-bottom: 10px; }
  :root:not(.is-presenting) #capsules > .course-group__head > a { order: 1; align-self: flex-start; margin: 2px 0 6px; }
  :root:not(.is-presenting) #capsules > :not(.course-group__head) ~ * { order: 2; }
}
