/* timeline.css — the strip, the hand, the ruler and the detail view. Builds on opening.css (the sheet, the chrome, the grain). */
:root { --w: 320px; --row: 50%; --ink-soft: rgba(21, 20, 26, 0.55); }
html, body { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hand { mix-blend-mode: multiply; filter: url(#soak); }
.hand canvas { display: block; }

/* the head: the title written in the hand, the year that rolls */
.head { position: fixed; left: 22px; right: 22px; top: 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; z-index: 5; pointer-events: none; }
.title { margin: 0; font-size: 0; min-width: 0; }
.title canvas { height: 84px; width: auto; max-width: 100%; object-fit: contain; object-position: left top; }
.year { display: grid; justify-items: end; align-items: start; height: 132px; overflow: hidden; flex: none; }
.yc { grid-area: 1 / 1; display: block; height: 132px; width: auto; transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s linear; }
.yc.enter { transform: translateY(calc(var(--dir, 1) * 108%)); opacity: 0; transition: none; }
.yc.out { transform: translateY(calc(var(--dir, 1) * -108%)); opacity: 0; }

/* the stage and the strip */
.stage { position: fixed; inset: 0; overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; z-index: 2; transition: opacity 0.45s ease-out; }
.stage.grabbing { cursor: grabbing; }
html[data-detail="on"] .stage, html[data-detail="on"] .ruler, html[data-detail="on"] .caption, html[data-detail="on"] .head { opacity: 0; pointer-events: none; }
.head { transition: opacity 0.45s ease-out; }
.track { position: absolute; left: 0; top: var(--row); width: 0; height: 0; }
.slide { position: absolute; left: 0; top: 0; width: var(--w); perspective: 1000px; transform-style: preserve-3d; }   /* .in marks the slides near the view; nothing is hidden, so Tab reaches every photograph */
.content { position: relative; transform-style: preserve-3d; }
.moment { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; cursor: inherit; font: inherit; color: inherit; text-align: left; -webkit-tap-highlight-color: transparent; }
.moment:focus { outline: none; }
.moment:focus-visible .print { outline: 2px solid var(--ink); outline-offset: 6px; }
.print { display: block; position: relative; width: 100%; background: var(--paper-deep); box-shadow: 0 1px 1px rgba(21, 20, 26, 0.08), 0 10px 24px -14px rgba(21, 20, 26, 0.35); overflow: hidden; }
.print img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s ease-out; display: block; }
.print.loaded img { opacity: 1; }
.tag { position: absolute; left: 0; top: 100%; margin-top: 10px; font-size: 11px; letter-spacing: 0.04em; color: var(--chrome); white-space: nowrap; opacity: 0; transform: translateY(-6px); transition: opacity 0.5s, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: none; }
.slide:hover .tag, .moment:focus-visible + .tag { opacity: 1; transform: none; }
.moment.rise { animation: rise 1.1s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { transform: translateY(70vh); opacity: 0; } to { transform: none; opacity: 1; } }

/* a written card for a year without photographs */
.print.face { background: rgba(230, 235, 242, 0.55); box-shadow: inset 0 0 0 1px rgba(21, 20, 26, 0.12), 0 10px 24px -14px rgba(21, 20, 26, 0.3); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 7% 9%; box-sizing: border-box; }
.face .yr { height: 38%; width: 100%; }
.face .ln { height: 17%; width: 100%; margin-top: 3%; }
.face canvas { height: 100%; width: 100%; object-fit: contain; object-position: left center; }
.face .mono { margin: 6% 0 0; font-size: 10.5px; letter-spacing: 0.03em; color: var(--chrome); line-height: 1.35; }

/* the ruler: a quiet index with a live centre mark; one 11 px step for drawing and for position */
.ruler { position: fixed; left: 0; right: 0; bottom: 78px; height: 76px; z-index: 4; cursor: ew-resize; touch-action: none; transition: opacity 0.45s ease-out; }
.ruler canvas { display: block; width: 100%; height: 100%; }
.caption { position: fixed; left: 22px; right: 22px; bottom: 50px; margin: 0; text-align: center; font-size: 11.5px; letter-spacing: 0.04em; color: var(--chrome); z-index: 4; transition: opacity 0.45s ease-out; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caption b { font-weight: 500; color: var(--ink); }

/* the detail view: a photograph flown out of the strip */
.detail { position: fixed; inset: 0; z-index: 20; }
.detail[hidden] { display: none; }
.wash { position: absolute; inset: 0; background: rgba(246, 248, 252, 0.72); opacity: 0; transition: opacity 0.5s; }
.detail.on .wash { opacity: 1; }
.fig { position: absolute; margin: 0; transform-origin: 0 0; transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s; background: var(--paper-deep); box-shadow: 0 2px 3px rgba(21, 20, 26, 0.08), 0 30px 70px -30px rgba(21, 20, 26, 0.45); overflow: hidden; }
.fig.swap { opacity: 0; }
.fig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.fig .print { position: absolute; inset: 0; width: 100%; height: 100%; box-shadow: inset 0 0 0 1px rgba(21, 20, 26, 0.12); }
.fig .face .mono { font-size: 15px; }
.cap { position: absolute; left: 22px; right: 22px; bottom: 60px; margin: 0; display: flex; gap: 18px; align-items: center; justify-content: center; flex-wrap: wrap; opacity: 0; transform: translateY(12px); transition: opacity 0.5s 0.25s, transform 0.7s 0.25s cubic-bezier(0.16, 1, 0.3, 1); font-size: 11.5px; letter-spacing: 0.04em; color: var(--chrome); }
.detail.on .cap { opacity: 1; transform: none; }
.cap-year canvas { height: 38px; width: auto; display: block; }
.cap-text { width: 100%; text-align: center; margin: 0; color: var(--ink); opacity: 0.8; line-height: 1.5; }
.dbtn { position: absolute; top: 20px; margin: 0; padding: 0 0 2px; font: inherit; font-size: 11px; letter-spacing: 0.06em; color: var(--ink); background: none; border: 0; border-bottom: 1px solid rgba(21, 20, 26, 0.3); cursor: pointer; opacity: 0; transition: opacity 0.4s 0.3s; }
.detail.on .dbtn { opacity: 1; }
.dbtn:hover, .dbtn:focus-visible { border-color: var(--ink); outline: none; }
.close { left: 22px; }
.steps .step { right: 22px; } .steps .step#prev { right: 96px; }

/* the chrome: the label moves into the footer row */
.chrome { z-index: 6; }
.chrome .label { position: static; }
.help { position: fixed; left: 22px; bottom: 44px; max-width: 520px; padding: 10px 12px; font-size: 11px; line-height: 1.6; letter-spacing: 0.03em; color: var(--ink); background: rgba(246, 248, 252, 0.92); box-shadow: inset 0 0 0 1px rgba(21, 20, 26, 0.14); z-index: 30; }
.help[hidden] { display: none; }

/* phone */
@media (max-width: 649px) {
  :root { --row: 47%; }
  .head { left: 16px; right: 16px; top: 16px; gap: 14px; }
  .title canvas { height: 46px; }
  .year, .yc { height: 64px; }
  .tag { display: none; }
  .ruler { bottom: 64px; height: 64px; }
  .caption { left: 12px; right: 12px; bottom: 40px; font-size: 10px; }
  .cap { left: 14px; right: 14px; bottom: 44px; gap: 10px; font-size: 10.5px; }
  .cap-year canvas { height: 30px; }
  .dbtn { top: 16px; font-size: 10.5px; }
  .close { left: 16px; } .steps .step { right: 16px; } .steps .step#prev { right: 84px; }
  .help { left: 12px; right: 12px; bottom: 40px; max-width: none; }
}

/* reduced motion: the strip still moves, nothing lags, tilts, flies or rises */
@media (prefers-reduced-motion: reduce) {
  .yc, .fig, .cap, .stage, .ruler, .caption, .wash, .tag, .print img { transition: none; }
  .moment.rise { animation: none; }
}
