/* The home page as a road (branch `panda-walk`, 2026-09-21) — a CV read as a
 * timeline, after mikes.road, with the hat panda where Mike has the aeroplane.
 *
 * One panda on screen. It opens large on the first screen, and as the reader
 * scrolls it shrinks onto the spine and walks the road beside them
 * (assets/home/panda-walk.js). Everything else is type on a near-white ground.
 *
 * Loaded by index.qmd only, and every rule is scoped under `.road`, so nothing
 * here can reach a post. The selectors carry `#quarto-content main.content`
 * because the site's prose rules do, and an id outranks any amount of class. */

/* The ground is the site's stone paper, untouched: the first build stepped up
 * to a near-white after Mike's page, and it made this the one page that did
 * not match (2026-09-22). Stone is also kinder to the panda, whose fur is pure
 * white. Type follows the posts' system throughout: Nunito in the site's four
 * weights, ink / secondary / tertiary in their usual ranks, prose at 1.7, and
 * labels in the filing voice. Mono is the numbering system and nothing else,
 * so here it sets the year stamps only. */
body:has(.road) {
  --road-column: 34.824rem;  /* the reading column beside the spine: the posts'
                                own text column (592px at calibration), so home
                                and a post share both edges (2026-09-23) */
  --road-gutter: 8.6rem;     /* room left of the spine for the year stamps */
  --road-spine-gap: 2.7rem;  /* spine to text: the walker's half-width, plus air */
  --road-cell: 48px;         /* the sheet is drawn at one sprite unit per CSS pixel */
  --road-marker-scale: 2;    /* the walker on the road: 2x, whole pixels (read by panda-walk.js) */
  --road-hero-cell: 288px;   /* the hero panda: exactly 6x, so pixels stay square */
}

/* The filing voice, as .hero-links and the post controls speak it. */
#quarto-content main.content .road-tag,
#quarto-content main.content .road-label,
#quarto-content main.content .road-more > summary,
#quarto-content main.content .road-when small {
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* styles.scss says these of body:has(.hero-screen); this page does not carry
   that class (see index.qmd), so it says them for itself. */
body:has(.road) main.content { padding-inline: 0; }
body:has(.road) #title-block-header { display: none; }

.road {
  position: relative;
  padding: 0 clamp(1.25rem, 5vw, 2rem) 9rem;
}

/* ---- the first screen ---- */

.road-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(4.5rem, 11svh, 8rem);
}

/* The hero panda's reserved box. The panda itself is the walker, parked here
 * by the script; with no script (or reduced motion) a static copy is drawn in. */
.road-stage {
  width: var(--road-hero-cell);
  height: var(--road-hero-cell);
  position: relative;
}

/* the name: set exactly as a post sets its title */
#quarto-content main.content .road-ident {
  margin: 1.2rem 0 0;
  text-align: center;
  font-size: 1.6rem;         /* the post title's size, weight and tracking */
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.22;
  color: var(--gray-1200);
}

#quarto-content main.content .road-title {
  margin: 0.35rem 0 0;
  max-width: 30rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 550;
  line-height: 1.5;
  color: var(--gray-1200);
  text-wrap: balance;
}
#quarto-content main.content .road-title span { display: block; }

#quarto-content main.content .road-now {
  margin: 0.5rem 0 0;
  max-width: 31rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--gray-1100);
  text-wrap: pretty;
}

/* ---- the road ---- */

.road-track {
  position: relative;
  width: min(100%, calc(var(--road-column) + 2 * var(--road-gutter)));
  margin: 5.4rem auto 0;
  /* the text column sits on the page axis, where a post's does; the year
     stamps hang in the gutter to its left, as a post's section numerals do.
     The gutter is mirrored on the right only so the centring holds: when the
     window is too narrow for both, the column gives, never the stamps */
  padding-inline: var(--road-gutter);
}

/* the eras share one spine: a dotted rule the panda walks, from the first node
   down to the end-of-road mark */
.road-eras { position: relative; }
.road-spine {
  position: absolute;
  top: 0.75rem;
  bottom: -0.95rem;
  left: calc(var(--road-spine-gap) * -1);
  width: 0;
  border-left: 1px dotted var(--gray-800);
}

#quarto-content main.content .road-label {
  position: absolute;
  top: -3.7rem; /* clear of the panda's hat when it lands on the first node */
  left: calc(var(--road-spine-gap) * -1);
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.625rem;
  color: var(--accent-ink);
  white-space: nowrap;
}

.road-era {
  position: relative;
  padding-bottom: 3.4rem;
}

/* the node on the spine; filled once the panda has walked past it */
.road-era::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  left: calc(var(--road-spine-gap) * -1);
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 1px solid var(--gray-800);
  box-shadow: 0 0 0 3px var(--gray-100);
}
.road-era.is-passed::before {
  background: var(--gray-1200);
  border-color: var(--gray-1200);
}

#quarto-content main.content .road-when {
  position: absolute;
  top: 0.08rem;
  right: calc(100% + var(--road-spine-gap) + 2.7rem); /* clear of the walker's half-width */
  margin: 0;
  text-align: right;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  line-height: 1.25;
  letter-spacing: 0.14em;
  color: var(--gray-1000);
  white-space: nowrap;
}
#quarto-content main.content .road-when small {
  display: block;
  font-size: 0.5625rem;
  color: var(--gray-900);
}

#quarto-content main.content .road-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--gray-1200);
}
#quarto-content main.content .road-name .road-tag {
  margin-left: 0.5rem;
  font-size: 0.6875rem;
  color: var(--accent-ink);
}
#quarto-content main.content .road-role {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--gray-1200);
}
#quarto-content main.content .road-what {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--gray-1100);
  text-wrap: pretty;
}

/* ---- the work under an era ---- */

#quarto-content main.content .road-work {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}
#quarto-content main.content .road-work li {
  position: relative;
  margin: 0 0 1.35rem;
  padding: 0;
}
#quarto-content main.content .road-work li:last-child { margin-bottom: 0; }

/* the small tick each piece of work leaves on the spine */
#quarto-content main.content .road-work li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--road-spine-gap) * -1);
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background: var(--gray-800);
  box-shadow: 0 0 0 3px var(--gray-100);
}

#quarto-content main.content .road-work a,
#quarto-content main.content .road-work .road-unlinked {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 0 0.9rem;
  align-items: center;
  margin: 0 -0.6rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
#quarto-content main.content .road-work a:hover,
#quarto-content main.content .road-work a:focus-visible {
  background: var(--hover-fill);
}

.road-thumb {
  grid-row: 1 / span 2;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 6px;
  border: 1px solid var(--gray-400);
  background: #fff;
  object-fit: cover;
  cursor: inherit;
}
/* a piece of work with no figure of its own: a blank plate, not a fake one */
.road-thumb.is-blank {
  display: block;
  background:
    repeating-linear-gradient(135deg, transparent 0 5px, var(--gray-300) 5px 6px),
    var(--gray-100);
}

#quarto-content main.content .road-work strong {
  display: block;
  align-self: end;
  font-size: var(--text-apparatus);
  font-weight: 550;
  line-height: 1.4;
  color: var(--gray-1200);
}
#quarto-content main.content .road-work em {
  display: block;
  align-self: start;
  font-style: normal;
  font-size: var(--text-apparatus-mono);
  line-height: 1.4;
  color: var(--gray-1000);
}

/* the rest of an era's work, folded away: a native disclosure, so it works
   with no script and the walker simply re-measures the longer road */
#quarto-content main.content .road-more { margin-top: 1.1rem; }
#quarto-content main.content .road-more > summary {
  display: inline-block;
  list-style: none;
  cursor: pointer;
  font-size: var(--text-filing);
  color: var(--gray-1000);
}
#quarto-content main.content .road-more > summary::-webkit-details-marker { display: none; }
#quarto-content main.content .road-more > summary::after { content: " +"; }
#quarto-content main.content .road-more[open] > summary::after { content: " \2212"; }
#quarto-content main.content .road-more > summary:hover,
#quarto-content main.content .road-more > summary:focus-visible { color: var(--accent-ink); }
#quarto-content main.content .road-more > .road-work { margin-top: 1.1rem; }

/* ---- the end of the road ---- */

.road-end {
  position: relative;
  padding-top: 0.4rem;
}
/* the end-of-road mark, where the panda sits down */
.road-end::before {
  content: "";
  position: absolute;
  top: 0.95rem;
  left: calc(var(--road-spine-gap) * -1);
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-right: 1px solid var(--gray-900);
  border-bottom: 1px solid var(--gray-900);
  transform: rotate(45deg) translate(-2px, -2px);
}
#quarto-content main.content .road-end p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-1200);
  font-weight: 500;
}
#quarto-content main.content .road-end p + p {
  font-weight: 400;
  font-size: var(--text-apparatus);
  color: var(--gray-1000);
}

/* ---- the walker ---- */

.road-walker {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--road-cell);
  height: var(--road-cell);
  overflow: hidden;
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform;
  z-index: 2;
}
.road-walker.is-flipped .road-sheet-flip { transform: scaleX(-1); }
/* walking, it is pinned to the screen: the browser holds it still through a fast
   scroll instead of the script chasing it (see panda-walk.js) */
.road-walker.is-riding { position: fixed; }

/* the lids: eight face-white pixels over the eyes, shown for one beat of a blink */
.road-blink {
  position: absolute;
  inset: 0;
}
.road-blink[hidden] { display: none; }
.road-blink svg {
  display: block;
  width: 100%;
  height: 100%;
  shape-rendering: crispEdges;
}

/* parked on the first screen, it breathes (the engine's own idle bob) */
@keyframes road-breathe {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-0.5px); }
}
@media (prefers-reduced-motion: no-preference) {
  .road-walker.is-parked .road-sheet-flip { animation: road-breathe 2.6s ease-in-out infinite; }
}
.road-stage img { display: block; width: 100%; height: 100%; cursor: default; }
/* Clipped HERE as well as on the walker, and it is load-bearing on iPhones.
 * The breathing animation gives this box its own compositing layer, and a layer
 * is as big as everything it paints: unclipped, that is the whole 624 x 240
 * sheet, which at the hero's 4x and a phone's 3x pixel ratio is a ~7500 x 2900
 * bitmap. iOS Safari declines to draw a layer that size, so the parked panda
 * was invisible on real phones (fine in desktop emulation, whose GPU allows
 * it) and reappeared on the road, where the animation stops. Clipped, the
 * layer is one 48 x 48 cel. */
.road-sheet-flip {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.road-sheet {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(13 * var(--road-cell));
  height: calc(5 * var(--road-cell));
}
.road-sheet svg {
  display: block;
  fill: #21201c;
  shape-rendering: crispEdges;
}

/* the hat, set down beside the panda when it rests at the end of the road */
.road-hat {
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 14px;
  transform-origin: 0 0;
  pointer-events: none;
  z-index: 2;
}
.road-hat svg {
  display: block;
  width: 100%;
  height: 100%;
  shape-rendering: crispEdges;
}

/* ---- the foot ---- */

/* The link bar is the site's (styles.scss, .site-foot). Here it only stays
   pinned rather than fading while the reader scrolls: the road is walked, not
   read, and the bar is how the walk ends. */

/* The colophon whisper stays, clear of the fixed foot. */
body:has(.road) .site-colophon { margin-bottom: 6rem; }

/* ---- narrow screens: the year stamps come in over the entry ---- */

@media (max-width: 760px) {
  body:has(.road) {
    --road-gutter: 2.6rem;
    --road-spine-gap: 1.1rem;
    --road-marker-scale: 1;  /* no room beside the spine for a 2x walker */
    --road-hero-cell: 192px; /* 4x */
  }
  .road-hero { padding-top: 2.5rem; }
  .road-track { padding-right: 0; }
  #quarto-content main.content .road-when {
    position: static;
    text-align: left;
    margin-bottom: 0.3rem;
  }
  #quarto-content main.content .road-when small {
    display: inline;
    margin-right: 0.5em;
    font-size: inherit;
    letter-spacing: inherit;
  }
  /* Pinned, the links wrap to two rows and hold a seventh of a phone screen
     over the road. At this width the foot is where it says: the end of the
     page, after the road, under the reader's thumb only when they get there. */
  body:has(.road) #quarto-content > .site-foot {
    position: static;
    padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px));
    background: none;
  }
  body:has(.road) .site-colophon { margin-bottom: 2.5rem; }
}
