/* Shared motion rules (docs/superpowers/specs/2026-11-19-home-and-motion-design.md).
   Content is visible by default; motion.js adds .motion-on to <html> once it runs, and only then are
   reveal targets hidden until they enter view. A failed script therefore leaves the page readable. */
/* motion.js puts .rv on each target it watches; only those are hidden, so content a script inserts later shows. */
.motion-on .rv{opacity:0;translate:0 24px;transition:opacity var(--t-slow) var(--e-out),translate var(--t-slow) var(--e-out),transform var(--t-med) var(--e-out),box-shadow var(--t-med) var(--e-out);transition-delay:calc(var(--i,0)*var(--stagger)),calc(var(--i,0)*var(--stagger)),0s,0s}
.motion-on .rv.in{opacity:1;translate:none}

/* Site-wide, CSS only (project 2). Pages cross-fade into each other where the browser supports it; elsewhere
   the link is a normal page load. Buttons answer a press, and shop notices slide in, also after a cart update. */
@media (prefers-reduced-motion:no-preference){
  @view-transition{navigation:auto}
  ::view-transition-old(root),::view-transition-new(root){animation-duration:var(--t-med)}
  .btn:active,.button:active{scale:.96}
  .woocommerce-message,.woocommerce-error,.woocommerce-info{animation:note-in var(--t-slow) var(--e-out) both}
}
@keyframes note-in{from{opacity:0;translate:0 -14px}}
.tilt{transform:perspective(900px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));transition:transform var(--t-med) var(--e-out)}
/* .magnetic is a JS hook only: base.css .btn already moves by --mx/--my. */
@media (prefers-reduced-motion:reduce){
  .motion-on .rv{opacity:1;translate:none;transition:none}
  .tilt{transform:none}
}

/* Shop extras moved from the home page (inc/shop-extras.php). */
.promo-banner{margin-block-end:18px;grid-template-columns:1fr}.promo-banner h2{font-size:clamp(24px,3.4vw,38px);font-weight:900}
.woocommerce .finder{margin-block-end:22px}

/* Home page additions (front-page.php). */
.doors.four{grid-template-columns:repeat(4,1fr)}
.doors.four .door{min-height:200px}
@media (max-width:1100px){.doors.four{grid-template-columns:repeat(2,1fr)}}
@media (max-width:560px){.doors.four{grid-template-columns:1fr}.doors.four .door{min-height:0}}
.hero .hero-cta{display:flex;flex-wrap:wrap;gap:10px;margin-top:24px}
.chooser{border:0;border-radius:var(--r-l);padding:28px;max-width:min(680px,calc(100% - 32px));background:var(--bg);color:var(--ink);box-shadow:var(--shadow)}
.chooser::backdrop{background:rgba(20,33,61,.5);backdrop-filter:blur(6px)}
.chooser h2{font-size:22px;font-weight:800;margin-block-end:16px}
.chooser-doors{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media (max-width:560px){.chooser-doors{grid-template-columns:1fr}}
.chooser .door{min-height:0}
.chooser-x{position:absolute;inset-block-start:10px;inset-inline-end:14px;border:0;background:none;font-size:26px;line-height:1;color:var(--muted);cursor:pointer}
/* Phone stepper. home.js adds .journey-flow on phones when motion runs: the picture sticks under the top edge
   and the steps scroll beneath it, so each step is read beside its picture. Nothing is pinned, because the
   column is taller than a real phone's viewport. Without the class (no scripts, reduced motion) the plain
   stacked layout stays and every step keeps its text. */
@media (max-width:900px){
  #journey.journey-flow .steps-wrap>div:first-child{display:contents}
  #journey.journey-flow .sec-head{margin-bottom:0}
  #journey.journey-flow .viz{order:1;position:sticky;inset-block-start:12px;z-index:2;aspect-ratio:auto;height:32vh;transition:inset-block-start .45s var(--e-out)}
  /* When the header is showing (scrolling up), the picture sits below it, not under it. 66px is the header's height. */
  body:has(.hdr:not(.hide)) #journey.journey-flow .viz{inset-block-start:calc(78px + env(safe-area-inset-top,0px))}
  #journey.journey-flow .rail{order:2}
  #journey.journey-flow .steps-wrap>div:first-child>p{order:3}
}
/* Colour swatches built by home.js; .sw alone means the product-card colour row (shop.css). */
.sws .sw{display:block;width:40px;height:40px;padding:0;border-radius:50%;border:2px solid var(--line);cursor:pointer;transition:transform var(--t-fast) var(--e-out),box-shadow var(--t-fast) var(--e-out)}
.sws .sw:hover,.sws .sw:focus-visible{transform:scale(1.1);box-shadow:var(--shadow)}
