/*
  Saint Paul gift preview: the time machine page (history.html).
  Class prefix .tm-*. Tokens come from css/base.css; this file never redefines them.
  Motion rules sit inside prefers-reduced-motion: no-preference. Scroll-linked rules also sit
  inside @supports (animation-timeline: view()); js/history.js adds html.tm-no-sdt where scroll
  timelines are missing, and the .tm-no-sdt rules give the class-and-transition fallback.
*/

/* ---------- Page frame ---------- */
/* This page is very long, so the page itself scrolls at once; js/history.js glides only
   the dial and Begin jumps (and not under reduced motion). */
html:has(body[data-page="history"]) {
  scroll-behavior: auto;
  scroll-padding-bottom: calc(56px + env(safe-area-inset-bottom)); /* the dial never hides a focused item */
}
@media (min-width: 1100px) { html:has(body[data-page="history"]) { scroll-padding-bottom: 0; } }
.tm-main {
  --tm-dial-h: 56px;
  --tm-rail: 0px;
  --tm-date: var(--sp-brick);
  position: relative;
}
/* Era light: js/history.js sets the active era's tone on the body and on the dial
   (the dial carries data-tone, so it takes the tone colors from css/base.css).
   The page color stays night; two fixed color layers behind the page fade in with opacity only. */
body[data-page="history"] { background-color: var(--sp-night); }
body[data-page="history"]::before,
body[data-page="history"]::after {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 120lvh;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--sp-dur-4) var(--sp-ease-inout);
}
body[data-page="history"]::before { background-color: color-mix(in srgb, var(--sp-bronze-deep) 16%, var(--sp-paper)); }
body[data-page="history"]::after { background-color: var(--sp-ivory); }
body[data-tm-tone="mid"]::before, body[data-tm-tone="today"]::after { opacity: 1; }
.tm-main + .sp-footer { padding-bottom: calc(var(--sp-space-6) + var(--tm-dial-h, 56px) + env(safe-area-inset-bottom)); }
.tm-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.tm-noscript { padding-block: var(--sp-space-7); }

/* ---------- 1. Portal opener ---------- */
/* The title card sits first; the gold ring sits below it (beside it on wide screens).
   The 1871 photo fills the stage and is clipped to a circle inside the ring.
   js/history.js measures the ring and sets --cx and --cy; the values here are the no-script guess. */
.tm-portal {
  --ring: min(56vw, 27svh, 420px);
  --cx: 50%;
  --cy: 64%;
  position: relative;
  height: calc(100svh - var(--sp-header-h));
  min-height: 560px;
  background: var(--sp-night);
  color: var(--sp-gold-100);
}
.tm-portal__stage {
  position: sticky;
  top: var(--sp-header-h);
  height: calc(100svh - var(--sp-header-h));
  min-height: 560px;
  overflow: clip;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-space-4) var(--sp-gutter) 0;
}
.tm-portal__photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  container-type: size;
  clip-path: circle(calc(var(--ring) / 2 - 9px) at var(--cx) var(--cy));
  background: var(--sp-night-2);
}
/* The box takes the photo's own shape (650 x 803, the width and height in history.html) and covers
   the stage; js/history.js uses the same numbers for the ring position. */
.tm-portal__img {
  --tm-w: max(100cqw, 100cqh * 650 / 803);
  --tm-h: max(100cqh, 100cqw * 803 / 650);
  position: absolute;
  left: calc((100cqw - var(--tm-w)) / 2);
  top: calc((100cqh - var(--tm-h)) / 2);
  width: var(--tm-w);
  height: var(--tm-h);
  max-width: none;
  object-fit: fill;
  background: var(--sp-night-2);
  transform-origin: 0 0;
  transform: translate(var(--tm-tx, 0px), var(--tm-ty, 0px)) scale(var(--tm-s0, 1));
}
/* The colored copy of the same view lies on top and fades in while the photo opens (motion rules below). */
.tm-portal__img--now { opacity: 0; background: none; }
.tm-portal__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--cx) var(--cy), transparent 0, transparent calc(var(--ring) / 2), rgba(31, 14, 3, .3) calc(var(--ring) * 1.2), rgba(31, 14, 3, .78) 100%);
}
.tm-portal__text {
  position: relative;
  z-index: 3;
  width: min(100%, 560px);
  padding: var(--sp-space-4) var(--sp-space-5) var(--sp-space-5);
  text-align: center;
  background: rgba(31, 14, 3, .86);
  border: var(--sp-line) solid rgba(246, 183, 91, .6);
  border-radius: var(--sp-radius-m);
  box-shadow: 0 0 0 4px rgba(31, 14, 3, .5), 0 24px 48px -20px rgba(0, 0, 0, .7);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.tm-portal__text.sp-corners::before { --c: var(--sp-gold-300); }
.tm-portal__eyebrow { justify-content: center; margin-bottom: var(--sp-space-2); text-wrap: balance; }
/* On phones the header right above already shows the parish name, so the eyebrow does not repeat it. */
@media (max-width: 767.98px) { .tm-portal__eyebrow { display: none; } }
.tm-portal__title {
  margin: 0;
  font-family: var(--sp-font-display);
  font-size: clamp(2rem, 8.2vw, 3.6rem);
  font-weight: 600;
  line-height: 1.05;
  color: var(--sp-gold-100);
  text-wrap: balance;
}
.tm-portal__sub {
  margin-top: var(--sp-space-1);
  font-family: var(--sp-font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 4.6vw, 1.6rem);
  color: var(--sp-gold-300);
}
.tm-portal__lede {
  max-width: 36ch;
  margin: var(--sp-space-2) auto 0;
  font-size: var(--sp-fs-small);
  color: var(--sp-gold-100);
}
.tm-portal__begin { margin-top: var(--sp-space-4); min-width: 160px; min-height: 48px; }
.tm-portal__arrow {
  width: 10px;
  height: 10px;
  margin-top: -4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.tm-portal__window {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: var(--sp-space-6);
}
.tm-portal__ring {
  position: relative;
  flex: none;
  width: var(--ring);
  height: var(--ring);
  border-radius: 50%;
  border: clamp(8px, 2vw, 14px) solid var(--sp-gold-300);
  box-shadow:
    0 0 0 1px var(--sp-bronze),
    0 0 0 7px rgba(214, 140, 59, .22),
    0 0 0 8px rgba(246, 183, 91, .55),
    inset 0 0 0 1px var(--sp-bronze),
    inset 0 0 0 5px rgba(250, 223, 162, .25),
    0 18px 60px rgba(0, 0, 0, .55);
  pointer-events: none;
}
.tm-portal__ring-inner {
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  border: 1px dashed rgba(246, 183, 91, .55);
}
.tm-portal__cap {
  margin-top: var(--sp-space-5);
  padding: 4px 12px;
  border-radius: var(--sp-radius-round);
  background: rgba(31, 14, 3, .8);
  font-size: var(--sp-fs-small);
  font-style: italic;
  color: var(--sp-gold-100);
}
@media (max-height: 800px) and (max-width: 899.98px) {
  .tm-portal__lede { display: none; }
  .tm-portal__window { margin-top: var(--sp-space-5); }
}
@media (min-width: 900px) {
  .tm-portal { --ring: min(36vw, 58svh, 520px); --cx: 66%; --cy: 50%; }
  .tm-portal__stage {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(32px, 6vw, 96px);
    padding: 0 var(--sp-gutter) 0 calc(var(--tm-rail) + var(--sp-gutter));
  }
  .tm-portal__text { width: min(38vw, 500px); text-align: left; }
  .tm-portal__eyebrow { justify-content: flex-start; }
  .tm-portal__lede { margin-left: 0; }
  .tm-portal__window { margin-top: 0; }
}

/* ---------- 2. Eras ---------- */
.tm-era {
  position: relative;
  padding-block: var(--sp-space-7) var(--sp-space-6);
}
.tm-era > :not(.tm-era__glow) { position: relative; z-index: 1; }
.tm-era[tabindex="-1"]:focus { outline: none; }
.tm-era[data-tone="past"] { --tm-date: var(--sp-gold-300); }
.tm-era__glow {
  position: absolute;
  inset: 0 0 auto 0;
  height: min(110svh, 900px);
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 60% at 50% 0%, color-mix(in srgb, var(--sp-tone-accent) 30%, transparent), transparent 72%),
    radial-gradient(40% 30% at 85% 10%, color-mix(in srgb, var(--sp-gold-300) 18%, transparent), transparent 70%);
  opacity: .3;
  transition: opacity var(--sp-dur-4) var(--sp-ease-inout);
}
.tm-era.is-active .tm-era__glow { opacity: 1; }
.tm-era[data-tone="today"] .tm-era__glow {
  background:
    radial-gradient(70% 60% at 50% 0%, color-mix(in srgb, var(--sp-sky) 40%, transparent), transparent 72%),
    radial-gradient(40% 30% at 85% 10%, color-mix(in srgb, var(--sp-gold-100) 60%, transparent), transparent 70%);
}
/* Night to day (Coach 2026-10-06): js/history.js numbers the eras (data-tm-step 1 to 8).
   Each era fades from its own light (--tm-a) to the next era's light (--tm-b), so no edge shows.
   Eras 1 and 2 keep the sepia night and dusk with gold text; a sunrise band (brown, amber, cream)
   closes era 2 and opens era 3; eras 3 to 8 brighten from sepia dawn to daylight ivory with ink text.
   Only colors change: no size, space, or order changes. --sp-tone-bg is the era's middle color
   (for the timeline dots); --sp-tone-card is the event card. */
body[data-page="history"] .tm-era[data-tm-step] {
  background-color: var(--sp-tone-bg);
  background-image: linear-gradient(to bottom, var(--tm-a), var(--tm-b));
}
.tm-era[data-tm-step="1"] { --tm-a: #1f0e03; --tm-b: #2a1407; --sp-tone-bg: #241105; --sp-tone-card: #301708; }
.tm-era[data-tm-step="2"] { --tm-a: #e6c595; --tm-b: #e9cfa6; --sp-tone-bg: #e8ca9d; --sp-tone-card: #f7e9d2; }
/* Sunrise band (brown, amber, cream) closes era 1, so the parish is founded at dawn. */
body[data-page="history"] .tm-era[data-tm-step="1"] {
  background-image: linear-gradient(to bottom, var(--tm-a) 0, var(--tm-b) calc(100% - 200px), #6e3815 calc(100% - 140px), #a95e25 calc(100% - 80px), #d9a062 calc(100% - 30px), #e6c595 100%);
}
body[data-page="history"] .tm-era[data-tm-step="2"] {
  background-image: linear-gradient(to bottom, var(--tm-a), var(--tm-b));
}
/* The film grain of the night era fades out inside the sunrise band, so no edge shows. */
.tm-era[data-tm-step="1"].sp-grain::after {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 290px), transparent calc(100% - 60px));
  mask-image: linear-gradient(to bottom, #000 calc(100% - 290px), transparent calc(100% - 60px));
}
.tm-era[data-tm-step="3"] { --tm-a: #e9cfa6; --tm-b: #eed9b6; --sp-tone-bg: #ecd4ae; --sp-tone-card: #faf1e1; }
body[data-page="history"] .tm-era[data-tm-step="3"] {
  background-image: linear-gradient(to bottom, var(--tm-a), var(--tm-b));
}
.tm-era[data-tm-step="4"] { --tm-a: #eed9b6; --tm-b: #f1e2c4; --sp-tone-bg: #f0ddbd; --sp-tone-card: #fbf4e6; }
.tm-era[data-tm-step="5"] { --tm-a: #f1e2c4; --tm-b: #f4e9d3; --sp-tone-bg: #f3e6cc; --sp-tone-card: #fcf6ea; }
.tm-era[data-tm-step="6"] { --tm-a: #f4e9d3; --tm-b: #f7efe0; --sp-tone-bg: #f6ecda; --sp-tone-card: #fdf9f0; }
.tm-era[data-tm-step="7"] { --tm-a: #f7efe0; --tm-b: #faf4e8; --sp-tone-bg: #f9f2e4; --sp-tone-card: #fffdf8; }
.tm-era[data-tm-step="8"] { --tm-a: #faf4e8; --tm-b: #fbf6ec; --sp-tone-bg: #fbf6ec; --sp-tone-card: #fffdf8; }
/* The last era ends in the soft sky of the "Back to the present" opening. */
body[data-page="history"] .tm-era[data-tm-step="8"] {
  background-image: linear-gradient(to bottom, var(--tm-a) 0, var(--tm-b) calc(100% - 420px), color-mix(in srgb, var(--sp-sky) 8%, #fffdf8) 100%);
}
/* Dawn and day eras: deeper gold lines and a sky glow at full day */
.tm-era[data-tm-step="2"] .tm-era__glow, .tm-era[data-tm-step="3"] .tm-era__glow, .tm-era[data-tm-step="4"] .tm-era__glow, .tm-era[data-tm-step="5"] .tm-era__glow, .tm-era[data-tm-step="6"] .tm-era__glow { opacity: .45; }
.tm-era[data-tm-step="2"].is-active .tm-era__glow, .tm-era[data-tm-step="3"].is-active .tm-era__glow, .tm-era[data-tm-step="4"].is-active .tm-era__glow, .tm-era[data-tm-step="5"].is-active .tm-era__glow, .tm-era[data-tm-step="6"].is-active .tm-era__glow { opacity: .8; }
.tm-era[data-tm-step="7"] .tm-era__glow {
  background:
    radial-gradient(70% 60% at 50% 0%, color-mix(in srgb, var(--sp-sky) 28%, transparent), transparent 72%),
    radial-gradient(40% 30% at 85% 10%, color-mix(in srgb, var(--sp-gold-100) 55%, transparent), transparent 70%);
}
.tm-era__head { max-width: 760px; }
.tm-era__year {
  margin: 0 0 var(--sp-space-3);
  font-family: var(--sp-font-display);
  font-size: clamp(5rem, 26vw, 11rem);
  font-weight: 600;
  line-height: .85;
  letter-spacing: .01em;
  color: transparent;
  -webkit-text-stroke: 1.2px color-mix(in srgb, var(--sp-tone-accent) 75%, transparent);
  font-variant-numeric: lining-nums;
  user-select: none;
}
.tm-era__count {
  margin-bottom: var(--sp-space-2);
  font: 600 var(--sp-fs-label)/1.3 var(--sp-font-label);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sp-tone-accent);
}
.tm-era__span { margin-bottom: var(--sp-space-2); }
.tm-era__title {
  margin: 0 0 var(--sp-space-4);
  font-family: var(--sp-font-display);
  font-size: var(--sp-fs-h1);
  font-weight: 600;
  line-height: 1.06;
  color: inherit;
  text-wrap: balance;
}
.tm-era[data-tone="mid"] .tm-era__intro, .tm-era[data-tone="today"] .tm-era__intro { color: var(--sp-ink-soft); }

/* Pastors who served in the era */
.tm-people { margin-top: var(--sp-space-5); }
.tm-people__label {
  margin-bottom: var(--sp-space-2);
  font: 600 var(--sp-fs-label)/1.3 var(--sp-font-label);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sp-tone-accent);
}
.tm-people__list { display: flex; flex-wrap: wrap; gap: var(--sp-space-2); padding: 0; list-style: none; }
.tm-era .tm-person {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--sp-tap);
  padding: 7px 14px 8px;
  border: var(--sp-line) solid color-mix(in srgb, var(--sp-gold-500) 70%, transparent);
  border-left-width: 3px;
  border-radius: var(--sp-radius-s);
  background: color-mix(in srgb, var(--sp-tone-card) 80%, transparent);
  color: var(--sp-tone-fg);
  text-decoration: none;
}
.tm-era .tm-person:hover { border-color: var(--sp-gold-300); background: var(--sp-tone-card); }
.tm-person__name { font: 600 .9375rem/1.3 var(--sp-font-label); }
.tm-person__role { font: 500 var(--sp-fs-label)/1.3 var(--sp-font-label); opacity: .85; }
.tm-person__years { font: 500 var(--sp-fs-label)/1.3 var(--sp-font-label); letter-spacing: .04em; }

/* ---------- 3. Era stage (then and now) ---------- */
.tm-stage { margin-block: var(--sp-space-7) 0; }
.tm-stage--fade .tm-stage__frame {
  width: min(100% - 2 * var(--sp-gutter), 760px);
  margin-inline: auto;
}
.tm-stage__pics { display: grid; gap: var(--sp-space-4); }
.tm-stage__fig { position: relative; margin: 0; }
.tm-stage__clip { overflow: clip; background: var(--sp-night-2); }
.tm-stage__img { width: 100%; height: auto; transform-origin: 50% 0; }
.tm-stage__cap {
  padding: var(--sp-space-2) 2px 0;
  font-size: var(--sp-fs-small);
  font-style: italic;
  line-height: 1.45;
}
.tm-stage__hint { display: none; }
.tm-stage--still, .tm-stage--pair { display: grid; gap: var(--sp-space-5); }
.tm-stage--still { width: min(100% - 2 * var(--sp-gutter), 680px); }
.tm-stage__single { margin: 0; }
@media (min-width: 768px) {
  .tm-stage--pair { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* The one hint line for the full-screen viewer (js/history.js puts it under the first picture) */
.tm-viewer-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100% - 2 * var(--sp-gutter), 760px);
  margin: var(--sp-space-3) auto 0;
  font: 500 var(--sp-fs-small)/1.4 var(--sp-font-label);
  letter-spacing: .02em;
  text-align: center;
  color: var(--sp-tone-accent);
}
.tm-viewer-hint::before, .tm-viewer-hint::after {
  content: "";
  flex: 0 1 36px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}
.tm-event__media .tm-viewer-hint, .tm-stage__single + .tm-viewer-hint { width: 100%; }
.tm-portal__text .tm-portal__hint { width: 100%; margin: var(--sp-space-2) 0 var(--sp-space-3); }
[data-tm-viewer] { -webkit-tap-highlight-color: transparent; }

/* Photo buttons that open the lightbox */
.tm-zoom {
  display: block;
  width: 100%;
  overflow: clip;
  color: inherit;
  text-align: inherit;
  cursor: zoom-in;
}
.tm-zoom > img { width: 100%; height: auto; transform-origin: 50% 0; }
.tm-zoom__hint {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: var(--sp-line) solid var(--sp-gold-300);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fadfa2' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / 20px 20px no-repeat,
    rgba(31, 14, 3, .72);
  transition: transform var(--sp-dur-1) var(--sp-ease-out);
}
.tm-zoom:hover .tm-zoom__hint, .tm-zoom:focus-visible .tm-zoom__hint { transform: scale(1.08); }

/* ---------- 4. Events along the gold thread ---------- */
.tm-era__body { margin-top: var(--sp-space-7); }
.tm-events {
  position: relative;
  display: grid;
  gap: var(--sp-space-5);
  max-width: 820px;
  margin: 0;
  padding: 0 0 0 30px;
  list-style: none;
  /* The unlit track under the gold thread */
  background: linear-gradient(color-mix(in srgb, var(--sp-gold-500) 26%, transparent), color-mix(in srgb, var(--sp-gold-500) 26%, transparent)) 8px 6px / 2px calc(100% - 12px) no-repeat;
}
.tm-spark { display: none; }
.tm-thread::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 8px;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--sp-gold-500) 24px, var(--sp-gold-500) calc(100% - 24px), transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--sp-gold-300) 45%, transparent);
}
.tm-item { position: relative; }
.tm-item__dot {
  position: absolute;
  top: 22px;
  left: -30px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--sp-gold-500);
  background: var(--sp-tone-bg);
  box-shadow: 0 0 0 4px var(--sp-tone-bg);
  view-timeline: --tm-dot block;
  view-timeline-inset: 0;
}
/* The lit bead is the default look; the motion block lights it as the thread reaches it. */
.tm-item__dot::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: radial-gradient(circle, var(--sp-gold-100), var(--sp-gold-300) 55%, var(--sp-gold-500));
}
.tm-event__card {
  position: relative;
  padding: var(--sp-space-4) var(--sp-space-4) var(--sp-space-4);
  background: var(--sp-tone-card);
  border: var(--sp-line) solid color-mix(in srgb, var(--sp-gold-500) 55%, transparent);
  border-radius: var(--sp-radius-m);
  box-shadow: var(--sp-shadow-1);
}
.tm-event__card::before {
  content: "";
  position: absolute;
  top: 29px;
  left: -12px;
  width: 12px;
  height: 1px;
  background: var(--sp-gold-500);
}
[data-tone="past"] .tm-event__card { border-color: rgba(246, 183, 91, .42); box-shadow: 0 1px 0 rgba(250, 223, 162, .06) inset, 0 16px 32px -20px rgba(0, 0, 0, .8); }
.tm-event__date {
  font-family: var(--sp-font-display);
  font-size: clamp(1.75rem, 6vw, 2.35rem);
  font-weight: 600;
  line-height: 1.05;
  color: var(--tm-date);
  text-wrap: balance;
}
.tm-event__text { margin-top: var(--sp-space-2); max-width: var(--sp-measure); }
.tm-event__media { margin: var(--sp-space-4) 0 0; }
.tm-compare.sp-frame > .sp-compare { position: relative; }
.tm-event__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-space-2);
  margin-top: var(--sp-space-4);
}
.tm-event__cite { display: block; max-width: 100%; text-align: left; }
.tm-event__cite-label { display: inline; }

/* Extra album photos */
.tm-extra__card { border-style: dashed; }
.tm-extra__label {
  margin-bottom: var(--sp-space-1);
  font: 600 var(--sp-fs-label)/1.3 var(--sp-font-label);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sp-tone-accent);
}
.tm-extra__credit { margin-top: var(--sp-space-2); font-size: var(--sp-fs-label); line-height: 1.45; opacity: .92; }
.tm-extra .tm-item__dot { width: 14px; height: 14px; left: -28px; top: 24px; border-radius: 3px; transform: rotate(45deg); }

.tm-era__divider { margin-top: var(--sp-space-8); margin-bottom: 0; }

/* Zigzag timeline on wide screens */
@media (min-width: 1100px) {
  .tm-events { max-width: none; padding: 0; gap: var(--sp-space-4); }
  .tm-thread::before { left: 50%; margin-left: -1px; }
  .tm-events { background-position: 50% 6px; }
  .tm-item { width: calc(50% - 44px); }
  .tm-item:nth-child(odd) { margin-right: auto; }
  .tm-item:nth-child(even) { margin-left: auto; margin-top: calc(-1 * var(--sp-space-8)); }
  .tm-item:nth-child(odd) .tm-item__dot { left: calc(100% + 35px); }
  .tm-item:nth-child(even) .tm-item__dot { left: -53px; }
  .tm-item.tm-extra:nth-child(odd) .tm-item__dot { left: calc(100% + 37px); }
  .tm-item.tm-extra:nth-child(even) .tm-item__dot { left: -51px; }
  .tm-item:nth-child(odd) .tm-event__card::before { left: auto; right: -44px; width: 44px; }
  .tm-item:nth-child(even) .tm-event__card::before { left: -44px; width: 44px; }
}

/* ---------- 5. Return to the present ---------- */
.tm-return {
  position: relative;
  padding-block: var(--sp-space-9) var(--sp-space-8);
  text-align: center;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(255, 255, 255, .95), transparent 70%),
    linear-gradient(to bottom, color-mix(in srgb, var(--sp-sky) 30%, var(--sp-ivory)), var(--sp-ivory) 70%);
  border-top: 3px double var(--sp-gold-500);
}
.tm-return__inner { display: flex; flex-direction: column; align-items: center; }
.tm-return__emblem {
  width: clamp(140px, 34vw, 200px);
  height: auto;
  margin-bottom: var(--sp-space-5);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--sp-gold-500), 0 0 0 10px rgba(246, 183, 91, .14), 0 24px 50px -24px rgba(45, 21, 4, .6);
}
.tm-return__eyebrow { justify-content: center; }
.tm-return__title {
  margin: 0 0 var(--sp-space-4);
  font-family: var(--sp-font-display);
  font-size: var(--sp-fs-h1);
  font-weight: 600;
  line-height: 1.08;
  text-wrap: balance;
}
.tm-return__lede { margin-inline: auto; }
.tm-return__actions {
  display: grid;
  gap: var(--sp-space-3);
  width: min(100%, 880px);
  margin-top: var(--sp-space-6);
}
.tm-return__btn { min-height: 64px; padding: 14px 22px; font-size: 1.0625rem; gap: var(--sp-space-3); }
.tm-return__icon { flex: none; width: 24px; height: 24px; background: center / 24px 24px no-repeat; }
.tm-return__icon--mass { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fbf6ec' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3.5 2'/%3E%3C/svg%3E"); }
.tm-return__icon--pastors { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fbf6ec' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 3v18M7 8h10'/%3E%3C/svg%3E"); }
.tm-return__icon--visit { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fbf6ec' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-6-6.5-11a6.5 6.5 0 0 1 13 0c0 5-6.5 11-6.5 11z'/%3E%3Ccircle cx='12' cy='10' r='2.3'/%3E%3C/svg%3E"); }
.tm-return__more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-space-1) var(--sp-space-5);
  margin-top: var(--sp-space-6);
}
.tm-return__more-label {
  width: 100%;
  font: 600 var(--sp-fs-label)/1.3 var(--sp-font-label);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sp-muted);
}
@media (min-width: 768px) {
  .tm-return__actions { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 6. Decade dial and odometer ---------- */
.tm-dial {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--sp-space-2);
  height: calc(var(--tm-dial-h) + env(safe-area-inset-bottom));
  padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(10px, env(safe-area-inset-left));
  /* Frosted glass (Coach 2026-10-06): a see-through era tone, blur and saturate, a gold hairline */
  background: color-mix(in srgb, var(--tm-glass, var(--sp-tone-bg)) 72%, transparent);
  color: var(--sp-tone-fg);
  border-top: 1px solid color-mix(in srgb, var(--sp-gold-300) 70%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 246, 225, .14), 0 -10px 30px -14px rgba(31, 14, 3, .45);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  backdrop-filter: blur(16px) saturate(1.6);
  transition: background-color var(--sp-dur-3) var(--sp-ease-inout), color var(--sp-dur-3) var(--sp-ease-inout);
}
.tm-dial[data-tm-step="1"] { --tm-glass: #1f0e03; }
.tm-dial[data-tm-step="2"] { --tm-glass: #e8ca9d; }
.tm-dial[data-tm-step="3"] { --tm-glass: #ecd4ae; }
.tm-dial[data-tm-step="4"] { --tm-glass: #f0ddbd; }
.tm-dial[data-tm-step="5"] { --tm-glass: #f3e6cc; }
.tm-dial[data-tm-step="6"] { --tm-glass: #f6ecda; }
.tm-dial[data-tm-step="7"], .tm-dial[data-tm-step="8"] { --tm-glass: #fbf6ec; }
.tm-dial:not([data-tone="past"]) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 -10px 30px -16px rgba(79, 55, 24, .35); }
.tm-dial__progress { display: none; }
.tm-odometer {
  flex: none;
  display: inline-flex;
  box-sizing: border-box;
  min-width: calc(4 * .56em + 18px);
  min-height: calc(1em + 10px);
  padding: 4px 8px;
  border: var(--sp-line) solid color-mix(in srgb, var(--sp-gold-500) 75%, transparent);
  border-radius: var(--sp-radius-s);
  background: color-mix(in srgb, var(--sp-night) 88%, transparent);
  color: var(--sp-gold-300);
  font-family: var(--sp-font-display);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  box-shadow: inset 0 0 0 2px rgba(31, 14, 3, .6), inset 0 6px 8px -6px rgba(0, 0, 0, .8), inset 0 -6px 8px -6px rgba(0, 0, 0, .8);
}
.tm-dial:not([data-tone="past"]) .tm-odometer {
  background: color-mix(in srgb, var(--sp-ivory) 90%, transparent);
  color: var(--sp-ink);
  border-color: color-mix(in srgb, var(--sp-gold-500) 80%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -5px 8px -7px rgba(79, 55, 24, .35), 0 1px 2px rgba(45, 21, 4, .12);
}
.tm-odo__digit {
  display: inline-block;
  width: .56em;
  height: 1em;
  overflow: hidden;
  text-align: center;
}
.tm-odo__reel { display: flex; flex-direction: column; }
.tm-odo__reel > span { display: block; height: 1em; line-height: 1; }
.tm-odo--still .tm-odo__reel { transition: none !important; }
.tm-dial__track {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
}
.tm-dial__track::-webkit-scrollbar { display: none; }
.tm-dial__list { display: flex; gap: 8px; min-height: calc(var(--sp-tap) + 12px); margin: 0; padding: 6px 10px; list-style: none; width: max-content; }
.tm-dial__item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: var(--sp-tap);
  padding: 0 12px;
  border: var(--sp-line) solid transparent;
  border-radius: var(--sp-radius-round);
  scroll-snap-align: center;
  color: inherit;
  font: 600 .9375rem/1.1 var(--sp-font-label);
  letter-spacing: .03em;
  text-decoration: none;
  white-space: nowrap;
}
.tm-main .tm-dial a.tm-dial__item { color: inherit; text-decoration: none; }
.tm-dial__item:hover { border-color: var(--sp-gold-500); }
.tm-main .tm-dial a.tm-dial__item[aria-current="true"] {
  background: var(--sp-gold-300);
  border-color: var(--sp-gold-500);
  color: var(--sp-ink);
  box-shadow: inset 0 0 0 2px var(--sp-gold-300), inset 0 0 0 3px rgba(112, 57, 18, .35);
}
.tm-dial__name { display: none; }

@media (min-width: 1100px) {
  .tm-main { --tm-rail: 176px; --tm-dial-h: 0px; }
  .tm-main + .sp-footer { padding-bottom: calc(var(--sp-space-6) + env(safe-area-inset-bottom)); }
  .tm-era .sp-wrap, .tm-return .sp-wrap, .tm-stage--still.sp-wrap, .tm-stage--pair.sp-wrap {
    width: min(100% - var(--tm-rail) - 3 * var(--sp-gutter), var(--sp-wrap));
    margin-left: max(calc(var(--tm-rail) + 2 * var(--sp-gutter)), calc((100% - var(--sp-wrap)) / 2));
    margin-right: auto;
  }
  .tm-stage--fade { padding-left: var(--tm-rail); }
  .tm-stage--fade .tm-stage__frame, .tm-stage__hint { margin-inline: auto; }
  .tm-dial {
    top: calc(var(--sp-header-h) + 20px);
    bottom: 20px;
    left: max(16px, env(safe-area-inset-left));
    right: auto;
    width: var(--tm-rail);
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-space-3);
    padding: var(--sp-space-3) var(--sp-space-2);
    border: 1px solid color-mix(in srgb, var(--sp-gold-300) 70%, transparent);
    border-radius: var(--sp-radius-m);
    box-shadow: inset 0 1px 0 rgba(255, 246, 225, .14), 0 18px 40px -18px rgba(31, 14, 3, .5);
  }
  .tm-odometer { align-self: center; font-size: 2.1rem; }
  .tm-dial__track {
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y proximity;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  }
  .tm-dial__list { flex-direction: column; width: auto; padding: 8px 2px; gap: 2px; }
  .tm-dial__item {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 6px 12px 7px;
    border-radius: var(--sp-radius-s);
    white-space: normal;
    text-align: left;
  }
  .tm-dial__year { font-family: var(--sp-font-display); font-size: 1.35rem; font-weight: 600; line-height: 1.05; }
  .tm-dial__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-top: 2px;
    font: 500 var(--sp-fs-label)/1.3 var(--sp-font-label);
    letter-spacing: 0;
    opacity: .92;
  }
}

/* ---------- 7. Motion (only when the visitor allows it) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Sticky then-and-now stage: the colored copy fades in over the old picture (opacity only). */
  .tm-stage--fade { height: 160svh; view-timeline: --tm-stage block; }
  .tm-stage__sticky {
    position: sticky;
    top: var(--sp-header-h);
    height: calc(100svh - var(--sp-header-h) - var(--tm-dial-h) - env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .tm-stage--fade .tm-stage__frame { width: min(100% - 2 * var(--sp-gutter), calc(60svh * var(--tm-ar)), 760px); }
  .tm-stage--fade .tm-stage__fig--then .tm-stage__cap { opacity: 1; }
  .tm-stage--fade .tm-stage__pics { display: grid; gap: 0; }
  .tm-stage--fade .tm-stage__fig { grid-area: 1 / 1; }
  .tm-stage--fade .tm-stage__clip { aspect-ratio: var(--tm-ar); }
  .tm-stage--fade .tm-stage__img { height: 100%; object-fit: cover; }
  .tm-stage--fade .tm-stage__cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 36px 12px 10px;
    background: linear-gradient(to bottom, rgba(31, 14, 3, 0), rgba(31, 14, 3, .9) 45%);
    color: var(--sp-gold-100);
  }
  .tm-stage--fade .tm-stage__fig--now { opacity: 0; }
  .tm-stage__hint {
    display: block;
    width: min(100% - 2 * var(--sp-gutter), 760px);
    margin: var(--sp-space-3) auto 0;
    font-size: var(--sp-fs-small);
    font-style: italic;
    text-align: center;
    opacity: .9;
  }
  .tm-odo__reel { transition: transform 720ms var(--sp-ease-out); }
  .tm-odo__digit:nth-child(2) .tm-odo__reel { transition-delay: 40ms; }
  .tm-odo__digit:nth-child(3) .tm-odo__reel { transition-delay: 80ms; }
  .tm-odo__digit:nth-child(4) .tm-odo__reel { transition-delay: 120ms; }
  .tm-odo--still .tm-odo__reel { transition: none; }
  .tm-dial__track { scroll-behavior: smooth; }
  .tm-odometer { transition: background-color var(--sp-dur-3) var(--sp-ease-inout), color var(--sp-dur-3) var(--sp-ease-inout); }
  /* Press */
  .tm-dial__item, .tm-era .tm-person { transition: transform 100ms var(--sp-ease-out); }
  .tm-dial__item:active, .tm-era .tm-person:active { transform: scale(.97); }
  /* Signature: the gold thread draws with the finger, its tip held at mid-screen with a spark. */
  @supports (animation-timeline: view()) {
    html:not(.tm-no-sdt) .tm-events { view-timeline: --tm-thread block; view-timeline-inset: 0; }
    html:not(.tm-no-sdt) .tm-thread::before {
      transform-origin: 50% 0;
      animation: tm-draw linear both;
      animation-timeline: --tm-thread;
      animation-range: cover 30% cover 70%;
      animation-range: cover 50dvh cover calc(100% - 50dvh);
    }
    html:not(.tm-no-sdt) .tm-item__dot::before { animation: tm-ignite linear both; animation-timeline: --tm-dot; animation-range: cover calc(50% - 30px) cover 50%; }
    html:not(.tm-no-sdt) .tm-item__dot { animation: tm-dot-glow linear both; animation-timeline: --tm-dot; animation-range: cover calc(50% - 30px) cover 50%; }
    html:not(.tm-no-sdt) .tm-spark { display: block; position: sticky; top: 50dvh; height: 0; z-index: 2; pointer-events: none; }
    html:not(.tm-no-sdt) .tm-spark::after {
      content: "";
      position: absolute;
      left: 9px;
      top: 0;
      width: 12px;
      height: 12px;
      translate: -50% -50%;
      border-radius: 50%;
      background: radial-gradient(circle, #fffbe8 0 2px, var(--sp-gold-300) 3px, rgba(246, 183, 91, 0) 6px);
      box-shadow: 0 0 12px 4px rgba(246, 183, 91, .55);
    }
    html:not(.tm-no-sdt) .tm-event__media .tm-zoom > img { animation: tm-settle linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
  }
  @media (min-width: 1100px) {
    html:not(.tm-no-sdt) .tm-spark::after { left: 50%; }
  }

  @supports (animation-timeline: view()) {
    /* Portal: the 1871 photo opens from the gold ring to the full screen as you scroll. */
    html:not(.tm-no-sdt) .tm-portal { height: 175svh; view-timeline: --tm-portal block; }
    html:not(.tm-no-sdt) .tm-portal__photo { animation: tm-iris linear both; animation-timeline: --tm-portal; animation-range: contain 0% contain 100%; }
    html:not(.tm-no-sdt) .tm-portal__img { animation: tm-push linear both; animation-timeline: --tm-portal; animation-range: contain 0% contain 100%; }
    html:not(.tm-no-sdt) .tm-portal__img--now { animation: tm-push linear both, tm-fade-in linear both; animation-timeline: --tm-portal, --tm-portal; animation-range: contain 0% contain 100%, contain 30% contain 85%; }
    html:not(.tm-no-sdt) .tm-portal__photo::after { animation: tm-vignette linear both; animation-timeline: --tm-portal; animation-range: contain 20% contain 90%; }
    html:not(.tm-no-sdt) .tm-portal__ring { animation: tm-ring linear both; animation-timeline: --tm-portal; animation-range: contain 0% contain 100%; }
    html:not(.tm-no-sdt) .tm-stage--fade .tm-stage__fig--now { animation: tm-fade-in linear both; animation-timeline: --tm-stage; animation-range: contain 12% contain 62%; }
    html:not(.tm-no-sdt) .tm-stage--fade .tm-stage__fig--then .tm-stage__cap { animation: tm-fade-out linear both; animation-timeline: --tm-stage; animation-range: contain 12% contain 40%; }
    /* Ken Burns drift: a slow push-in, from the top so towers and crosses stay in the frame. */
    html:not(.tm-no-sdt) .tm-stage--fade .tm-kb { animation: tm-kb linear both; animation-timeline: --tm-stage; animation-range: contain 0% contain 100%; }
    html:not(.tm-no-sdt) .tm-zoom > .tm-kb { animation: tm-kb linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  }
  @supports (animation-timeline: scroll()) {
    html:not(.tm-no-sdt) .tm-dial__progress {
      display: block;
      position: absolute;
      top: -1px;
      left: 0;
      right: 0;
      height: 2px;
      background: linear-gradient(90deg, var(--sp-gold-500), var(--sp-gold-300));
      transform-origin: 0 50%;
      animation: tm-fill-x linear both;
      animation-timeline: scroll(root);
      pointer-events: none;
    }
  }
  @media (min-width: 1100px) {
    .tm-stage--fade { height: 220svh; }
    .tm-stage--fade .tm-stage__frame { width: min(100% - var(--tm-rail) - 4 * var(--sp-gutter), calc(72svh * var(--tm-ar)), 900px); }
    @supports (animation-timeline: scroll()) {
      html:not(.tm-no-sdt) .tm-dial__progress { top: 10px; bottom: 10px; left: -1px; right: auto; width: 2px; height: auto; transform-origin: 50% 0; animation-name: tm-fill-y; background: linear-gradient(var(--sp-gold-500), var(--sp-gold-300)); }
    }
  }

  /* Fallback where scroll timelines are missing: classes from js/history.js and js/site.js. */
  html.tm-no-sdt .tm-stage--fade .tm-stage__fig--now { transition: opacity 1.6s var(--sp-ease-inout); }
  html.tm-no-sdt .tm-stage--fade.is-in .tm-stage__fig--now { opacity: 1; }
  html.tm-no-sdt .tm-stage--fade .tm-stage__fig--then .tm-stage__cap { transition: opacity .8s var(--sp-ease-inout); }
  html.tm-no-sdt .tm-stage--fade.is-in .tm-stage__fig--then .tm-stage__cap { opacity: 0; }
  /* Calm cards: event cards no longer fade in; the gold thread carries the motion. */
}

@keyframes tm-iris {
  from { clip-path: circle(calc(var(--ring) / 2 - 9px) at var(--cx) var(--cy)); }
  to { clip-path: circle(150vmax at var(--cx) var(--cy)); }
}
@keyframes tm-push {
  from { transform: translate(var(--tm-tx, 0px), var(--tm-ty, 0px)) scale(var(--tm-s0, 1)); }
  to { transform: translate(0, 0) scale(1); }
}
@keyframes tm-ring {
  from { scale: 1; opacity: 1; }
  to { scale: 3.4; opacity: .35; }
}
@keyframes tm-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tm-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes tm-kb { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes tm-fill-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes tm-fill-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  .tm-stage__hint, .tm-dial__progress { display: none !important; }
}

/* Phones: centered (Coach 2026-10-06) */
@media (max-width: 699px) {
  .tm-era__head { margin-inline: auto; text-align: center; }
  .tm-era__intro { text-align: left; } /* 3 to 6 lines on phones: long reading text stays left */
  .tm-era__span { justify-content: center; }
  .tm-people { text-align: center; }
  .tm-people__list { justify-content: center; }
  .tm-era .tm-person { border-left-width: var(--sp-line); }
  .tm-stage__cap { text-align: center; }
  .tm-event__media .sp-caption { text-align: center; }
}

@keyframes tm-draw { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes tm-ignite { from { transform: scale(0); opacity: .2; } }
@keyframes tm-dot-glow {
  from { box-shadow: 0 0 0 4px var(--sp-tone-bg); border-color: color-mix(in srgb, var(--sp-gold-500) 45%, transparent); }
  to { box-shadow: 0 0 0 4px var(--sp-tone-bg), 0 0 14px 2px rgba(246, 183, 91, .6); }
}
@keyframes tm-settle { from { transform: scale(1.08); } to { transform: none; } }
@keyframes tm-vignette { to { opacity: .25; } }
