/* The shop's hero, its load, its glitches and the parts that open (Nov 18, the board "AT site: heroes, load and glitch"). Each choice is a setting on <html>
   (build.mjs MOTION: data-hero, data-intro, data-glitch, data-cards, data-pick, data-points). The drawing is Solutions' (consulting.css's sh-* and sc-*); the
   motion is the 12-4 kit's (its tokens, reveal and glitch; motion.js runs them). Every value a token; every delay counted in the kit's beat (--t-beat-s, 0.4 s at
   tempo 1), so the whole load follows the kit's grammar: frame, hero, details, each part starting before the last one ends. Reduced motion: a calm fade. */

/* ---- the hero: the chosen scene, sized like Solutions' --------------------------------------------------------------------------------- */
.hero-scene .hero-art { margin: 0; }
.hero-scene .art { max-width: 640px; border-radius: var(--r); }
@media (min-width: 1024px) { .hero-scene .hero-grid { grid-template-columns: 1.1fr 1fr; } }
.hero-scene .sh-win { fill: var(--sc-shopwin); }
.hero-scene h1 > span:first-child { display: block; }
.scene { display: none; }
:root[data-hero="lab"] .scene[data-scene="lab"], :root[data-hero="press"] .scene[data-scene="press"], :root[data-hero="door"] .scene[data-scene="door"] { display: block; }
/* what's in the windows: tees, the Ai chip, the rack, the press */
.sh-tee { fill: var(--sh-edge); }
.sh-tee.sh-acc { fill: var(--accent); }
.sh-chip { fill: var(--sh-wall); stroke: var(--sh-edge); stroke-width: 2; }
.sh-ai { fill: var(--accent-text); font: 700 15px var(--font-head); text-anchor: middle; }
.sh-unit { fill: var(--tile-2); stroke: var(--sh-edge); stroke-width: 1; }
.sh-led-a { fill: var(--sh-up); } .sh-led-b { fill: var(--sh-down); }
.sh-plate { transform-box: fill-box; }

/* ---- the load (data-intro) -------------------------------------------------------------------------------------------------------------- */
/* the art is there at once, its parts arrive on their own clocks (the rise on the figure would only blur them) */
.load .hero-scene .hero-art[data-rise] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  /* draw: the sky, then the far towers and the near ones rise from the street, the two shops land, the thread stitches across and the tee rides it, the
     title lands, the words and buttons follow, and last the data line lights over the roofs (the settle) */
  :root:not(.less-motion)[data-intro="draw"] .scene { animation: mo-fade var(--t-beat-s) var(--ease-out) both; }
  :root:not(.less-motion)[data-intro="draw"] .scene .sc-row { transform-box: view-box; animation: mo-up calc(var(--t-beat-s) * 2) var(--ease-out) both; }
  :root:not(.less-motion)[data-intro="draw"] .scene .sc-row-far { animation-delay: calc(var(--t-beat-s) * .25); }
  :root:not(.less-motion)[data-intro="draw"] .scene .sc-row-near { animation-delay: calc(var(--t-beat-s) * .7); }
  :root:not(.less-motion)[data-intro="draw"] .scene .sh-shop { transform-box: fill-box; transform-origin: 50% 100%; animation: mo-land calc(var(--t-beat-s) * 1.5) var(--ease-land) both; }
  :root:not(.less-motion)[data-intro="draw"] .scene .sh-shop-1 { animation-delay: calc(var(--t-beat-s) * 1.2); }
  :root:not(.less-motion)[data-intro="draw"] .scene .sh-shop-2 { animation-delay: calc(var(--t-beat-s) * 1.6); }
  :root:not(.less-motion)[data-intro="draw"] .scene .sh-thread { animation-delay: calc(var(--t-beat-s) * 2.4); }
  :root:not(.less-motion)[data-intro="draw"] .scene .sh-tag { animation-delay: calc(var(--t-beat-s) * 2.6); }
  :root:not(.less-motion)[data-intro="draw"] .scene .sh-knot { animation: mo-fade var(--t-beat-s) var(--ease-out) calc(var(--t-beat-s) * 2.4) both; }
  :root:not(.less-motion)[data-intro="draw"] .scene .sh-plate { animation: mo-press calc(var(--t-beat-s) * 2) var(--ease-in-out) calc(var(--t-beat-s) * 4) both; }
  :root:not(.less-motion)[data-intro="draw"] .scene g[filter], :root:not(.less-motion)[data-intro="draw"] .scene .sh-port { animation: mo-fade calc(var(--t-beat-s) * 2) var(--ease-out) calc(var(--t-beat-s) * 6) both; }
  :root:not(.less-motion)[data-intro="draw"].load .hero-scene .lede { transition-delay: calc(var(--t-beat-s) * 3.4); }
  :root:not(.less-motion)[data-intro="draw"].load .hero-scene .actions { transition-delay: calc(var(--t-beat-s) * 4); }

  /* boot: the shop powers on. The kicker types, the art flickers on in held steps (the kit's stepped curve), the lit windows and the lights come on one beat
     apart, the title slams, the data line starts last */
  :root:not(.less-motion)[data-intro="boot"] .scene { animation: mo-on calc(var(--t-beat-s) * 2) var(--ease-step) calc(var(--t-beat-s) * .5) both; }
  :root:not(.less-motion)[data-intro="boot"] .scene .sc-lit, :root:not(.less-motion)[data-intro="boot"] .scene .sh-led { animation: mo-on var(--t-beat-s) var(--ease-step) calc(var(--t-beat-s) * 3) both; }
  :root:not(.less-motion)[data-intro="boot"] .scene .sh-led-b { animation-delay: calc(var(--t-beat-s) * 3.5); }
  :root:not(.less-motion)[data-intro="boot"] .scene .sh-thread, :root:not(.less-motion)[data-intro="boot"] .scene .sh-tag { animation-delay: calc(var(--t-beat-s) * 3); }
  :root:not(.less-motion)[data-intro="boot"] .scene g[filter] { animation: mo-on calc(var(--t-beat-s) * 2) var(--ease-step) calc(var(--t-beat-s) * 5) both; }
  :root:not(.less-motion)[data-intro="boot"].load .hero-scene .lede { transition-delay: calc(var(--t-beat-s) * 4); }
  :root:not(.less-motion)[data-intro="boot"].load .hero-scene .actions { transition-delay: calc(var(--t-beat-s) * 4.5); }

  /* calm: today's rise, the art and words together; the title's words come out of a blur (motion.js) */
  :root:not(.less-motion)[data-intro="calm"] .scene { animation: mo-fade calc(var(--t-beat-s) * 1.5) var(--ease-out) both; }
}
@keyframes mo-fade { from { opacity: 0; } }
@keyframes mo-up { from { opacity: 0; transform: translateY(60px); } }
@keyframes mo-land { from { opacity: 0; transform: translateY(14px) scale(.92); } 40% { opacity: 1; } }
@keyframes mo-on { 0% { opacity: 0; } 30% { opacity: .7; } 45% { opacity: .1; } 70% { opacity: .9; } 100% { opacity: 1; } }
@keyframes mo-press { 0%, 100% { transform: none; } 40%, 60% { transform: translateY(12px); } }
/* less motion, from the device or the preview's ?less=1: the drawing is still, resting where it settles (the tag by our shop), and the hero fades in once */
@media (prefers-reduced-motion: reduce) {
  .hero-scene .hero-art { animation: mo-fade var(--t-beat) var(--ease-out) both; }
}
.less-motion .hero-scene .hero-art { animation: mo-fade var(--t-beat) var(--ease-out) both; }
.less-motion .scene *, .less-motion .scene { animation: none; transition: none; }
.less-motion.load [data-rise] { transform: none; }

/* ---- the parts that open (data-cards, data-pick, data-points) -------------------------------------------------------------------------- */
/* a shirt card under a pointer. lift: today's (site.css). swing: the tee swings from its top like a hang tag on a rail and settles. peek: the tee lifts and its
   line slides up into view (the line waits below the tee until then; on touch it simply shows). */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :root:not(.less-motion)[data-cards="swing"] .tee-card .tee { transform-origin: 50% 0; }
  :root:not(.less-motion)[data-cards="swing"] .tee-card:hover .tee { transform: none; animation: mo-swing calc(var(--t-sheet) * 4) var(--ease-out) both; }
  :root:not(.less-motion)[data-cards="peek"] .tee-card .tee-line { opacity: .0; transform: translateY(var(--rise)); transition: opacity var(--t-ui) var(--ease-out), transform var(--t-ui) var(--ease-out); }
  :root:not(.less-motion)[data-cards="peek"] .tee-card:is(:hover, :focus-visible) .tee-line { opacity: 1; transform: none; }
}
:root[data-cards="lift"] .tee-card .tee { transform-origin: 50% 50%; }   /* lift: site.css's hover, as today */
/* the preview's ?demo=1 (motion.js): the same, on the card that takes .mo-demo, so a board's frame on a phone shows it */
@media (prefers-reduced-motion: no-preference) {
  :root[data-demo]:not(.less-motion)[data-cards="lift"] .tee-card.mo-demo .tee { transform: translateY(-4px) rotate(-1.5deg); }
  :root[data-demo]:not(.less-motion)[data-cards="swing"] .tee-card.mo-demo .tee { transform-origin: 50% 0; animation: mo-swing calc(var(--t-sheet) * 4) var(--ease-out) both; }
  :root[data-demo]:not(.less-motion)[data-cards="peek"] .tee-card .tee-line { opacity: 0; transform: translateY(var(--rise)); transition: opacity var(--t-ui) var(--ease-out), transform var(--t-ui) var(--ease-out); }
  :root[data-demo]:not(.less-motion)[data-cards="peek"] .tee-card.mo-demo .tee-line { opacity: 1; transform: none; }
}
@keyframes mo-swing { 0% { transform: rotate(0); } 20% { transform: rotate(5deg); } 45% { transform: rotate(-3.5deg); } 70% { transform: rotate(1.5deg); } 100% { transform: rotate(0); } }

/* a picker's chip when picked. pop: it springs on the kit's land curve. stitch: a dashed thread stitches around it, the brand's thread. */
.pick [role="radio"] { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  :root:not(.less-motion)[data-pick="pop"] .pick [role="radio"][aria-checked="true"] { animation: mo-pop calc(var(--t-beat-s) * 1.2) var(--ease-land) both; }
  :root:not(.less-motion)[data-pick="stitch"] .pick [role="radio"][aria-checked="true"]::after { animation: mo-stitch calc(var(--t-beat-s) * 1.5) var(--ease-out) both; }
}
@keyframes mo-pop { from { transform: scale(.9); } }
:root[data-pick="stitch"] .pick [role="radio"][aria-checked="true"]::after { content: ""; position: absolute; inset: -5px; border: 2px dashed var(--accent-text); border-radius: inherit; pointer-events: none; }
@keyframes mo-stitch { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }

/* the privacy points as they reach the screen (site.css's rise puts .in on each). rise: today's. stitch: a dashed thread runs round each card, then lets go.
   redact: each point's words start under a black bar that pulls away (nothing here reports on you). */
.points li { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  :root:not(.less-motion)[data-points="stitch"] .points li::after { content: ""; position: absolute; inset: -1px; border: 2px dashed var(--accent-text); border-radius: inherit; pointer-events: none; opacity: 0; }
  :root:not(.less-motion)[data-points="stitch"] .points li.in::after { animation: mo-stitch-round calc(var(--t-beat-s) * 3) var(--ease-out) calc(var(--t-beat-s) * .5) both; }
  :root:not(.less-motion)[data-points="redact"] .points p { position: relative; }
  :root:not(.less-motion)[data-points="redact"] .points p::after { content: ""; position: absolute; inset: 0; background: var(--ink); border-radius: 2px; transform-origin: 100% 50%; }
  :root:not(.less-motion)[data-points="redact"] .points li.in p::after { animation: mo-unredact calc(var(--t-beat-s) * 1.5) var(--ease-in-out) calc(var(--t-beat-s) * 1.5) both; }
}
:root[data-points="rise"] .points li::after { content: none; }   /* rise: site.css's, as today, nothing added */
@keyframes mo-stitch-round { 0% { opacity: 1; clip-path: inset(0 100% 0 0); } 50% { opacity: 1; clip-path: inset(0); } 100% { opacity: 0; clip-path: inset(0); } }
@keyframes mo-unredact { to { transform: scaleX(0); } }
/* less motion: the cards, chips and points just are; the stitch around a picked chip stays drawn, still */
@media (prefers-reduced-motion: reduce) {
  .tee-card .tee, .pick [role="radio"], .points li { animation: none; }
}
.less-motion .tee-card .tee, .less-motion .pick [role="radio"], .less-motion .pick [role="radio"]::after { animation: none; }
