/* ============================================================
   Motion layer — optional.
   Delete this file, js/motion.js and the two lines that load them
   and the site is exactly as it was.

   Everything is scoped to html.motion, a class js/motion.js adds
   only when the visitor has NOT asked their system to reduce
   motion. So: reduced-motion users get the static site, and if the
   script fails to load nothing is hidden either.
   ============================================================ */

/* ── scroll progress ───────────────────────────────────── */

.motion .scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-400) 100%);
  z-index: 200;
  pointer-events: none;
  will-change: transform;
}

/* ── header compacts once you leave the top ────────────── */

.motion .site-header { transition: background-color .3s ease, box-shadow .3s ease; }
.motion .site-header .header-inner { transition: min-height .3s cubic-bezier(.2, .7, .3, 1); }
.motion .site-header .brand-mark { transition: width .3s cubic-bezier(.2, .7, .3, 1); }

.motion .site-header.compact {
  background: rgba(22, 24, 28, .94);
  backdrop-filter: saturate(160%) blur(10px);
  box-shadow: 0 8px 28px -14px rgba(0, 0, 0, .9);
}
.motion .site-header.compact .header-inner { min-height: 84px; }
.motion .site-header.compact .brand-mark { width: 38px; }

/* ── reveal primitives ─────────────────────────────────── */

.motion [data-anim] { opacity: 0; will-change: opacity, transform; }
.motion [data-anim="up"]    { transform: translateY(22px); }
.motion [data-anim="left"]  { transform: translateX(-24px); }
.motion [data-anim="right"] { transform: translateX(24px); }
.motion [data-anim="scale"] { transform: scale(.965); }

.motion [data-anim].shown {
  opacity: 1;
  transform: none;
  transition:
    opacity .62s cubic-bezier(.22, .68, .3, 1),
    transform .62s cubic-bezier(.22, .68, .3, 1);
  transition-delay: var(--anim-delay, 0ms);
}

/* images wipe open rather than fade — reads as fabrication */
.motion [data-anim="wipe"] { opacity: 1; clip-path: inset(0 0 100% 0); }
.motion [data-anim="wipe"].shown {
  clip-path: inset(0 0 0 0);
  transition: clip-path .78s cubic-bezier(.22, .68, .3, 1);
  transition-delay: var(--anim-delay, 0ms);
}

/* the rule under a section heading draws itself */
.motion .rule-head { position: relative; border-bottom-color: transparent; }
.motion .rule-head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 3px;
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.motion .section-dark .rule-head::after,
.motion .section-navy .rule-head::after { background: var(--blue-400); }
.motion .rule-head.shown::after {
  transform: scaleX(1);
  transition: transform .85s cubic-bezier(.22, .68, .3, 1);
}

/* ── hero entrance ─────────────────────────────────────── */

.motion .hero .mono,
.motion .hero h1,
.motion .hero .lede,
.motion .hero-actions,
.motion .hero .hero-figures,
.motion .page-hero .badge,
.motion .page-hero .mono,
.motion .page-hero h1,
.motion .page-hero p,
.motion .page-hero .hero-figures {
  opacity: 0;
  transform: translateY(18px);
  animation: scmEnter .8s cubic-bezier(.22, .68, .3, 1) forwards;
}
.motion .hero .mono,
.motion .page-hero .badge,
.motion .page-hero .mono          { animation-delay: .05s; }
.motion .hero h1,
.motion .page-hero h1             { animation-delay: .14s; }
.motion .hero .lede,
.motion .page-hero p              { animation-delay: .24s; }
.motion .hero-actions             { animation-delay: .34s; }
.motion .hero .hero-figures,
.motion .page-hero .hero-figures  { animation-delay: .42s; }

.motion .hero-media {
  opacity: 0;
  animation: scmEnterMedia 1s cubic-bezier(.22, .68, .3, 1) .18s forwards;
  will-change: transform;
}
.motion .hero-tag {
  opacity: 0;
  animation: scmEnter .6s cubic-bezier(.22, .68, .3, 1) .8s forwards;
}
.motion .stats {
  opacity: 0;
  animation: scmEnter .7s cubic-bezier(.22, .68, .3, 1) .5s forwards;
}

@keyframes scmEnter {
  to { opacity: 1; transform: none; }
}
@keyframes scmEnterMedia {
  from { opacity: 0; transform: translateY(26px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* ── card interaction ──────────────────────────────────── */

.motion .item-img { overflow: hidden; }
.motion .item-img img { transition: transform .5s cubic-bezier(.22, .68, .3, 1); }
.motion a.item:hover .item-img img { transform: scale(1.045); }

.motion a.item .cat-more { transition: transform .25s ease, color .18s ease; }
.motion a.item:hover .cat-more { transform: translateX(4px); }

.motion .dl-icon svg { transition: transform .3s cubic-bezier(.22, .68, .3, 1); }
.motion .dl:hover .dl-icon svg { transform: translateY(3px); }

/* nav underline sweeps in */
.motion .site-nav a:not(.nav-cta) { border-bottom-color: transparent; }
.motion .site-nav a:not(.nav-cta)::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .28s cubic-bezier(.22, .68, .3, 1);
  margin-top: 2px;
}
.motion .site-nav a:not(.nav-cta):hover::after,
.motion .site-nav a[aria-current="page"]::after { transform: scaleX(1); }

@media (max-width: 1000px) {
  .motion .site-nav a:not(.nav-cta)::after { display: none; }
  .motion .site-nav a:not(.nav-cta) { border-bottom-color: rgba(255, 255, 255, .08); }
}

/* ── table rows stagger ────────────────────────────────── */

.motion tbody tr[data-anim] { opacity: 0; transform: translateY(10px); }
.motion tbody tr[data-anim].shown {
  opacity: 1; transform: none;
  transition: opacity .4s ease, transform .4s ease;
  transition-delay: var(--anim-delay, 0ms);
}

/* counters hold their width while ticking */
[data-count] { font-variant-numeric: tabular-nums; }

/* ── part-number ticker ────────────────────────────────── */

.ticker {
  border-block: 1px solid var(--rule);
  background: var(--paper-2);
  overflow: hidden;
  padding-block: .75rem;
  position: relative;
}
.ticker::before, .ticker::after {
  content: "";
  position: absolute; top: 0; bottom: 0; width: 90px;
  z-index: 2; pointer-events: none;
}
.ticker::before { left: 0; background: linear-gradient(90deg, var(--paper-2), transparent); }
.ticker::after { right: 0; background: linear-gradient(270deg, var(--paper-2), transparent); }

.ticker-track {
  display: flex;
  gap: 2.6rem;
  width: max-content;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}
.ticker-track b { color: var(--blue); font-weight: 500; }

.motion .ticker-track { animation: scmSlide 100s linear infinite; }
.motion .ticker:hover .ticker-track { animation-play-state: paused; }

@keyframes scmSlide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* The nav sub-label hangs below its link, so it has no room once the header
   condenses. Fade it out with the shrink rather than let it clip. */
.motion .site-nav .nav-new span {
  transition: opacity .25s ease, visibility .25s ease;
}
.motion .site-header.compact .nav-new span {
  opacity: 0;
  visibility: hidden;
}

/* ── hero embers canvas (created by motion.js) ──────────── */
.hero-embers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
