.time-passage {
  --paper: #f2e8d4;
  --gold: #e2bd80;
  --ink: #17221d;
  color: var(--paper);
  background: var(--ink);
}
/* The stage's containing block includes the whole scroll distance. */
.time-passage.is-pinned::after { content: ''; display: block; height: var(--passage-length); }
.time-stage { padding: clamp(16px, 3vw, 50px); max-width: 110rem; margin: auto; }
.is-pinned .time-stage {
  position: sticky; top: var(--unfold-top, 3.3rem); height: calc(100svh - var(--unfold-top, 3.3rem));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: clamp(12px, 2.5vh, 30px);
}
.time-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid #665f4f; }
.time-head h2 { margin: 0; font: 500 clamp(.82rem, 1.5vw, 1.15rem)/1.2 Georgia, serif; }
.time-return { display: inline-flex; align-items: center; min-height: 44px; font-size: .8rem; color: var(--gold); }
.is-pinned .time-body { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 70px); align-items: center; }
.time-pictures { min-width: 0; }
.time-art { position: relative; }
.is-pinned .time-art { height: 100%; }
.time-passage .time-art.has-views .time-photo { object-fit: contain; }
.time-floor { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.time-floor polygon { stroke: #ffea91; stroke-width: 2; vector-effect: non-scaling-stroke; fill: #ffd45e22; filter: drop-shadow(0 1px 2px #30261d); }
.time-views { display: flex; flex-wrap: wrap; gap: 0 .4rem; margin: .35rem 0; }
.time-views button { min-height: 44px; padding: .25rem .65rem; color: var(--paper); font: 600 .78rem/1.2 system-ui,sans-serif; border: 1px solid #887e69; background: transparent; }
.time-views button[aria-pressed=true] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.time-notes { display: grid; }
.time-notes .time-caption { grid-area: 1 / 1; align-self: center; }
.time-notes .time-caption[inert] { visibility: hidden; }
.is-pinned .time-pictures { position: relative; height: 100%; min-height: 0; }
.time-frame { position: relative; margin: 1.5rem 0; }
.time-passage .time-frame figcaption { display: block; text-align: start; margin-top: 1rem; }
.is-pinned .time-frame { position: absolute; inset: 0; margin: 0; background: var(--ink); }
.time-photo { width: 100%; display: block; max-height: 72svh; object-fit: contain; }
.is-pinned .time-photo { height: 100%; max-height: none; }
.time-inset {
  position: absolute; right: 2%; bottom: 6%; width: 45%; max-height: 45%;
  object-fit: contain; box-shadow: 0 3px 22px #1119; transform: rotate(-2deg);
}
.time-passage:not(.is-pinned) .time-inset { position: relative; display: block; margin: -12% 2% 1rem auto; }
.time-year { margin: 0 0 .5rem; color: var(--gold); font: normal clamp(3rem, 6vw, 7rem)/.98 Georgia, serif; letter-spacing: -.065em; }
.time-caption h3 { font: normal clamp(1.6rem, 2.9vw, 3.6rem)/1.03 Georgia, serif; letter-spacing: -.035em; margin: 0; text-wrap: balance; }
.time-detail { max-width: 38ch; margin: .75rem 0; font: normal clamp(1rem, 1.3vw, 1.3rem)/1.45 Georgia, serif; }
.time-source { display: inline-block; color: #c8c6b6; font-size: .74rem; line-height: 1.35; max-width: 50ch; text-underline-offset: 3px; }
.time-compare { display: block; min-height: 44px; margin-top: .35rem; padding: .3rem 0; color: var(--gold); font: 1rem Georgia, serif; background: transparent; border: 0; text-decoration: underline; text-underline-offset: 4px; }
.time-rail { position: relative; display: flex; justify-content: space-between; }
.time-rail::before, .time-rail::after { content: ''; position: absolute; top: 6px; left: 0; right: 0; height: 1px; background: #807865; }
.time-rail::after { background: var(--gold); transform: scaleX(var(--time-progress, 0)); transform-origin: left; }
.time-rail button { position: relative; z-index: 1; background: transparent; border: 0; padding: 16px 0 0; color: #ccc9bc; min-height: 44px; min-width: 44px; font: .85rem Georgia, serif; }
.time-rail button::before { content: ''; position: absolute; top: 2px; left: calc(50% - 4px); width: 7px; height: 7px; border: 1px solid var(--gold); border-radius: 50%; background: var(--ink); }
.time-rail button[aria-current=date] { color: var(--gold); }
.time-rail button[aria-current=date]::before { background: var(--gold); }
.time-rail button:first-child { text-align: left; }
.time-rail button:last-child { text-align: right; }
.time-rail button:first-child::before { left: 0; }
.time-rail button:last-child::before { left: auto; right: 0; }
@media (max-width: 760px), (max-width: 1050px) and (max-aspect-ratio: 1/1) {
  .is-pinned .time-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; min-height: 0; }
  .time-year { font-size: clamp(2.4rem, 10vw, 3.5rem); }
  .time-detail { margin: .45rem 0; }
  .time-head h2 { max-width: 18ch; }
  .is-pinned .time-photo { object-fit: cover; }
}
@media (max-width: 760px) and (max-height: 690px) {
  .is-pinned .time-stage { padding: 6px 12px; gap: 5px; }
  .is-pinned .time-body { gap: 6px; }
  /* The date remains at the selected stop on the rail. Give that space to the photograph. */
  .is-pinned .time-year { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .is-pinned .time-caption h3 { font-size: 1.4rem; }
  .is-pinned .time-detail { margin: .3rem 0; font-size: .96rem; line-height: 1.3; }
  .is-pinned .time-views { margin: .2rem 0; }
}
