/* LayerUp motion layer. Loaded on every page after styles.css (see tools/gen-pages.sh).
   Everything is progressive enhancement, and all motion stops under prefers-reduced-motion
   (styles.css also has a global kill switch). */

:root { --spring: linear(0, 0.36 12%, 1.1 30%, 0.96 48%, 1.01 68%, 1); }

/* ---------- Product page: the picked color tints the page (js/pages.js sets --pdp-tint) ---------- */
@property --pdp-tint { syntax: "<color>"; inherits: true; initial-value: transparent; }
body[data-page="product"] { transition: --pdp-tint 0.5s ease; }
body[data-page="product"] main {
  background: linear-gradient(180deg, color-mix(in srgb, var(--pdp-tint) 13%, transparent), transparent 620px);
}

/* ---------- Ticker (home, under the hero) ---------- */
.ticker {
  position: relative; display: flex; align-items: center; overflow: hidden;
  border-block: 1px solid var(--line); background: var(--surface);
  font: 600 13px/1 var(--font-display, var(--font-body)); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2);
}
.ticker + .section { padding-top: var(--s7, 48px); }
.ticker-track { display: flex; width: max-content; animation: lu-ticker 46s linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track, .ticker.is-paused .ticker-track { animation-play-state: paused; }
.ticker-list { display: flex; flex: none; margin: 0; padding: 0; list-style: none; }
.ticker-list li { display: flex; align-items: center; gap: 18px; padding: 13px 0 13px 18px; white-space: nowrap; }
.ticker-list li::after { content: ""; width: 14px; height: 9px; flex: none; border-radius: 2px;
  background: linear-gradient(var(--accent-brand, var(--accent)) 0 3px, transparent 3px 6px, var(--accent-brand, var(--accent)) 6px 9px); }
.ticker-pause {
  position: absolute; right: 0; top: 0; bottom: 0; z-index: 1; width: 44px; display: grid; place-items: center;
  border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
}
.ticker-pause:hover { color: var(--ink); }
.ticker-pause:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
.ticker-pause i { width: 10px; height: 12px; border-inline: 3px solid currentColor; }
.ticker.is-paused .ticker-pause i { width: 0; height: 0; border: 6px solid transparent; border-left: 10px solid currentColor; border-right: 0; }
@keyframes lu-ticker { to { translate: -50% 0; } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; width: auto; flex-wrap: wrap; }
  .ticker-list[aria-hidden="true"], .ticker-pause { display: none; }
  .ticker-list { flex-wrap: wrap; padding-right: 18px; }
}

/* ---------- Mascot ("Stack", three print layers with a face; empty cart) ---------- */
.mascot { width: 132px; height: auto; display: block; overflow: visible; }
.mascot .m1 { fill: color-mix(in srgb, var(--accent-brand, #f2551d) 62%, #5a1c00); }
.mascot .m2 { fill: color-mix(in srgb, var(--accent-brand, #f2551d) 82%, #5a1c00); }
.mascot .m3 { fill: var(--accent-brand, #f2551d); }
.mascot .m-shadow { fill: var(--ink); opacity: 0.1; }
.mascot .m-eye { fill: #1b1206; transform-box: fill-box; transform-origin: center; }
.mascot .m-shine { fill: #fff; }
.mascot .m-mouth { fill: none; stroke: #1b1206; stroke-width: 2.6; stroke-linecap: round; }
.mascot g { transform-box: fill-box; transform-origin: center bottom; }
@media (prefers-reduced-motion: no-preference) {
  .mascot .m-top { animation: lu-bob 3.2s ease-in-out infinite; }
  .mascot .m-mid { animation: lu-bob 3.2s ease-in-out 0.12s infinite; }
  .mascot .m-eye { animation: lu-blink 4.4s infinite; }
  .mascot:hover .m-top { animation: lu-hop 0.5s var(--spring); }
}
@keyframes lu-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }
@keyframes lu-hop { 0% { translate: 0 0; } 40% { translate: 0 -14px; } 100% { translate: 0 0; } }
@keyframes lu-blink { 0%, 46%, 50%, 100% { scale: 1 1; } 48% { scale: 1 0.1; } }
.cart-empty .mascot { margin: 0 auto var(--s3); }
.cart-empty-actions { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; }

/* ---------- Home: "Name It" cards (keychain, desk name plate) ---------- */
.home-play-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.home-play-card {
  position: relative; display: grid; gap: 10px; align-content: end; min-height: 190px; padding: var(--s5);
  border-radius: calc(var(--radius) * 1.5); color: #fff; text-decoration: none; overflow: hidden; isolation: isolate;
  background: #c93f0c;
}
.home-play-card + .home-play-card { background: #1d2433; }
.home-play-card::before { /* print layers */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.16;
  background: repeating-linear-gradient(0deg, #000 0 2px, transparent 2px 9px);
  transition: translate 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.home-play-card:hover::before { translate: 0 -9px; }
.home-play-kicker { font: 600 12px/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.9; }
.home-play-card b { font: 700 clamp(20px, 2.4vw, 28px)/1.15 var(--font-display, var(--font-body)); max-width: 18ch; text-wrap: balance; }
.home-play-go { justify-self: start; padding: 8px 14px; border-radius: 999px; background: #fff; color: #14171f; font: 600 14px/1 var(--font-body); }
.home-play-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
@media (max-width: 640px) { .home-play-grid { grid-template-columns: 1fr; } .home-play-card { min-height: 150px; } }
