/* Motion for the reading pages (2026-11-24). Linked by the pages that carry a plate: Work, About,
   Guides, Labs, Contact and the missing page. Home keeps its own (home.css). motion.js starts each drawing in view.

   Three things:
   1. The band under the navigation (the trajectory) opens once when the page arrives.
   2. Going from one of these pages to another cross-fades instead of flashing (view transitions,
      where the browser has them).
   3. The plate: one small drawing beside the page title, made for that page from the kit's own
      vocabulary: the rail and its marks (a diamond is a tested fix, an open diamond a guide, a dashed
      ring nothing yet), the rust dashed line that only ever means a limit, and the three objects of the
      atlas. Graphite ink on the sheet, blue-deep for the one part that matters. It draws once, then
      makes one movement that says what the page is about.

   Everything rests on its finished picture: under reduced motion, in print and before any keyframe
   runs, the plate is simply the drawing. Values come from brand/tokens.css. */

.page-head--plate { column-gap: var(--wp-12); grid-template-columns: minmax(0, 1fr) minmax(0, 22.5rem); }
.page-head--plate > * { grid-column: 1; }
.page-head--plate > .plate { align-self: end; grid-column: 2; grid-row: 1 / span 3; }
.plate { aspect-ratio: 360 / 200; color: var(--wp-ink); margin: 0; }
.plate svg { display: block; fill: none; height: 100%; overflow: visible; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; width: 100%; }
.pl-fill { fill: var(--wp-paper); }
.pl-ink { fill: var(--wp-ink); stroke: none; }
.pl-blue { stroke: var(--oa-blue-deep); }
.pl-blue-fill { fill: var(--oa-blue-deep); stroke: var(--oa-blue-deep); }
.pl-dot { fill: var(--oa-blue-deep); stroke: none; }
.pl-soft { stroke: var(--wp-muted); stroke-width: 1; }
.pl-hair { stroke: var(--wp-hair); stroke-width: 1; }
.pl-none { stroke: var(--wp-muted); stroke-dasharray: 3.2 2.8; }
/* The limit: rust, dashed, and nothing else on the page is rust. */
.pl-limit { stroke: var(--wp-rust); stroke-dasharray: 5 4; }
.pl-limit-fill { fill: var(--wp-rust); stroke: none; }
.pl-glow-a { stop-color: var(--oa-blue-deep); stop-opacity: 0; }
.pl-glow-b { stop-color: var(--oa-blue-deep); }
.pl-sweep, .pl-flow { opacity: 0; stroke: none; }
.pl-sweep { fill: url(#pl-glow); }
.pl-flow { fill: var(--wp-ink); }
.pl-flow--blue { fill: var(--oa-blue-deep); }
.pl-go1 { offset-path: path("M54 100 C 100 100, 104 52, 146 52"); }
.pl-out1 { offset-path: path("M223 52 H296"); }
.pl-go2 { offset-path: path("M54 100 C 100 100, 104 100, 146 100"); }
.pl-out2 { offset-path: path("M223 100 H296"); }
.pl-go3 { offset-path: path("M54 100 C 100 100, 104 148, 146 148"); }
.pl-out3 { offset-path: path("M223 148 H296"); }

@container page (max-width: 56rem) {
  .page-head--plate { grid-template-columns: minmax(0, 1fr); }
  .page-head--plate > .plate { grid-column: 1; grid-row: auto; justify-self: start; max-width: 15rem; width: 100%; }
}

@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .24s; }
  .site-header { view-transition-name: site-header; }
  ::view-transition-old(site-header) { display: none; }
  ::view-transition-new(site-header) { animation: none; }

  .site-header .field-band.is-playing svg { animation: pl-open 1.2s cubic-bezier(.6, 0, .2, 1) both; }

  /* Arriving. Delays step in tenths so a plate reads as one gesture, about a second and a half. */
  .plate.is-playing .pl-draw { animation: pl-draw .8s cubic-bezier(.5, 0, .2, 1) both; stroke-dasharray: 1; }
  .plate.is-playing .pl-pop { animation: pl-pop .5s cubic-bezier(.2, .9, .3, 1.35) both; transform-box: fill-box; transform-origin: center; }
  .plate.is-playing .pl-rise { animation: pl-rise .5s cubic-bezier(.2, .8, .3, 1) both; }
  .plate.is-playing .pl-fade { animation: pl-fade .5s both; }
  .plate.is-playing .pl-grow { animation: pl-grow .5s cubic-bezier(.2, .8, .3, 1) both; transform-box: fill-box; transform-origin: center; }
  .plate.is-playing .pl-wipe { animation: pl-open .8s cubic-bezier(.5, 0, .2, 1) both; }
  .plate.is-playing .t1 { animation-delay: .1s; } .plate.is-playing .t2 { animation-delay: .2s; } .plate.is-playing .t3 { animation-delay: .3s; } .plate.is-playing .t4 { animation-delay: .4s; }
  .plate.is-playing .t5 { animation-delay: .5s; } .plate.is-playing .t6 { animation-delay: .6s; } .plate.is-playing .t7 { animation-delay: .7s; } .plate.is-playing .t8 { animation-delay: .8s; }
  .plate.is-playing .t9 { animation-delay: .9s; } .plate.is-playing .t10 { animation-delay: 1s; } .plate.is-playing .t11 { animation-delay: 1.1s; } .plate.is-playing .t12 { animation-delay: 1.2s; }
  .plate.is-playing .t13 { animation-delay: 1.3s; } .plate.is-playing .t14 { animation-delay: 1.4s; } .plate.is-playing .t15 { animation-delay: 1.5s; } .plate.is-playing .t16 { animation-delay: 1.6s; }

  /* One pass through the idea, then the plate stays still. */
  .plate.is-playing .pl-sweep { animation: pl-sweep 2.8s 1.5s linear both; }
  .plate.is-playing .pl-answer { animation: pl-answer .32s linear both; transform-box: fill-box; transform-origin: center; }
  .plate.is-playing .pl-answer.a1 { animation-delay: 1.88s; }
  .plate.is-playing .pl-answer.a2 { animation-delay: 2.52s; }
  .plate.is-playing .pl-answer.a3 { animation-delay: 2.82s; }
  .plate.is-playing .pl-answer.a4 { animation-delay: 3.3s; }
  .plate.is-playing .pl-seek { animation: pl-seek 1.8s 1.6s linear; }
  .plate.is-playing .pl-lit:where(.l2) { animation: pl-lit 1s 1.6s linear; }
  .plate.is-playing .pl-lit:where(.l3) { animation: pl-lit 1s 2.3s linear; }
  .plate.is-playing .pl-lit:where(.l4) { animation: pl-lit 1s 3s linear; }
  .plate.is-playing .pl-flow { animation: pl-flow 1.8s 1.4s linear both; }
  .plate.is-playing .pl-flow.f2 { animation-delay: 1.6s; }
  .plate.is-playing .pl-flow.f3 { animation-delay: 1.8s; }
  .plate.is-playing .pl-flow.f4 { animation-delay: 2.2s; }
  .plate.is-playing .pl-flow.f5 { animation-delay: 2.4s; }
  .plate.is-playing .pl-flow.f6 { animation-delay: 2.6s; }
  .plate.is-playing .pl-post { animation: pl-post 2.9s 1.4s cubic-bezier(.5, 0, .3, 1) both; }
  .plate.is-playing .pl-post.back { animation-name: pl-post-back; }
  .plate.is-playing .pl-run { animation: pl-run 1.7s 1.7s ease-in-out; }
  .plate.is-playing .pl-run.r2 { animation-delay: 1.9s; }
  .plate.is-playing .pl-run.r3 { animation-delay: 2.1s; }
  .plate.is-playing .pl-run.r4 { animation-delay: 2.3s; }
  .plate.is-playing .pl-run.r5 { animation-delay: 2.5s; }

  .motion-away .plate.is-playing *, .plate.is-playing.is-away *,
  .motion-away .site-header .field-band.is-playing svg,
  .site-header .field-band.is-playing.is-away svg { animation-play-state: paused; }
}
@keyframes pl-open { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes pl-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pl-pop { from { opacity: 0; scale: 0; } }
@keyframes pl-rise { from { opacity: 0; translate: 0 10px; } }
@keyframes pl-fade { from { opacity: 0; } }
@keyframes pl-grow { from { opacity: 0; scale: 1 0; } }
@keyframes pl-sweep { 0% { opacity: 0; translate: 0 0; } 4% { opacity: 1; } 80% { opacity: 1; translate: 336px 0; } 85%, 100% { opacity: 0; translate: 336px 0; } }
@keyframes pl-answer { 0%, 100% { scale: 1; } 35% { scale: 1.6; } }
@keyframes pl-seek { to { stroke-dashoffset: -12; } }
@keyframes pl-lit { 0%, 22% { stroke: var(--oa-blue-deep); } 26%, 100% { stroke: var(--wp-ink); } }
@keyframes pl-flow { 0% { offset-distance: 0%; opacity: 0; } 6% { opacity: 1; } 38% { opacity: 1; } 44%, 100% { offset-distance: 100%; opacity: 0; } }
@keyframes pl-post { 0% { opacity: 0; translate: 0 0; } 5% { opacity: 1; } 34% { opacity: 1; translate: 188px 0; } 40%, 100% { opacity: 0; translate: 188px 0; } }
@keyframes pl-post-back { 0%, 44% { opacity: 0; translate: 0 0; } 49% { opacity: 1; } 78% { opacity: 1; translate: -188px 0; } 84%, 100% { opacity: 0; translate: -188px 0; } }
@keyframes pl-run { 0%, 100% { translate: 0 0; } 25% { translate: 0 -5px; } 70% { translate: 0 5px; } }
@media print { .plate { display: none; } }
