/*! post-motion v1 · Jay's sites · 27 Nov 2026
 * Each site sets its own palette on the post page, for example:
 *   :root { --pm-accent:#129994; --pm-accent-2:#cfa759; --pm-ink:#102a46; }
 * Defaults below are neutral. Everything is scoped to .pm-body and .pm-*.
 */
:where(:root) {
  --pm-accent: #0e7a76;
  --pm-accent-2: #cfa759;
  --pm-ink: #15191d;
  --pm-ink-2: #3c4650;
  --pm-muted: #66717c;
  --pm-card: #ffffff;
  --pm-soft: #eef5f4;
  --pm-line: #e2e4e6;
  --pm-on-accent: #ffffff;
  --pm-radius: 16px;
  --pm-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 10px 26px -14px rgb(0 0 0 / 0.22);
  --pm-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pm-font-display: inherit;
}

/* Reveal on scroll. Visible by default; hidden only once the script has run. */
.pm-js .pm-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.75s var(--pm-ease), transform 0.75s var(--pm-ease);
  transition-delay: calc(var(--pm-i, 0) * 70ms);
}
.pm-js .pm-reveal.pm-in {
  opacity: 1;
  transform: none;
}

/* Section headings: number and a growing accent line. */
.pm-body h2.pm-h2 {
  position: relative;
  padding-top: 1.15em;
}
.pm-body h2.pm-h2::before {
  content: attr(data-pm-section);
  position: absolute;
  top: 0;
  left: 0;
  font: 600 0.74rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
  color: var(--pm-accent);
}
.pm-body h2.pm-h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  margin-top: 0.45em;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--pm-accent), var(--pm-accent-2));
  transform-origin: 0 50%;
}
.pm-js .pm-body h2.pm-h2::after {
  transform: scaleX(0);
  transition: transform 0.9s var(--pm-ease) 0.25s;
}
.pm-js .pm-body h2.pm-h2.pm-in::after {
  transform: scaleX(1);
}

/* Numbered lists: step cards joined by a line that draws in. */
.pm-body ol.pm-steps {
  list-style: none;
  counter-reset: pm-step;
  padding-left: 0;
  margin-left: 0;
}
.pm-body ol.pm-steps > li {
  counter-increment: pm-step;
  position: relative;
  padding: 14px 16px 14px 3.3em;
  border: 1px solid var(--pm-line);
  border-radius: var(--pm-radius);
  background: var(--pm-card);
  box-shadow: var(--pm-shadow);
}
.pm-body ol.pm-steps > li + li {
  margin-top: 12px;
}
.pm-body ol.pm-steps > li::before {
  content: counter(pm-step);
  position: absolute;
  left: 0.85em;
  top: 0.9em;
  width: 1.75em;
  height: 1.75em;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.82em;
  font-weight: 700;
  background: var(--pm-accent);
  color: var(--pm-on-accent);
  box-shadow: 0 0 0 4px var(--pm-soft);
}
.pm-body ol.pm-steps > li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: calc(0.85em + 0.875em - 1px);
  top: calc(0.9em + 1.75em + 4px);
  width: 2px;
  height: calc(100% - 1.6em);
  background: linear-gradient(var(--pm-accent), var(--pm-line));
  transform-origin: 50% 0;
}
.pm-js .pm-body ol.pm-steps > li::after {
  transform: scaleY(0);
  transition: transform 0.7s var(--pm-ease) 0.35s;
}
.pm-js .pm-body ol.pm-steps > li.pm-in::after {
  transform: scaleY(1);
}
.pm-js .pm-body ol.pm-steps > li::before {
  transform: scale(0.4);
  transition: transform 0.5s var(--pm-ease) 0.15s;
}
.pm-js .pm-body ol.pm-steps > li.pm-in::before {
  transform: scale(1);
}

/* Images and figures ease in from a slight zoom. */
.pm-body .pm-media img,
.pm-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--pm-radius);
}
.pm-js .pm-media.pm-reveal img,
.pm-js .pm-figure.pm-reveal img {
  transform: scale(1.05);
  transition: transform 1.5s var(--pm-ease);
}
.pm-js .pm-media.pm-in img,
.pm-js .pm-figure.pm-in img {
  transform: scale(1);
}
.pm-figure {
  margin: 2em 0;
}
.pm-figure > img,
.pm-figure > a > img {
  border: 1px solid var(--pm-line);
  box-shadow: var(--pm-shadow);
}
.pm-figure figcaption,
.pm-caption {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--pm-muted);
}

.pm-body p.pm-caption {
  margin-top: -1.2em;
}

/* Plain bullet lists: accent dots that pop in with each item */
.pm-body ul.pm-bullets {
  list-style: none;
  padding-left: 0;
}
.pm-body ul.pm-bullets > li {
  position: relative;
  padding-left: 1.5em;
  margin-top: 0.55em;
}
.pm-body ul.pm-bullets > li::before {
  content: "";
  position: absolute;
  left: 0.2em;
  top: 0.68em;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--pm-accent);
  box-shadow: 0 0 0 4px var(--pm-soft);
  transform: scale(0);
  transition: transform 0.5s var(--pm-ease) calc(var(--pm-i, 0) * 80ms + 150ms);
}
.pm-body ul.pm-bullets > li.pm-in::before,
html:not(.pm-js) .pm-body ul.pm-bullets > li::before {
  transform: scale(1);
}

/* Stats: figures that count up. Every number needs a source in the post. */
.pm-stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 2em 0;
}
.pm-stat {
  position: relative;
  overflow: hidden;
  padding: 20px 20px 18px;
  border: 1px solid var(--pm-line);
  border-radius: var(--pm-radius);
  background: linear-gradient(160deg, var(--pm-soft), var(--pm-card) 70%);
}
.pm-stat::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--pm-accent), var(--pm-accent-2));
  transform-origin: 0 50%;
}
.pm-js .pm-stat::after {
  transform: scaleX(0);
  transition: transform 1.2s var(--pm-ease) 0.3s;
}
.pm-js .pm-stat.pm-in::after {
  transform: scaleX(1);
}
.pm-stats .pm-num {
  margin: 0;
  font-family: var(--pm-font-display);
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--pm-ink);
  font-variant-numeric: tabular-nums;
}
.pm-stats .pm-label {
  margin: 8px 0 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--pm-ink-2);
}
.pm-stats .pm-src {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--pm-muted);
}

/* Flow: a process as linked cards with a travelling pulse. */
ol.pm-flow {
  --pm-n: 4;
  position: relative;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  list-style: none;
  counter-reset: pm-flow;
  padding: 0;
  margin: 2em 0;
}
ol.pm-flow::before {
  content: '';
  position: absolute;
  left: 6%;
  right: 6%;
  top: 30px;
  height: 2px;
  background: var(--pm-line);
}
ol.pm-flow::after {
  content: '';
  position: absolute;
  top: 27px;
  left: 6%;
  width: 60px;
  height: 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, transparent, var(--pm-accent), var(--pm-accent-2));
  animation: pm-pulse 3.2s var(--pm-ease) infinite;
}
@keyframes pm-pulse {
  from { transform: translateX(0); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  to { transform: translateX(calc(var(--pm-w, 600px))); opacity: 0; }
}
ol.pm-flow > li {
  counter-increment: pm-flow;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 14px 14px 16px;
  border: 1px solid var(--pm-line);
  border-radius: var(--pm-radius);
  background: var(--pm-card);
  box-shadow: var(--pm-shadow);
}
ol.pm-flow > li::before {
  content: counter(pm-flow);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--pm-ink);
  color: var(--pm-card);
}
ol.pm-flow > li:last-child::before {
  background: var(--pm-accent);
  color: var(--pm-on-accent);
}
ol.pm-flow > li > b,
ol.pm-flow > li > strong {
  line-height: 1.3;
  color: var(--pm-ink);
}
ol.pm-flow > li > span {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--pm-muted);
}

/* Timeline: dated milestones, line fills as you scroll. */
ol.pm-timeline {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 2em 0;
}
ol.pm-timeline::before,
ol.pm-timeline::after {
  content: '';
  position: absolute;
  left: 11px;
  top: 6px;
  width: 2px;
}
ol.pm-timeline::before {
  bottom: 6px;
  background: var(--pm-line);
}
ol.pm-timeline::after {
  height: var(--pm-progress, 100%);
  background: linear-gradient(var(--pm-accent), var(--pm-accent-2));
}
.pm-js ol.pm-timeline::after {
  height: var(--pm-progress, 0%);
}
ol.pm-timeline > li {
  position: relative;
  margin: 0;
  padding: 0 0 26px 44px;
}
ol.pm-timeline > li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--pm-card);
  border: 3px solid var(--pm-accent);
  z-index: 1;
}
ol.pm-timeline > li[data-status='upcoming']::before {
  border-style: dashed;
  border-color: var(--pm-muted);
}
ol.pm-timeline > li[data-status='now']::before {
  background: var(--pm-accent);
  box-shadow: 0 0 0 5px var(--pm-soft);
}
ol.pm-timeline .pm-date {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pm-accent);
}
ol.pm-timeline > li > b:not(.pm-date),
ol.pm-timeline > li > strong {
  display: block;
  margin-top: 2px;
  color: var(--pm-ink);
}
ol.pm-timeline > li > span {
  display: block;
  margin-top: 4px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--pm-ink-2);
}

/* Compare: two columns side by side. */
.pm-compare {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 2em 0;
}
.pm-compare > div {
  padding: 18px 20px;
  border: 1px solid var(--pm-line);
  border-top: 4px solid var(--pm-accent);
  border-radius: var(--pm-radius);
  background: var(--pm-card);
}
.pm-compare > div:nth-child(2) {
  border-top-color: var(--pm-accent-2);
}
.pm-compare h3,
.pm-compare h4 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--pm-ink);
}
.pm-compare ul {
  margin: 0;
  padding-left: 1.1em;
}
.pm-compare li {
  margin: 0.3em 0;
  color: var(--pm-ink-2);
}

@media (max-width: 640px) {
  ol.pm-flow {
    grid-template-columns: 1fr;
  }
  ol.pm-flow::before {
    left: 29px;
    right: auto;
    top: 8px;
    bottom: 8px;
    width: 2px;
    height: auto;
  }
  ol.pm-flow::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pm-body ul.pm-bullets > li::before { transform: none; transition: none; }
  .pm-js .pm-reveal,
  .pm-js .pm-body h2.pm-h2::after,
  .pm-js .pm-body ol.pm-steps > li::after,
  .pm-js .pm-body ol.pm-steps > li::before,
  .pm-js .pm-stat::after,
  .pm-js .pm-media img,
  .pm-js .pm-figure img {
    opacity: 1;
    transform: none;
    transition: none;
  }
  ol.pm-flow::after {
    display: none;
  }
  .pm-js ol.pm-timeline::after {
    height: 100%;
  }
}
