/* Teaching, lineage: every fellow as a mark stacked at the year they arrived, a white plate that
   glides to the year under the pointer, a console that counts the lineage up to that year and names
   who arrived, and a ledger of every name by year that the chart and the search keep in step. */
.tlin {
  --travel: cubic-bezier(0.28, 0.11, 0.32, 1);
  --settle: cubic-bezier(0.32, 0.72, 0, 1);
  --m: 12px;          /* mark size */
  --step: 18px;       /* stack pitch */
}

/* ---------- head ---------- */
.tlin__head { display: flex; justify-content: space-between; align-items: end; gap: 1rem 3rem; flex-wrap: wrap; }
.tlin__key { display: flex; gap: 1.5rem; font-size: 0.9rem; color: var(--muted); }
.tlin__key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.45rem; vertical-align: -0.5px; background: var(--ink-2); }
.tlin__key i.r { background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink-2); }

/* ---------- chart ---------- */
.tlin__chart { margin-top: clamp(1.5rem, 3vw, 2.2rem); }
.tlin__plot {
  position: relative; isolation: isolate; height: 320px; cursor: crosshair;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.tlin__plot:focus { outline: none; }
.tlin__plot:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 18px; }
.tlin__plot::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line-2); z-index: 3; }

.tlin__era {
  position: absolute; top: 0; bottom: 0; z-index: -2; border-radius: 18px 18px 0 0; background: var(--mist);
  transition: background-color 0.4s var(--travel);
}
.tlin__era + .tlin__era { background: var(--mist-2); }
.tlin__era-lab {
  position: absolute; top: 0.85rem; left: 0.95rem; right: 0.6rem; display: grid; gap: 0.1rem;
  transition: opacity 0.4s var(--travel), translate 0.5s var(--settle);
}
.tlin__era-lab b { font-family: var(--display); font-weight: 600; font-size: 1.02rem; line-height: 1.2; color: var(--ink); }
.tlin__era-lab span { font-family: var(--label); font-weight: 500; font-size: 0.88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tlin__era-lab i { font-style: normal; }
.tlin__era-lab .s { display: none; }
.tlin[data-era] .tlin__era:not(.is-here) .tlin__era-lab { opacity: 0.45; }

/* the plate: a white column that glides to the year under the pointer */
.tlin__plate {
  position: absolute; top: 3.9rem; bottom: 0; left: 0; z-index: -1; width: var(--pw, 20px);
  transform: translateX(var(--px, 0px)); border-radius: 12px 12px 0 0; background: var(--paper);
  box-shadow: 0 1px 2px rgba(10, 13, 18, 0.06), 0 10px 26px -10px rgba(10, 13, 18, 0.22);
  opacity: 0; transition: transform 0.45s var(--travel), opacity 0.3s var(--travel);
}
.tlin.has-focus .tlin__plate { opacity: 1; }
.tlin.is-still .tlin__plate, .tlin.is-still .tlin__head-yr { transition: opacity 0.3s var(--travel); }

/* one mark per fellow: the outer node rides the stack, the ::before is the dot and takes the hover */
.tlin__mark {
  position: absolute; left: 0; bottom: 7px; width: var(--m); height: var(--m); margin-left: calc(var(--m) / -2);
  transform: translateY(calc(var(--k, 0) * var(--step) * -1));
  transition: transform 0.6s var(--settle) var(--d, 0ms), opacity 0.4s var(--travel) var(--d, 0ms);
  pointer-events: none;
}
.tlin__mark::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--ink-2);
  transition: transform 0.45s var(--settle), background-color 0.25s var(--travel), box-shadow 0.25s var(--travel);
}
.tlin__mark.is-r::before { background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink-2); }
.tlin.is-pre .tlin__mark::before { transform: scale(0); }
.tlin.is-entering .tlin__mark::before { transition-delay: var(--e, 0ms); }
/* the year in focus turns film blue; the one fellow in focus opens up in lightbox */
.tlin__mark.is-yr::before { background: var(--accent); transform: scale(1.15); }
.tlin__mark.is-yr.is-r::before { background: var(--paper); box-shadow: inset 0 0 0 2px var(--accent); }
.tlin__mark.is-on::before { background: var(--lightbox); box-shadow: inset 0 0 0 2px var(--ink); transform: scale(1.5); }
.tlin__mark.is-out { opacity: 0.13; }
.tlin__mark.is-out::before { transform: scale(0.75); }

.tlin__axis { position: relative; height: 2rem; font-family: var(--label); font-weight: 600; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tlin__tick { position: absolute; top: 0.5rem; transform: translateX(-50%); transition: opacity 0.3s var(--travel); }
.tlin__tick.is-hid { opacity: 0; }
.tlin__head-yr {
  position: absolute; top: 0.3rem; left: 0; padding: 0.1rem 0.45rem; border-radius: 6px; background: var(--ink); color: #fff;
  transform: translateX(calc(var(--px, 0px) - 50%)); opacity: 0;
  transition: transform 0.45s var(--travel), opacity 0.3s var(--travel);
}
.tlin.has-focus .tlin__head-yr { opacity: 1; }

/* ---------- console: the lineage counted up to the year in focus, and who arrived that year ---------- */
.tlin__console {
  margin-top: 1.1rem; display: grid; grid-template-columns: minmax(10.5rem, auto) minmax(0, 1fr); align-items: start; gap: 0.8rem 1.8rem;
  padding: 1.15rem 1.4rem; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-1);
}
.tlin__count { display: grid; gap: 0.15rem; }
.tlin__num {
  font-family: var(--label); font-weight: 700; font-size: clamp(2.8rem, 4.4vw, 3.6rem); line-height: 0.95; color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.01em;
}
.tlin__numlab { font-family: var(--label); font-weight: 500; font-size: 0.95rem; color: var(--muted); }
.tlin__detail { position: relative; min-height: 5.6rem; overflow: hidden; }
.tlin__pane { display: grid; gap: 0.55rem; align-content: start; }
.tlin__pane.is-leaving { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; }
.tlin__when { display: flex; align-items: baseline; gap: 0.4rem 0.9rem; flex-wrap: wrap; }
.tlin__when span { font-size: 0.95rem; color: var(--muted); }
.tlin__when .tlin__focus { margin-left: auto; font-family: var(--label); font-weight: 600; font-size: 0.95rem; color: var(--accent); }
.tlin__hint { padding-top: 0.35rem; font-size: 1.05rem; color: var(--ink-2); max-width: 72ch; }
.tlin__hint span { color: var(--muted); }
.tlin__who { position: relative; isolation: isolate; display: flex; flex-wrap: wrap; gap: 0.15rem 0.35rem; margin: 0; padding: 0; list-style: none; }
.tlin__who li {
  display: inline-flex; align-items: baseline; gap: 0.35rem; padding: 0.2rem 0.55rem; border-radius: 8px;
  font-size: 1.02rem; color: var(--ink); transition: color 0.3s var(--travel);
}
.tlin__who.has-on li:not(.is-on) { color: var(--muted); }
.tlin__who li .dg { color: var(--muted); font-size: 0.9em; }
.tlin__who-plate {
  position: absolute; left: 0; top: 0; z-index: -1; width: var(--ww, 0px); height: var(--wh, 0px); border-radius: 8px;
  transform: translate(var(--wx, 0px), var(--wy, 0px)); background: var(--accent-tint); opacity: 0;
  transition: transform 0.4s var(--settle), width 0.4s var(--settle), height 0.4s var(--settle), opacity 0.25s var(--travel);
}
.tlin__who.has-on .tlin__who-plate { opacity: 1; }
.tlin__who.is-still .tlin__who-plate { transition: opacity 0.25s var(--travel); }
.tlin__name .tlin__ring { margin-right: 0.35rem; vertical-align: 0.5px; }
.tlin__ring { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 2px currentColor; opacity: 0.75; translate: 0 -1px; }
.tlin__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- the names: filters ---------- */
.tlin__bar { margin-top: clamp(2.8rem, 5.5vw, 4rem); display: flex; align-items: center; gap: 0.9rem 1.4rem; flex-wrap: wrap; }
.tlin__bar h3 { font-size: clamp(1.4rem, 2vw, 1.7rem); margin-right: auto; }
.tlin__search { flex: 0 1 21rem; }
.tlin__search input { height: 46px; border-radius: 12px; background: var(--paper); }
.tlin__seg { position: relative; isolation: isolate; display: flex; gap: 2px; padding: 4px; background: var(--mist); border-radius: 12px; }
.tlin__seg-plate {
  position: absolute; left: 0; top: 4px; bottom: 4px; z-index: -1; width: var(--sw, 0px); transform: translateX(var(--sx, 0px));
  border-radius: 9px; background: var(--paper); box-shadow: 0 1px 2px rgba(10, 13, 18, 0.08), 0 4px 14px rgba(10, 13, 18, 0.07);
  transition: transform 0.5s var(--settle), width 0.5s var(--settle);
}
.tlin__seg.is-still .tlin__seg-plate { transition: none; }
.tlin__seg-opt {
  height: 38px; padding: 0 0.95rem; border: 0; border-radius: 9px; background: none; white-space: nowrap; cursor: pointer;
  font-family: var(--label); font-weight: 600; font-size: 0.95rem; color: var(--muted);
  transition: color 0.3s var(--travel), background-color 0.3s, transform 0.35s var(--settle);
}
.tlin__seg-opt b { font-weight: 500; margin-left: 0.2rem; font-variant-numeric: tabular-nums; opacity: 0.7; }
.tlin__seg-opt .s { display: none; }
.tlin__seg-opt:hover:not([aria-pressed="true"]) { color: var(--ink); background: rgba(255, 255, 255, 0.55); }
.tlin__seg-opt[aria-pressed="true"] { color: var(--ink); }
.tlin__seg-opt:active { transform: scale(0.97); }
.tlin__found { min-width: 6.5rem; text-align: right; font-family: var(--label); font-weight: 600; font-size: 0.95rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- the names: a ledger by year, one column per era ---------- */
.tlin__roster { position: relative; margin-top: 1.5rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.tlin__col { position: relative; isolation: isolate; min-width: 0; }
.tlin__rowplate {
  position: absolute; left: -0.7rem; right: -0.7rem; top: 0; z-index: -1; height: var(--rh, 0px); transform: translateY(var(--ry, 0px));
  border-radius: 12px; background: var(--mist); opacity: 0; pointer-events: none;
  transition: transform 0.45s var(--travel), height 0.45s var(--settle), opacity 0.3s var(--travel);
}
.tlin__rowplate.is-on { opacity: 1; }
.tlin__rowplate.is-still { transition: opacity 0.3s var(--travel); }
.tlin__col-h { display: grid; gap: 0.15rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line-2); }
.tlin__col-h h4 { font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.25; color: var(--ink); }
.tlin__col-h span { font-family: var(--label); font-weight: 500; font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tlin__row {
  display: grid; grid-template-columns: 3.3rem minmax(0, 1fr); gap: 0.6rem; align-items: baseline;
  padding: 0.45rem 0; border-bottom: 1px solid var(--line);
}
.tlin__row[hidden] { display: none; }
.tlin__yr { font-family: var(--label); font-weight: 700; font-size: 1.02rem; color: var(--muted); font-variant-numeric: tabular-nums; transition: color 0.3s var(--travel); cursor: pointer; }
.tlin__row:hover .tlin__yr { color: var(--ink-2); }
.tlin__row.is-yr .tlin__yr { color: var(--accent); }
.tlin__names { display: flex; flex-wrap: wrap; gap: 0.1rem 0.2rem; margin: 0; padding: 0; list-style: none; }
.tlin__names li[hidden] { display: none; }
.tlin__name {
  display: inline-block; padding: 0.2rem 0.45rem; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: 0.97rem; line-height: 1.35; color: var(--ink); text-align: left; cursor: pointer;
  transition: background-color 0.25s var(--travel), color 0.25s var(--travel);
}
.tlin__name .dg { color: var(--muted); font-size: 0.9em; }
.tlin__name:hover, .tlin__name.is-on { background: var(--accent-tint); }
.tlin__name.is-on { color: var(--accent-deep); }
.tlin__name mark { background: var(--lightbox); color: var(--ink); border-radius: 3px; padding: 0 1px; }
.tlin__ghost { position: absolute; margin: 0; pointer-events: none; }
.tlin__empty { margin-top: 1.2rem; font-size: 1rem; color: var(--muted); }
.tlin .roster__note { margin-top: 1.6rem; font-size: 0.9rem; color: var(--muted); max-width: 70ch; }

/* ---------- widths ---------- */
@media (max-width: 960px) {
  .tlin__roster { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}
@media (max-width: 760px) {
  .tlin__era-lab .l { display: none; }
  .tlin__era-lab .s { display: inline; }
  .tlin__era-lab { left: 0.6rem; top: 0.65rem; }
  .tlin__era-lab b { font-size: 0.95rem; }
  .tlin__era-lab span { font-size: 0.8rem; }
}
@media (max-width: 640px) {
  .tlin { --m: 8px; --step: 11px; }
  .tlin__mark.is-r::before, .tlin__mark.is-yr.is-r::before { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
  .tlin__mark.is-yr.is-r::before { box-shadow: inset 0 0 0 1.5px var(--accent); }
  .tlin__plate { border-radius: 8px 8px 0 0; }
  .tlin__rowplate { left: -0.5rem; right: -0.5rem; }
  .tlin__era { border-radius: 14px 14px 0 0; }
  .tlin__head-yr { font-size: 0.8rem; }
  .tlin__console { grid-template-columns: minmax(0, 1fr); padding: 1rem 1.05rem; gap: 0.7rem; }
  .tlin__count { grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 0.6rem; }
  .tlin__num { font-size: 2.6rem; }
  .tlin__detail { min-height: 4.2rem; }
  .tlin__who li { font-size: 0.95rem; padding: 0.15rem 0.45rem; }
  .tlin__search { flex: 1 1 100%; }
  .tlin__bar h3 { flex: 1 1 100%; }
  .tlin__seg { flex: 1 1 auto; }
  .tlin__seg-opt { flex: 1 1 auto; padding: 0 0.6rem; }
  .tlin__seg-opt .l { display: none; }
  .tlin__seg-opt .s { display: inline; }
  .tlin__found { min-width: 0; }
  .tlin__row { grid-template-columns: 2.9rem minmax(0, 1fr); gap: 0.4rem; }
  .tlin__name { font-size: 0.95rem; padding: 0.2rem 0.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tlin *, .tlin *::before { transition-duration: 0s !important; transition-delay: 0s !important; animation: none !important; }
}

/* page pass: an era called from another section (the fellowship in Programs) lights its column once */
.tlin__col { border-radius: 18px; transition: background-color 0.7s cubic-bezier(0.28, 0.11, 0.32, 1), box-shadow 0.7s cubic-bezier(0.28, 0.11, 0.32, 1); }
.tlin__col.is-called { background-color: var(--accent-tint); box-shadow: 0 0 0 14px var(--accent-tint); }
.tlin__none { margin: 0.9rem 0 0; font-family: var(--label); font-weight: 500; font-size: 0.92rem; color: var(--muted); }
.tlin__none[hidden] { display: none; }
