/* Home: the surgeons he trained, played as time. Owned by the lineage section agent (homepage 100x, 2026-09-23).
   Home only. Teaching keeps its own chart (site.css .lineage__*, assets/js/lineage.js); every rule here
   uses the new .lineage-* classes, so nothing reaches Teaching or the old markup in other copies.

   Layers inside the chart, bottom to top: era bands (their fill grows behind the playhead), the
   playhead line, one mark per fellow, the floating readout. The flag and the knob ride the playhead. */

/* The head: the headline leads on the left; the one control and the key answer it on the right */
.lineage-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem 3rem; flex-wrap: wrap; }
.lineage-intro { flex: 1 1 26rem; }
.lineage-intro .lede { margin-top: 1rem; }

.lineage-stage { margin-top: clamp(1.25rem, 2.5vw, 2rem); }
.lineage-stage[hidden] { display: none; }

.lineage-bar { display: flex; flex-direction: column; align-items: flex-end; gap: 0.9rem; }
.lineage-bar[hidden] { display: none; }
.lineage-play { gap: 0.6rem; min-height: 44px; min-width: 10.4rem; justify-content: center; padding: 0.7rem 1.2rem 0.7rem 1rem; }
.lineage-play__glyph { flex: none; fill: currentColor; }
.lineage-play .lineage-g-pause, .lineage-play .lineage-g-again { display: none; }
.lineage-play[data-lineage-state="pause"] .lineage-g-play, .lineage-play[data-lineage-state="again"] .lineage-g-play { display: none; }
.lineage-play[data-lineage-state="pause"] .lineage-g-pause, .lineage-play[data-lineage-state="again"] .lineage-g-again { display: inline; }
.lineage-key { display: flex; gap: 1.25rem; font-size: 0.9rem; color: var(--muted); }
.lineage-key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.45rem; vertical-align: -0.5px; background: var(--ink-2); }
.lineage-key i.is-r { background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink-2); }

/* The chart. pan-y: a vertical swipe still scrolls the page, a sideways drag scrubs the years. */
.lineage-chart {
  --flag-h: 2.75rem;
  position: relative; margin-top: 1.1rem; padding-top: var(--flag-h);
  touch-action: pan-y pinch-zoom; -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.lineage-field { --s: 12px; position: relative; height: 250px; cursor: pointer; }

/* Era bands: the lit part runs up to the playhead */
.lineage-band { position: absolute; top: 0; bottom: 0; border-radius: 6px 6px 0 0; overflow: hidden; }
.lineage-band__fill { position: absolute; inset: 0; background: var(--mist); transform-origin: 0 50%; transform: scaleX(0); }
.lineage-band.is-alt .lineage-band__fill { background: var(--mist-2); }
.lineage-band__label {
  position: absolute; top: 0.65rem; left: 0.75rem; white-space: nowrap;
  font-family: var(--label); font-weight: 600; font-size: 0.84rem; line-height: 1.2; color: var(--muted);
  opacity: 0; translate: 0 6px; transition: opacity 0.5s var(--ease-out), translate 0.6s var(--ease-out);
}
.lineage-band.is-alt .lineage-band__label { color: var(--ink-2); }
.lineage-band.is-reached .lineage-band__label { opacity: 1; translate: 0 0; }
.lineage-band.is-reached .lineage-band__label.is-under { opacity: 0.16; transition-duration: 0.25s; }
.lineage-band__label .lineage-band__short { display: none; }
.lineage-band.is-short .lineage-band__label .lineage-band__long { display: none; }
.lineage-band.is-short .lineage-band__label .lineage-band__short { display: inline; }
/* the era before a move names itself at its right end, so the two labels flank the seam */
.lineage-band--lead .lineage-band__label { left: auto; right: 1.75rem; text-align: right; }
/* both labels stand back from the seam by more than half a year, so the playhead at 2013 or 2014
   (where the play slows for the move) never runs through them */
.lineage-band:not(.lineage-band--lead) .lineage-band__label { left: 1.75rem; }

/* The lineage: an arc from his own fellowship to each fellow. A whisper at rest, the chosen class
   stronger, one person in full. Each arc draws itself out to its fellow as they arrive. */
.lineage-arcs { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.lineage-arcs path {
  fill: none; stroke: var(--accent); stroke-width: 1; stroke-linecap: round; opacity: 0.09;
  stroke-dasharray: 1 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.25s var(--ease-out), opacity 0.35s, stroke-width 0.2s;
}
.lineage-arcs path.is-in { stroke-dashoffset: 0; transition: stroke-dashoffset 0.9s var(--ease-out) calc(var(--k, 0) * 24ms), opacity 0.35s, stroke-width 0.2s; }
.lineage-arcs path.is-sel { opacity: 0.42; }
.lineage-arcs path.is-hot { opacity: 1; stroke-width: 1.6; }

/* The running total, set in the empty sky above the early years */
.lineage-tally {
  position: absolute; z-index: 3; left: 0.75rem; top: calc(var(--flag-h) + 2.3rem); margin: 0;
  display: grid; pointer-events: none;
}
.lineage-tally__n {
  font-family: var(--display); font-weight: 600; font-size: clamp(3.6rem, 7.4vw, 6.6rem); line-height: 0.8;
  letter-spacing: -0.035em; color: var(--ink); font-variant-numeric: lining-nums tabular-nums;
}
.lineage-tally__cap { margin-top: 0.55rem; font-family: var(--label); font-weight: 600; font-size: 0.95rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Where the line starts: his own fellowship */
.lineage-root { position: absolute; bottom: 16px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); z-index: 2; }
.lineage-root::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--ink); }
.lineage-root { transition: scale 0.35s var(--ease-spring), background 0.2s; }
.lineage-root.is-hot { scale: 1.35; background: var(--lightbox); }

/* One mark per fellow. The element holds the slot (a faint ring until the fellow arrives);
   ::after is the mark itself, which drops into the slot when the playhead reaches its year. */
.lineage-dot { position: absolute; width: var(--s); height: var(--s); margin-left: calc(var(--s) / -2); border-radius: 50%; z-index: 2; }
.lineage-dot::before, .lineage-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; }
.lineage-dot::before { box-shadow: inset 0 0 0 1px var(--line-2); transition: opacity 0.3s; }
.lineage-dot::after {
  background: var(--ink-2); opacity: 0; translate: 0 -30px; scale: 0.5;
  transition: opacity 0.22s var(--ease-out), translate 0.6s var(--ease-spring), scale 0.45s var(--ease-spring), background 0.25s, box-shadow 0.25s;
}
.lineage-dot.is-in::before { opacity: 0; }
.lineage-dot.is-in::after { opacity: 1; translate: 0 0; scale: 1; transition-delay: calc(var(--k, 0) * 24ms); }
.lineage-dot.is-r::after { background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink-2); }
.lineage-dot.is-sel::after { background: var(--accent); scale: 1.15; box-shadow: 0 2px 5px color-mix(in srgb, var(--accent-deep) 35%, transparent); }
.lineage-dot.is-r.is-sel::after { background: var(--paper); box-shadow: inset 0 0 0 2px var(--accent), 0 2px 5px color-mix(in srgb, var(--accent-deep) 35%, transparent); }
.lineage-dot.is-hot { z-index: 4; }
.lineage-dot.is-in.is-hot::after { background: var(--lightbox); box-shadow: inset 0 0 0 2px var(--ink), var(--shadow-1); scale: 1.7; transition-delay: 0s; }

/* The playhead: a hairline from the flag down to the top of the chosen year's stack */
.lineage-now { position: absolute; top: -0.55rem; bottom: 0; left: 0; width: 1px; margin-left: -0.5px; background: var(--ink); z-index: 1; transform-origin: 50% 0; will-change: transform; }
.lineage-flag { position: absolute; top: 0; left: 0; z-index: 3; will-change: transform; }
.lineage-flag span {
  position: relative; display: block; min-width: 3.6rem; padding: 0.32rem 0.6rem; text-align: center;
  font-family: var(--label); font-weight: 700; font-size: 0.98rem; line-height: 1.2; color: var(--ink);
  background: var(--lightbox); border-radius: var(--r-btn); box-shadow: var(--shadow-1); font-variant-numeric: tabular-nums;
}
/* the notch points at the playhead even when the flag is held inside the chart at either end */
.lineage-flag span::after { content: ''; position: absolute; left: var(--notch, 50%); bottom: -4px; width: 9px; height: 9px; margin-left: -4.5px; background: var(--lightbox); transform: rotate(45deg); border-radius: 0 0 2px 0; }

/* The preview: where a click would take the playhead (fine pointers only; JS never shows it on touch) */
.lineage-peek { position: absolute; top: 0; left: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 0.18s; will-change: transform; }
.lineage-peek.is-on { opacity: 1; }
.lineage-peek span {
  display: block; min-width: 3.6rem; padding: calc(0.32rem - 1px) 0.55rem; text-align: center; white-space: nowrap;
  font-family: var(--label); font-weight: 600; font-size: 0.9rem; line-height: 1.2; color: var(--muted);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-btn); font-variant-numeric: tabular-nums;
}
.lineage-peek::after {
  content: ''; position: absolute; top: 100%; left: var(--notch, 50%); width: 0; margin-left: -0.5px;
  height: calc(var(--flag-h) + var(--field-h, 250px) - 100%); border-left: 1px dashed var(--line-2);
}

/* The floating readout for one person */
.lineage-tip {
  position: absolute; left: 0; top: 0; z-index: 6; width: max-content; max-width: 17rem;
  padding: 0.6rem 0.85rem 0.65rem; background: var(--paper); border-radius: var(--r-photo); box-shadow: var(--shadow-2);
  pointer-events: none; opacity: 0; transition: opacity 0.18s var(--ease-out);
}
.lineage-tip.is-on { opacity: 1; transition: opacity 0.18s var(--ease-out), transform 0.26s var(--ease-out); }
.lineage-tip__n { display: block; font-family: var(--display); font-weight: 600; font-size: 1.08rem; line-height: 1.2; color: var(--ink); }
.lineage-tip__y { display: block; margin-top: 0.2rem; font-family: var(--label); font-weight: 600; font-size: 0.88rem; line-height: 1.3; color: var(--accent); }
.lineage-tip__e { display: block; font-size: 0.84rem; line-height: 1.35; color: var(--muted); }

/* The axis is the scrubber: one tab stop, a 48px strip, the knob rides the playhead */
.lineage-scrub { position: relative; height: 3rem; border-top: 1px solid var(--line-2); cursor: pointer; }
.lineage-scrub:focus-visible { outline: none; }
.lineage-tick { position: absolute; top: 0; width: 1px; height: 5px; margin-left: -0.5px; background: var(--line-2); }
.lineage-tick.is-decade { height: 9px; background: var(--muted); }
.lineage-yl { position: absolute; top: 0.85rem; translate: -50% 0; font-family: var(--label); font-weight: 600; font-size: 0.85rem; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.lineage-yl--root { translate: 0 0; color: var(--ink-2); }
.lineage-yl--root span { display: block; font-weight: 500; color: var(--muted); }
/* The knob element only rides the playhead (transform); its disc is ::before, so scaling the disc
   never scales the ride (the scale property composes outside transform). */
.lineage-knob { position: absolute; top: -1px; left: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; z-index: 2; will-change: transform; }
.lineage-knob::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink), var(--shadow-1);
  transition: scale 0.3s var(--ease-spring), background 0.2s;
}
.lineage-scrub:focus-visible .lineage-knob { outline: 2px solid var(--accent); outline-offset: 3px; }
.lineage-scrub:hover .lineage-knob::before { scale: 1.12; }
.lineage-chart.is-dragging .lineage-knob::before { scale: 1.3; background: var(--lightbox); }
.lineage-chart.is-dragging .lineage-field, .lineage-chart.is-dragging .lineage-scrub { cursor: grabbing; }

/* The class of the chosen year */
.lineage-cohort {
  margin-top: clamp(1.4rem, 3vw, 2.1rem); display: grid; grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  gap: 1.1rem clamp(1.5rem, 4vw, 3.5rem); align-items: start;
}
.lineage-cohort__nav { display: flex; align-items: center; gap: 0.4rem; }
.lineage-cohort__year { min-width: 4.2ch; text-align: center; font-family: var(--label); font-weight: 700; font-size: clamp(2.1rem, 3.2vw, 2.7rem); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums lining-nums; }
.lineage-step {
  position: relative; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-btn);
  background: var(--paper); cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.35s var(--ease-spring);
}
.lineage-step::before { content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border: solid var(--ink); border-width: 0 0 2px 2px; transform: translate(-25%, -50%) rotate(45deg); }
.lineage-step--next::before { border-width: 2px 2px 0 0; transform: translate(-75%, -50%) rotate(45deg); }
.lineage-step:hover { border-color: var(--ink); }
.lineage-step:active { transform: scale(0.94); }
.lineage-step[aria-disabled="true"] { opacity: 0.35; cursor: default; border-color: var(--line-2); }
.lineage-step[aria-disabled="true"]:active { transform: none; }
.lineage-cohort__meta { margin: 0.75rem 0 0; display: grid; gap: 0.1rem; }
.lineage-cohort__count { font-family: var(--display); font-weight: 600; font-size: 1.3rem; line-height: 1.3; color: var(--ink); font-variant-numeric: lining-nums; }
.lineage-cohort__era { font-size: 0.95rem; line-height: 1.4; color: var(--muted); }

.lineage-names { list-style: none; margin: 0; padding: 0; columns: 3 13rem; column-gap: 1.25rem; min-height: 6.6rem; }
.lineage-names li { break-inside: avoid; }
.lineage-name {
  display: flex; align-items: baseline; gap: 0.55rem; width: 100%; padding: 0.3rem 0.45rem; border: 0; border-radius: var(--r-btn);
  background: none; text-align: left; cursor: pointer; line-height: 1.4; transition: background 0.2s;
}
.lineage-name:hover, .lineage-name.is-hot { background: var(--accent-tint); }
.lineage-name i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); translate: 0 -1px; }
.lineage-name i.is-r { background: var(--paper); box-shadow: inset 0 0 0 2px var(--accent); }
.lineage-name__n { font-weight: 500; color: var(--ink); }
.lineage-name__d { font-size: 0.86rem; color: var(--muted); }
.lineage-name__r { font-family: var(--label); font-weight: 600; font-size: 0.8rem; color: var(--accent); }
.lineage-name__y { font-family: var(--label); font-weight: 600; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.lineage-names__note { color: var(--muted); max-width: 44ch; }

/* When a person changes the year, the class arrives from the direction of travel */
@keyframes lineage-year-on { from { opacity: 0; translate: 14px 0; } }
@keyframes lineage-year-back { from { opacity: 0; translate: -14px 0; } }
@keyframes lineage-name-in { from { opacity: 0; translate: 0 6px; } }
.lineage-cohort.is-swap[data-lineage-dir="on"] .lineage-cohort__year { animation: lineage-year-on 0.38s var(--ease-out); }
.lineage-cohort.is-swap[data-lineage-dir="back"] .lineage-cohort__year { animation: lineage-year-back 0.38s var(--ease-out); }
.lineage-cohort.is-swap .lineage-cohort__meta { animation: lineage-name-in 0.38s var(--ease-out); }
.lineage-cohort.is-swap .lineage-names li { animation: lineage-name-in 0.42s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 22ms); }

.lineage-foot { margin-top: clamp(1.5rem, 3vw, 2.2rem); display: flex; justify-content: flex-end; }

.lineage-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .lineage-cohort { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .lineage-field { --s: 8px; }
  .lineage-dot.is-r::after { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
  .lineage-dot.is-r.is-sel::after { box-shadow: inset 0 0 0 1.5px var(--accent); }
  .lineage-band__label { left: 0.45rem; font-size: 0.76rem; }
  .lineage-band--lead .lineage-band__label { left: auto; right: 0.6rem; }
  .lineage-band:not(.lineage-band--lead) .lineage-band__label { left: 0.6rem; }
  .lineage-root { width: 11px; height: 11px; margin-left: -5.5px; }
  .lineage-root::after { inset: 3px; }
  .lineage-yl { font-size: 0.78rem; }
  .lineage-tip { max-width: 13rem; padding: 0.45rem 0.65rem 0.5rem; }
  .lineage-tip__n { font-size: 0.96rem; }
  .lineage-tip__y { font-size: 0.8rem; }
  .lineage-tip__e { font-size: 0.78rem; }
  .lineage-names { columns: 2 9rem; column-gap: 0.75rem; }
  .lineage-name { gap: 0.45rem; padding-inline: 0.3rem; font-size: 0.95rem; }
  .lineage-name__d, .lineage-name__y, .lineage-name__r { font-size: 0.78rem; }

}
/* phones: the total sits in the bar, beside the play control; the key takes its own line */
@media (max-width: 600px) {
  .lineage-bar { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: end; justify-content: space-between; }
  .lineage-bar .lineage-tally { position: static; }
  .lineage-bar .lineage-tally__n { font-size: 3.6rem; }
  .lineage-bar .lineage-tally__cap { margin-top: 0.45rem; font-size: 0.86rem; }
  .lineage-bar .lineage-play { order: 1; }
  .lineage-bar .lineage-key { order: 2; flex-basis: 100%; }
}
@media (pointer: coarse) {
  .lineage-name { min-height: 44px; padding-block: 0.62rem; }
}
/* the foot link keeps its drawn underline tight to the text but gets a 44px target */
.lineage-foot .link { position: relative; }
.lineage-foot .link::before { content: ''; position: absolute; inset: -12px -10px; }
