/* The transition vocabulary, presentation half. Paired with transitions.js.
   Nothing here is page-specific: a page supplies its own colours through the
   tokens below and its own layout around these. */

:root {
  /* the mark's four facet colours, used as light and never as the mark */
  --tx-facets: linear-gradient(90deg, #3E4C7E, #5A5FA7, #7076B6, #AAADD1);
  --tx-line: #5a5fa7;
  --tx-line-soft: #aaadd1;
}

/* 1. LIFT */
.tx-lift { position: relative; border-radius: 26px 26px 0 0; margin-top: -30px; box-shadow: 0 -28px 60px rgb(0 0 0 / 0.4); }

/* 2. FRAME and 7. APERTURE share a bed: a full-bleed image under type */
.tx-bed { position: relative; overflow: hidden; }
.tx-bed > .tx-bg { position: absolute; inset: 0; }
.tx-bed > .tx-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tx-bed > .tx-veil { position: absolute; inset: 0; }
.tx-bed > .tx-in { position: relative; }

/* 3. THREAD */
.tx-thread { position: relative; }
.tx-thread > i { position: absolute; top: 0; width: 3px; height: 0; margin-left: -1.5px; border-radius: 2px;
  background: linear-gradient(rgb(90 95 167 / 0.32), var(--tx-line)); }
.tx-fork { position: relative; height: 78px; }
.tx-fork i { position: absolute; background: linear-gradient(var(--tx-line), var(--tx-line-soft)); border-radius: 2px; }
.tx-fork .tx-drop { top: 0; width: 3px; height: 0; margin-left: -1.5px; }
.tx-fork .tx-bar { top: 44px; height: 2px; background: var(--tx-line-soft); transform: scaleX(0); }
.tx-fork .tx-leg { top: 44px; width: 2px; height: 0; margin-left: -1px; }

/* 4. WIPE */
.tx-wipe { position: relative; }
.tx-wipe > .tx-ground { position: absolute; inset: 0; }
.tx-wipe > .tx-edge { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -3px; background: var(--tx-facets); opacity: 0; }
.tx-wipe > .tx-in { position: relative; }

/* 5. HAND-OFF */
.tx-handoff { position: relative; }
.tx-flyer { position: absolute; margin: 0; white-space: nowrap; will-change: transform; pointer-events: none; }
.tx-ghost { visibility: hidden; }
/* the two ends of a hand-off: at rest only the destination is shown, so a
   reduced-motion reader gets the same information once rather than twice.
   Without script there is no flyer, so both ends are shown as written. */
.tx-from, .tx-to { visibility: hidden; }
html:not(.js) .tx-from, html:not(.js) .tx-to { visibility: visible; }

/* 6. FLOOD */
.tx-flood { position: relative; }
.tx-flood > .tx-ground { position: absolute; inset: 0; }
.tx-flood > .tx-in { position: relative; }

/* 8. HOLD. A rule and a gap, and nothing else. */
.tx-hold { border-top: 1px solid currentColor; opacity: 0.14; margin: 0; }

/* 9. RAIL */
.tx-rail { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 2px; background: rgb(245 247 250 / 0.14); }
.tx-rail > i { position: absolute; left: 0; width: 3px; border-radius: 2px; background: var(--tx-facets); }
.js .tx-rail > i { transition: top 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), height 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }

/* Rest states. Every move has one, and it carries the same meaning the move
   did: a reduced-motion reader sees connected static states, not a stop. */
@media (prefers-reduced-motion: reduce) {
  .tx-lift { transform: none !important; border-radius: 26px 26px 0 0 !important; }
  .tx-bed > .tx-bg { clip-path: none !important; }
  .tx-bed > .tx-veil, .tx-bed > .tx-in, .tx-wipe > .tx-in, .tx-flood > .tx-in { opacity: 1 !important; }
  .tx-wipe > .tx-ground { clip-path: none !important; }
  .tx-wipe > .tx-edge { display: none; }
  .tx-flood > .tx-ground { clip-path: none !important; }
  .tx-flyer { display: none; }
  .tx-ghost { visibility: visible; }
  .tx-from { display: none; }
  .tx-to { visibility: visible; }
  .tx-thread > i { height: 100% !important; }
  .tx-fork .tx-drop { height: 44px !important; }
  .tx-fork .tx-bar { transform: scaleX(1) !important; }
  .tx-fork .tx-leg { height: 34px !important; }
  .js .tx-rail > i { transition: none; }
}

/* --------------------------------------------------------------------------
   BATCH TWO, proposed. Presentation halves of moves 10 to 15.
   -------------------------------------------------------------------------- */

/* 10. UNDERCUT */
.tx-undercut { position: relative; overflow: hidden; }
.tx-undercut > .tx-under, .tx-undercut > .tx-over { position: absolute; inset: 0; }
.tx-undercut > .tx-over { z-index: 2; will-change: transform; }

/* 11. COLUMN */
.tx-column { position: relative; overflow: hidden; }
.tx-column > .tx-cols { position: absolute; inset: 0; display: flex; }
.tx-column > .tx-cols i { flex: 1; transform: scaleY(0); transform-origin: 50% 0; }
.tx-column > .tx-in { position: relative; opacity: 0; }

/* 12. MERIDIAN */
.tx-meridian { position: sticky; top: calc(50% - 1px); z-index: 40; display: block; height: 2px;
  margin-bottom: -2px; background: rgb(170 173 209 / 0.3); pointer-events: none; }
.tx-meridian.oncream { background: rgb(90 95 167 / 0.28); }
.tx-meridian em { display: block; height: 2px; width: 0; background: var(--tx-facets); }

/* 13. TRADE */
.tx-trade { position: relative; }
.tx-trade > .tx-pin { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.tx-trade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tx-trade img.tx-plate-b { opacity: 0; }

/* 14. SETTLE. 15 October, the owner, twice: the heading closing up from
   wide letter spacing "lands weirdly from the right" and "just looks
   strange". The settle is now a short rise into place with the type already
   set at its own spacing: the heading arrives, it does not assemble. */
.tx-settle { opacity: 0; transform: translateY(14px);
  transition: transform 0.9s cubic-bezier(0.16, 0.8, 0.24, 1), opacity 0.6s; }
.tx-settle.settled { opacity: 1; transform: none; }

/* 15. RATCHET */
.tx-ratchet { position: relative; }
.tx-ratchet > .tx-pin { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.tx-ratchet .tx-state { opacity: 0; transition: opacity 0.28s cubic-bezier(0.6, 0, 0.4, 1); }
.tx-ratchet .tx-state.on { opacity: 1; }

/* 18. PLAN */
.tx-plan { position: relative; }
.tx-plan .tx-mark { position: absolute; opacity: 0;
  border-left: 2px solid currentColor; border-right: 2px solid currentColor; border-top: 2px solid currentColor;
  height: calc(30px + var(--tx-plan-drop, 0px)); }
.tx-plan .tx-mark > b { position: absolute; left: 0; top: -24px; white-space: nowrap; }
.tx-plan .tx-floor { position: absolute; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: 0 50%; }

/* 19. DEPTH */
.tx-depth { position: relative; }
.tx-depth > .tx-back { transform-origin: 50% 40%; will-change: transform, opacity; }

/* 20. LEDGER */
.tx-ledger { position: relative; }
.tx-ledger > .tx-spine { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: currentColor; transform: scaleY(0); transform-origin: 50% 0; }
.tx-ledger .tx-row { opacity: 0; transform: translateY(8px); transition: opacity .38s ease, transform .42s cubic-bezier(.2,.7,.2,1); }
.tx-ledger .tx-row.tx-on { opacity: 1; transform: none; }

/* 21. SWAP */
.tx-swap { position: relative; }
.tx-swap .tx-a, .tx-swap .tx-b { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .tx-plan .tx-mark { opacity: 1 !important; }
  .tx-plan .tx-floor { transform: none !important; }
  .tx-depth > .tx-back { transform: none !important; opacity: 1 !important; }
  .tx-ledger > .tx-spine { transform: scaleY(1) !important; }
  .tx-ledger .tx-row { opacity: 1 !important; transform: none !important; }
  .tx-swap .tx-a, .tx-swap .tx-b { transform: none !important; }
  .tx-undercut > .tx-over { transform: translateY(-100%) !important; }
  .tx-column > .tx-cols i { transform: scaleY(1) !important; }
  .tx-column > .tx-in { opacity: 1 !important; }
  .tx-meridian em { width: 100% !important; }
  .tx-trade img.tx-plate-b { opacity: 1 !important; }
  /* the rest state alone is not enough: the transition is still declared, so
     a page that adds .settled at load still animates. Nothing runs here. */
  .tx-settle { opacity: 1; transform: none; transition: none !important; }
  .tx-ratchet .tx-state:first-child { opacity: 1; }
}

/* 22. ADMIT */
.tx-admit { position: relative; }
.tx-admit .tx-stem, .tx-admit .tx-tail { position: absolute; left: 50%; width: 3px; margin-left: -1.5px; height: 0;
  background: linear-gradient(var(--tx-line-soft), var(--tx-line)); border-radius: 2px; }
.tx-admit .tx-bound { position: absolute; left: 0; right: 0; height: 2px; opacity: 0; }
.tx-admit .tx-bound > i { position: absolute; top: 0; height: 2px; width: 50%; background: currentColor; opacity: 0.34; }
.tx-admit .tx-bound > i.tx-l { left: 0; }
.tx-admit .tx-bound > i.tx-r { right: 0; }
.tx-admit .tx-bound > b { position: absolute; right: 0; top: 8px; font-weight: 400; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .tx-admit .tx-stem { height: 54px !important; }
  .tx-admit .tx-tail { height: 62px !important; }
  .tx-admit .tx-bound { opacity: 1 !important; }
  .tx-admit .tx-bound > i { width: 50% !important; }
}

/* ---------------------------------------------------------------------------
   NO JAVASCRIPT. Every move above hides or displaces something and then puts it
   back as the reader scrolls. If the module never runs, those hidden states are
   all there is, and a page can end up with no heading, no rows and no people on
   it. Each page was overriding this for itself, and forgetting to is a silent
   failure that only a no-script pass catches, so the rest states live here with
   the moves they belong to.

   Every page's module adds .js to the root element as its first act, so these
   apply only when it has not run. They are the same rest states the
   reduced-motion block above settles to.
   -------------------------------------------------------------------------- */
html:not(.js) .tx-lift { transform: none; border-radius: 26px 26px 0 0; margin-top: 0; }
html:not(.js) .tx-bed > .tx-bg { clip-path: none; }
html:not(.js) .tx-bed > .tx-veil, html:not(.js) .tx-bed > .tx-in,
html:not(.js) .tx-wipe > .tx-in, html:not(.js) .tx-flood > .tx-in { opacity: 1; }
html:not(.js) .tx-wipe > .tx-ground, html:not(.js) .tx-flood > .tx-ground { clip-path: none; }
html:not(.js) .tx-wipe > .tx-edge { display: none; }
html:not(.js) .tx-flyer { display: none; }
html:not(.js) .tx-ghost { visibility: visible; }
html:not(.js) .tx-from { display: none; }
html:not(.js) .tx-to { visibility: visible; }
html:not(.js) .tx-thread > i { height: 100%; }
html:not(.js) .tx-fork .tx-drop { height: 44px; }
html:not(.js) .tx-fork .tx-bar { transform: scaleX(1); }
html:not(.js) .tx-fork .tx-leg { height: 34px; }
html:not(.js) .tx-undercut > .tx-over { transform: translateY(-100%); }
html:not(.js) .tx-column > .tx-cols i { transform: scaleY(1); }
html:not(.js) .tx-column > .tx-in { opacity: 1; }
html:not(.js) .tx-meridian em { width: 100%; }
html:not(.js) .tx-trade img.tx-plate-b { opacity: 1; }
html:not(.js) .tx-settle { opacity: 1; transform: none; }
html:not(.js) .tx-ratchet .tx-state:first-child { opacity: 1; }
html:not(.js) .tx-plan .tx-mark { opacity: 1; }
html:not(.js) .tx-plan .tx-floor { transform: none; }
html:not(.js) .tx-depth > .tx-back { transform: none; opacity: 1; }
html:not(.js) .tx-ledger > .tx-spine { transform: scaleY(1); }
html:not(.js) .tx-ledger .tx-row { opacity: 1; transform: none; }
html:not(.js) .tx-swap .tx-a, html:not(.js) .tx-swap .tx-b { transform: none; }
html:not(.js) .tx-admit .tx-stem { height: 54px; }
html:not(.js) .tx-admit .tx-tail { height: 62px; }
html:not(.js) .tx-admit .tx-bound { opacity: 1; }
html:not(.js) .tx-admit .tx-bound > i { width: 50%; }
