/* Topic rail — the "Start here" reel under the landing hero ----------------
 *
 * History, kept because it is why this file looks the way it does. The rail
 * first pinned itself and drove sideways from vertical scroll, which held the
 * reader for four screens; then it became a real scroller that paged itself
 * on a timer and took the mouse wheel under the pointer, which hid three of
 * its four panels from anyone who did not stop and play with it. It was
 * removed on 2026-11-02 and replaced by the layer list in chapter 01.
 *
 * It came back on 2026-11-06, at the owner's request, for Topic 01. What
 * changed is what had been wrong:
 *
 * - No timer and no wheel capture. The rail is a plain scroll-snap scroller.
 *   A swipe, a trackpad's sideways gesture, the arrow keys, the two arrow
 *   buttons and the named steps move it. Vertical scrolling always belongs to
 *   the page.
 * - Named steps instead of anonymous dots, so a reader sees what the other
 *   panels hold before going there.
 * - The next panel always shows at the right edge. Nothing announces "there
 *   is more" as well as the start of the more.
 *
 * THE ONE RULE THAT STILL HOLDS: every panel is exactly --panel-h tall. A
 * rail whose panels size to their content is a rail where every panel is as
 * tall as the worst one, so the height is declared and the content is
 * designed to fit it; what would not fit steps out at narrow widths instead
 * of pushing.
 *
 * Inside that height, one composition four times: a side column with the
 * number, the heading, one line of framing and the buttons on the floor, a
 * hairline, then the body carrying the one thing the panel is about.
 */

.trail {
  --rail-gap: var(--g-space-md);
  --rail-p: 0;
  --panel-h: 40rem;
}
@media (min-width: 900px) {
  .trail { --panel-h: clamp(26rem, calc(100svh - var(--g-header-h, 4.5rem) - 13rem), 31rem); }
}
.trail .lp-head { margin-bottom: var(--g-space-md); }

/* Bar: the named steps on the left, count and arrows on the right ------- */
.trail__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--g-space-sm);
  margin-bottom: var(--g-space-sm);
}
.trail__steps {
  display: flex;
  gap: var(--g-space-3xs);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.trail__steps::-webkit-scrollbar { display: none; }
.trail__step {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: .45em;
  padding: .45rem .8rem;
  border: 1px solid var(--g-hairline);
  border-radius: var(--g-radius-pill);
  background: none;
  color: var(--g-text-muted);
  font: inherit;
  font-size: var(--g-fs-small);
  font-weight: var(--g-w-medium);
  cursor: pointer;
  transition: color var(--g-dur) var(--g-ease-orbit), background-color var(--g-dur) var(--g-ease-orbit), border-color var(--g-dur) var(--g-ease-orbit);
}
.trail__step:hover { color: var(--g-text); border-color: var(--g-text-subtle); }
.trail__step[aria-current="true"] { color: var(--g-text); background: var(--g-surface-raised); border-color: var(--g-accent); }

.trail__nav { display: flex; align-items: center; gap: var(--g-space-2xs); flex: none; }
.trail__count {
  font-family: var(--g-font-mono);
  font-size: var(--g-fs-caption);
  color: var(--g-text-subtle);
  margin-right: var(--g-space-2xs);
}
.trail__arrow {
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  border: 1px solid var(--g-hairline);
  border-radius: 50%;
  background: var(--g-surface);
  color: var(--g-text);
  cursor: pointer;
  transition: border-color var(--g-dur) var(--g-ease-orbit), opacity var(--g-dur) var(--g-ease-orbit), transform var(--g-dur-fast) var(--g-ease-orbit);
}
.trail__arrow svg { width: 1.1rem; height: 1.1rem; }
.trail__arrow:hover { border-color: var(--g-accent); }
.trail__arrow:active { transform: scale(.94); }
.trail__arrow:disabled { opacity: .35; cursor: default; border-color: var(--g-hairline); transform: none; }

/* The rail ---------------------------------------------------------------- */
.trail__rail {
  display: flex;
  gap: var(--rail-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--g-radius-lg);
  outline-offset: 4px;
}
.trail__rail::-webkit-scrollbar { display: none; }
/* Off while topic-rail.js scrolls, so Firefox cannot re-aim a smooth scroll
   mid-flight; the target is a snap point anyway. */
.trail__rail.is-paging { scroll-snap-type: none; }

.trail__panel {
  flex: 0 0 auto;
  width: 86%;
  height: var(--panel-h);
  scroll-snap-align: start;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--g-space-sm);
  padding: var(--g-space-md);
  border: 1px solid var(--g-hairline);
  border-radius: var(--g-radius-lg);
  background: var(--g-surface-raised);
  overflow: hidden;
  min-width: 0;
  transition: opacity var(--g-dur-slow) var(--g-ease-orbit);
}
/* The panel that is only peeking stays readable but steps back. */
.trail.is-live .trail__panel:not(.is-current) { opacity: .55; }
.trail.is-live .trail__panel:not(.is-current):hover { opacity: .8; }

.trail__side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-bottom: var(--g-space-sm);
  border-bottom: 1px solid var(--g-hairline);
}
.trail__n {
  font-family: var(--g-font-mono);
  font-size: var(--g-fs-caption);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--g-accent);
  margin: 0 0 var(--g-space-2xs);
}
.trail__side h3 { font-size: var(--g-fs-h4, 1.15rem); line-height: 1.2; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
.trail__say {
  font-size: var(--g-fs-small);
  color: var(--g-text-muted);
  margin: var(--g-space-2xs) 0 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.trail__act {
  display: flex;
  flex-wrap: wrap;
  gap: var(--g-space-2xs);
  margin-top: auto;
  padding-top: var(--g-space-sm);
}
.trail__body { min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; }

/* 01 — the poster, 16:9, with its runtime and where it will be watched */
.trail__video { width: 100%; aspect-ratio: 16 / 9; flex: none; }
.trail__tag {
  position: absolute; left: var(--g-space-sm); bottom: var(--g-space-sm); z-index: 1;
  font-family: var(--g-font-mono); font-size: var(--g-fs-caption); letter-spacing: .06em;
  color: var(--g-white-tint);
  background: rgb(3 3 3 / .55);
  backdrop-filter: blur(4px);
  border-radius: var(--g-radius-pill);
  padding: .25rem .65rem;
}

/* 04 — three frames: one leads, two follow */
.trail__gal { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--g-space-xs); }
.trail__fig { margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: var(--g-space-3xs); min-width: 0; min-height: 0; }
.trail__fig--lead { grid-column: 1 / -1; }
.trail__fig img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--g-radius-sm); border: 1px solid var(--g-hairline); background: var(--g-surface-sunken); }
.trail__fig figcaption { font-size: var(--g-fs-caption); line-height: 1.3; color: var(--g-text-muted); }
.trail__fig figcaption b { display: block; color: var(--g-text); font-weight: var(--g-w-semibold); }
.trail__fig figcaption span { display: none; }

/* Phones: the steps give way to the count and arrows. */
@media (max-width: 599px) {
  .trail__steps { display: none; }
  .trail__bar { justify-content: flex-end; }
  .trail__panel { padding: var(--g-space-sm); }
  .trail__act .g-btn { flex: 1 1 auto; justify-content: center; }
}

/* Wide: the two-column composition and the detail a phone cannot hold. */
@media (min-width: 900px) {
  .trail__panel {
    width: calc(100% - 5rem);
    grid-template-rows: none;
    grid-template-columns: 18rem minmax(0, 1fr);
    gap: var(--g-space-lg);
    padding: var(--g-space-lg);
  }
  .trail__side { padding-bottom: 0; padding-right: var(--g-space-lg); border-bottom: 0; border-right: 1px solid var(--g-hairline); }
  .trail__side h3 { font-size: var(--g-fs-h3); }
  .trail__say { -webkit-line-clamp: 5; }
  .trail__fig figcaption span { display: inline; }
  .trail__fig figcaption b { display: inline; margin-right: .4em; }
  .trail__gal { gap: var(--g-space-sm) var(--g-space-md); }
}

/* Progress under the rail, kept in step with the rail's own scrollLeft. */
.trail__line { display: block; height: 2px; margin-top: var(--g-space-sm); background: var(--g-hairline); border-radius: 2px; overflow: hidden; }
.trail__line span {
  display: block; height: 100%; width: 100%;
  background: var(--g-accent);
  transform: scaleX(var(--rail-p)); transform-origin: left center;
  transition: transform var(--g-dur) var(--g-ease-orbit);
}

@media (prefers-reduced-motion: reduce) {
  .trail__panel, .trail__step, .trail__arrow, .trail__line span { transition: none; }
}

/* The play button in the middle of the poster and the runtime in its
   lower-right corner, as a player draws them (review of 2026-11-23; they
   shared the lower-left corner before, to keep clear of the cast). */
.trail__video { place-items: center; }
.trail__video .video__play { width: 3.75rem; height: 3.75rem; }
.trail__video .trail__tag { left: auto; right: var(--g-space-sm); bottom: var(--g-space-sm); }
.trail__tag { white-space: nowrap; }
.trail__tag[hidden] { display: none; }
@media (max-width: 599px) {
  .trail { --panel-h: 31rem; }
  .trail__body { justify-content: flex-start; }
  .trail__video .video__play { width: 2.8rem; height: 2.8rem; }
  .trail__video .video__play svg { width: 16px; height: 16px; }
  .trail__video .trail__tag { right: var(--g-space-2xs); bottom: var(--g-space-2xs); font-size: .62rem; padding: .2rem .5rem; }
}
@media (max-width: 599px) {
  .trail { --panel-h: 33rem; }
}

/* ---- One panel per section of the Topic page (seven since 2026-11-12) ---- */
.trail .lp-chap__head { margin-bottom: var(--g-space-lg); }
.trail__step { padding: .4rem .7rem; }
.trail__foot { margin: var(--g-space-md) 0 0; display: flex; align-items: center; justify-content: space-between; gap: var(--g-space-md); }

/* Essays —: the opening of the one chosen, set in the reading face */
.trail__essay { display: grid; gap: var(--g-space-sm); align-content: center; }
.trail__open { margin: 0; }
.trail__open p { margin: 0; font-family: var(--g-font-read); font-size: clamp(1rem, .9rem + .5vw, 1.3rem); line-height: 1.5; color: var(--g-text); }

/* Sources — as three stairs, the proof strip's own mark made large */
.trail__stairs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--g-space-xs); align-items: end; }
.trail__stairs > li { display: flex; flex-direction: column; gap: var(--g-space-2xs); padding: var(--g-space-sm); border: 1px solid var(--g-hairline); border-radius: var(--g-radius); background: var(--g-surface-sunken); }
.trail__stairs > li:nth-child(1) { min-height: 60%; }
.trail__stairs > li:nth-child(2) { min-height: 78%; }
.trail__stairs > li:nth-child(3) { min-height: 96%; border-color: var(--g-accent); }
.trail__stairs { height: 100%; }
.trail__lvl { margin: 0; display: grid; }
.trail__lvl b { font-size: var(--g-fs-body); }
.trail__lvl span { font-family: var(--g-font-mono); font-size: var(--g-fs-caption); color: var(--g-text-subtle); }
.trail__stairs ul { list-style: none; margin: auto 0 0; padding: 0; display: grid; gap: .35rem; }
.trail__stairs ul li { font-size: var(--g-fs-caption); color: var(--g-text-muted); line-height: var(--g-lh-snug); padding-top: .35rem; border-top: 1px solid var(--g-hairline); }

/* Timeline —, on one line */
.trail__time { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-content: center; position: relative; }
.trail__time::before { content: ""; position: absolute; left: 0; right: 0; top: 2.05rem; height: 1px; background: var(--g-hairline); }
.trail__time li { display: grid; grid-template-rows: auto auto auto; gap: var(--g-space-2xs); padding-right: var(--g-space-2xs); position: relative; }
.trail__time time { font-family: var(--g-font-mono); font-size: var(--g-fs-small); color: var(--g-text); }
.trail__time li::before { content: ""; order: 1; width: .55rem; height: .55rem; border-radius: 50%; background: var(--g-text-subtle); margin: .25rem 0; }
.trail__time span { order: 2; font-size: var(--g-fs-caption); color: var(--g-text-muted); line-height: var(--g-lh-snug); }
.trail__time li.is-key::before { background: var(--g-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--g-accent) 25%, transparent); }
.trail__time li.is-key time { color: var(--g-accent); }

/* Viewpoints — the two readings. Not site.css's .view: that one carries a
   coloured bar down its left edge, which the brand no longer uses. A reading
   is a sunken card; the label carries the accent. */
.trail__views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--g-space-md); align-content: center; }
.trail__view { display: flex; flex-direction: column; gap: var(--g-space-2xs); padding: var(--g-space-md); border: 1px solid var(--g-hairline); border-radius: var(--g-radius); background: var(--g-surface-sunken); }
.trail__view p { margin: 0; font-size: var(--g-fs-small); }
.trail__view .trail__view-k { font-size: var(--g-fs-eyebrow); font-weight: var(--g-w-medium); text-transform: uppercase; letter-spacing: var(--g-track-eyebrow); color: var(--g-accent); }
.trail__view cite { margin-top: auto; font-family: var(--g-font-mono); font-size: var(--g-fs-caption); font-style: normal; color: var(--g-text-subtle); }

/* Related — where the Topic leads. A proposed Topic has no page yet, so it
   is a row without a link. */
.trail__next { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--g-space-xs); align-content: center; }
.trail__next li > a, .trail__next li > span {
  display: grid; gap: .2rem; padding: var(--g-space-sm) var(--g-space-md);
  border: 1px solid var(--g-hairline); border-radius: var(--g-radius); background: var(--g-surface-sunken);
  color: var(--g-text); text-decoration: none;
  transition: border-color var(--g-dur) var(--g-ease-orbit), background-color var(--g-dur) var(--g-ease-orbit);
}
.trail__next li > a:hover { border-color: var(--g-border-strong); background: var(--g-surface-hover); }
.trail__next small { font-size: var(--g-fs-eyebrow); text-transform: uppercase; letter-spacing: var(--g-track-eyebrow); color: var(--g-text-subtle); }
.trail__next b { font-weight: var(--g-w-semibold); }
/* A card whose Topic is not open yet carries the PLANNED pill, centred on the
   card's right edge, and keeps its own background on hover (.is-soon:hover
   would otherwise inherit the list's transparent one). */
.trail__next li > .is-soon { position: relative; padding-right: calc(var(--g-space-md) + 6.5rem); }
.trail__next li > .is-soon:hover { background: var(--g-surface-sunken); }
.trail__next .is-soon .soon-chip { top: 50%; right: var(--g-space-md); transform: translateY(-50%); }

/* Discussion — this week's question, set large */
.trail__q { margin: 0; }
.trail__q p { margin: 0; font-family: var(--g-font-read); font-size: clamp(1.25rem, 1rem + 1.2vw, 2rem); line-height: 1.35; color: var(--g-text); text-wrap: balance; }

@media (max-width: 899px) {
  .trail__time { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
  .trail__time::before { display: none; }
  .trail__time li { grid-template-columns: 3rem .55rem minmax(0, 1fr); grid-template-rows: none; align-items: center; gap: var(--g-space-xs); }
  .trail__time li::before { order: 0; margin: 0; grid-column: 2; grid-row: 1; }
  .trail__time time { grid-column: 1; grid-row: 1; }
  .trail__time span { grid-column: 3; grid-row: 1; }
  .trail__views { grid-template-columns: minmax(0, 1fr); gap: var(--g-space-xs); }
  .trail__view { padding: var(--g-space-sm); }
  .trail__view cite { display: none; }
  .trail__stairs { grid-template-columns: minmax(0, 1fr); height: auto; }
  .trail__stairs > li { min-height: 0 !important; }
  .trail__stairs ul li:nth-child(2) { display: none; }
  .trail__open p { font-size: 1rem; }
  .trail__q p { font-size: 1.25rem; }
}

/* Timeline geometry, fixed so every dot sits on the line whatever the label
   wraps to: year 1.25rem tall, a .5rem gap, then the .55rem dot, so the line
   runs at 1.25 + .5 + .275 = 2.025rem. */
@media (min-width: 900px) {
  .trail__time li { display: flex; flex-direction: column; gap: .5rem; }
  .trail__time time { order: 0; line-height: 1.25rem; }
  .trail__time li::before { order: 1; margin: 0; flex: none; }
  .trail__time span { order: 2; }
  .trail__time::before { top: 2.025rem; }
}
/* Phones: the timeline keeps four of its seven dates, and each reading keeps
   four lines; both panels link to the whole thing on the Topic page. */
@media (max-width: 599px) {
  .trail__time li:nth-child(2), .trail__time li:nth-child(3), .trail__time li:nth-child(5) { display: none; }
  .trail__view p:not(.trail__view-k) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
}
@media (max-width: 599px) {
  .trail__stairs { gap: .4rem; }
  .trail__stairs > li { padding: .55rem .75rem; }
  .trail__stairs ul { display: none; }
  .trail__view p:not(.trail__view-k) { -webkit-line-clamp: 3; }
  .trail__view .trail__view-k { margin: 0; }
}

/* ---- A panel holding several videos or essays (2026-11-09) ---------------
   One panel and one step however many there are: a rail with a panel per video
   grows without limit and buries everything after the videos. The list sits in
   the side column, in the same hairline rows the layer list uses. The current row is marked by weight
   and the accent on its number, not by a box. The rail is a trailer for the
   Topic, so four rows is the budget (three on a phone) and the last row links
   to the rest. */
.trail__set { list-style: none; margin: var(--g-space-sm) 0 0; padding: 0; border-top: 1px solid var(--g-hairline); }
.trail__set li { border-bottom: 1px solid var(--g-hairline); }
.trail__set li:nth-child(n + 5):not(.trail__set-more) { display: none; }
.trail__set a, .trail__set .trail__set-off {
  display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: var(--g-space-2xs);
  align-items: baseline; padding: .4rem 0;
  font-size: var(--g-fs-caption); color: var(--g-text-muted); text-decoration: none;
  transition: color var(--g-dur) var(--g-ease-orbit);
}
.trail__set a:hover { color: var(--g-text); }
.trail__set .trail__set-off { cursor: default; color: var(--g-text-subtle); }  /* planned video: listed, not tappable */
.trail__set a:focus-visible { outline: 2px solid var(--g-focus); outline-offset: 2px; }
.trail__set-n, .trail__set time { font-family: var(--g-font-mono); color: var(--g-text-subtle); }
.trail__set-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trail__set a[aria-current="true"] { color: var(--g-text); font-weight: var(--g-w-semibold); }
.trail__set a[aria-current="true"] .trail__set-n { color: var(--g-accent); }
.trail__set-more a { display: inline-flex; gap: .4em; font-weight: var(--g-w-medium); color: var(--g-accent); }
.trail__panel[data-rail-set] .trail__say { -webkit-line-clamp: 2; }
@media (max-width: 899px) {
  .trail__set li:nth-child(n + 4):not(.trail__set-more) { display: none; }
  .trail__panel[data-rail-set] .trail__say { display: none; }
}
/* Stacked at tablet width the poster shares a fixed panel with the list, so it
   takes a width whose 16:9 height fits what is left. */
@media (min-width: 600px) and (max-width: 899px) {
  .trail__panel[data-rail-set] .trail__video { width: min(100%, 30rem); align-self: center; }
}

/* The list must not move when a row is chosen. A panel's title and line change
   length with the item, so the list cannot be placed after them. On the wide
   layout it hangs from the floor of the column, above the button, and the text
   above is capped so it always fits. Stacked, where the column has no floor of
   its own, the title and line keep a fixed height instead. */
.trail__panel[data-rail-set] .trail__side h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.trail__panel[data-rail-set] .trail__say { line-height: 1.5; }
@media (max-width: 899px) {
  .trail__panel[data-rail-set] .trail__side h3 { min-height: 2.4em; }
}
@media (min-width: 900px) {
  .trail__panel[data-rail-set] .trail__side h3 { -webkit-line-clamp: 3; }
  .trail__panel[data-rail-set] .trail__set { margin-top: auto; }
  .trail__panel[data-rail-set] .trail__act { margin-top: 0; }
}
/* A short laptop screen gives the panel less than its full height (--panel-h
   starts to shrink below 776px), so the title takes two lines and the line
   steps out, and the column still fits with the list on its floor. */
@media (min-width: 900px) and (max-height: 775px) {
  .trail__panel[data-rail-set] .trail__side h3 { -webkit-line-clamp: 2; }
  .trail__panel[data-rail-set] .trail__say { display: none; }
}

/* A video not out yet keeps its row in the set, with the PLANNED pill at its
   end (2026-11-22). */
.trail__set .trail__set-soon { position: static; transform: none; margin-left: auto; flex: none; }

/* Overview on a phone and a tablet (review of 2026-11-23): the panel is a
   fixed height, and the teaser under a three-line lead left half of it
   empty. The teaser leads instead, and the description gets the room under
   it. On a phone the tag is the runtime alone. */
@media (max-width: 899px) {
  .trail__panel[data-t1-panel="overview"] .trail__body { order: -1; justify-content: flex-start; }
  .trail__panel[data-t1-panel="overview"] .trail__side { padding-bottom: 0; border-bottom: 0; padding-top: var(--g-space-sm); }
  .trail__panel[data-t1-panel="overview"] .trail__say { -webkit-line-clamp: 9; line-height: 1.55; }
}
@media (max-width: 599px) {
  .trail__panel[data-t1-panel="overview"] .trail__tag-k { display: none; }
}

/* Phone and tablet (review of 2026-11-23): a declared height left most
   panels ending in an empty block, Timeline and Overview worst. Below 900px
   a panel is as tall as its content, and topic-rail.js gives the rail the
   height of the panel in view, easing between them. The neighbour peeking
   at the edge is cut at that height. */
@media (max-width: 899px) {
  .trail__rail { align-items: flex-start; overflow-y: hidden; transition: height var(--g-dur-slow) var(--g-ease-orbit); }
  .trail__panel { height: auto; grid-template-rows: auto auto; }
  .trail__body { justify-content: flex-start; }
}
@media (max-width: 899px) and (prefers-reduced-motion: reduce) {
  .trail__rail { transition: none; }
}
