/* Finite product gestures. Motion lives inside the card, independent of its scroll position. */
.app-grid { overflow-anchor: none; }
.app-card:focus-within { box-shadow: 0 0 0 2px #ffcc00, 0 18px 40px #5f4d1512; }
.app-card .art-label { transition: color .3s; }
.app-card:is(:hover, :focus-within) .art-label { color: var(--ink); }
.app-card .product-art { --preview-ease: cubic-bezier(.22,1,.36,1); }

/* The demonstration runs once on arrival, and again on deliberate interaction. */
@media (prefers-reduced-motion: no-preference) {
  .app-card .is-previewing .switch { animation: demo-switch 1.6s .12s both; }
  .app-card .is-previewing .switch::after { animation: demo-switch-knob 1.6s .12s both; }
  .app-card .is-previewing .mini-control:nth-of-type(4) .switch,
  .app-card .is-previewing .mini-control:nth-of-type(4) .switch::after { animation-delay: .35s; }
  .app-card .is-previewing .status-light { animation: demo-status 1.7s .25s both; }
  .app-card .is-previewing .waveform i { animation: demo-wave 1.65s calc(var(--sample, 0) * 65ms) ease-in-out both; }
  .app-card .is-previewing .fader-row i { transform-origin: left center; animation: demo-level 1.8s var(--preview-ease) both; }
  .app-card .is-previewing .fader-row:nth-of-type(2) i { animation-delay: .14s; }
  .app-card .is-previewing .fader-row:nth-of-type(3) i { animation-delay: .25s; }
  .app-card .is-previewing .big-cursor { animation: demo-cursor 1.6s var(--preview-ease) both; }
  .app-card .is-previewing .click-ring { animation: demo-click 1.2s .3s var(--preview-ease) both; }
  .app-card .is-previewing .ring-two { animation-delay: .43s; }
  .app-card .is-previewing .ring-three { animation-delay: .56s; }
  .app-card .is-previewing .launcher-search { animation: demo-search 1.8s both; }
  .app-card .is-previewing .launcher-grid img { animation: demo-tile 1.65s calc(var(--tile-order, 0) * 70ms) var(--preview-ease) both; }
  .app-card .is-previewing.art-up .floating-app { animation: demo-hop 1.7s var(--preview-ease) both; }
  .app-card .is-previewing.art-jenga .floating-app { animation: demo-turn 1.7s var(--preview-ease) both; }
  .app-card .is-previewing .game-spark { animation: demo-spark 1.6s .2s both; }
  .app-card .is-previewing.art-game .phone-preview img { animation: demo-screen 1.8s var(--preview-ease) both; transform-origin: center 35%; }

  /* Individual properties keep the existing directional icon transforms intact. */
  :is(.button, .text-link, .print-button, .copy-email, .to-top, .language-link, .filter-button, .back-link, .product-back, .gallery-controls button, .screenshot-zoom) .ellie-ui-icon,
  .card-bottom .icon-details { transition: translate .4s var(--ease), rotate .4s var(--ease), scale .4s var(--ease); }
  :is(.button, .text-link, .print-button, .copy-email, .to-top, .language-link, .filter-button, .back-link, .product-back, .gallery-controls button, .screenshot-zoom):is(:hover, :focus-visible) .ellie-ui-icon,
  .card-link:is(:hover, :focus-visible) .icon-details { translate: 0 -3px; rotate: -7deg; scale: 1.06; }
  .card-link:focus-visible .mini-window { translate: 0 -5px; rotate: 3deg; }
  .card-link:focus-visible :is(.phone-preview, .mixer-panel, .launcher-panel) { translate: 0 -6px; }
  .card-link:focus-visible .mouse-icon-wrap { translate: 0 -6px; rotate: 7deg; }
  .hero-app:focus-visible img { translate: 0 -5px; scale: 1.07; }
  .policy-directory > a > img:first-child { transition: translate .5s var(--ease), rotate .5s var(--ease); }
  .policy-directory > a:is(:hover, :focus-visible) > img:first-child { translate: 0 -3px; rotate: -5deg; }
  .contact-illustration img { transition: rotate .7s var(--ease), translate .7s var(--ease); }
  .contact-section:focus-within .contact-illustration img { rotate: 3deg; translate: 0 -5px; }
}

@keyframes demo-switch { 0%, 15% { background: #c7ccc0; } 42%, 100% { background: #92a778; } }
@keyframes demo-switch-knob { 0%, 15% { translate: -11px 0; } 42%, 100% { translate: 0 0; } }
@keyframes demo-status { 0%, 25% { opacity: .3; scale: .8; } 48% { opacity: 1; scale: 1.45; } 72%, 100% { opacity: 1; scale: 1; } }
@keyframes demo-wave { 0%, 100% { scale: 1 1; } 22% { scale: 1 .42; } 46% { scale: 1 1.2; } 70% { scale: 1 .68; } }
@keyframes demo-level { 0%, 100% { scale: 1 1; } 27% { scale: .42 1; } 65% { scale: .88 1; } }
@keyframes demo-cursor { 0% { translate: 15px 14px; } 28% { translate: -7px -6px; scale: 1; } 36% { translate: -7px -6px; scale: .88; } 51% { translate: -7px -6px; scale: 1; } 100% { translate: 0 0; scale: 1; } }
@keyframes demo-click { 0% { scale: .72; opacity: 0; } 28% { opacity: .85; } 100% { scale: 1; opacity: 1; } }
@keyframes demo-search { 0%, 100% { background: #fff9; } 30%, 70% { background: #fff3bf; } }
@keyframes demo-tile { 0%, 100% { translate: 0 0; scale: 1; opacity: 1; } 25% { translate: 0 8px; scale: .9; opacity: .3; } 58% { translate: 0 -4px; scale: 1.06; opacity: 1; } }
@keyframes demo-hop { 0%, 100% { translate: 0 0; scale: 1; } 16% { translate: 0 7px; scale: 1.04 .94; } 44% { translate: 0 -38px; scale: .98 1.03; } 72% { translate: 0 3px; scale: 1.04 .96; } }
@keyframes demo-turn { 0%, 100% { translate: 0 0; rotate: 0deg; } 30% { translate: -12px -10px; rotate: -8deg; } 65% { translate: 7px -4px; rotate: 5deg; } }
@keyframes demo-spark { 0%, 100% { scale: 1; opacity: 1; } 35% { scale: 1.5; opacity: .55; rotate: 20deg; } }
@keyframes demo-screen { 0%, 100% { scale: 1; } 50% { scale: 1.045; } }

.reading-progress { height: 3px; width: min(160px, 100%); background: #e9e4d3; border-radius: 3px; overflow: hidden; margin-top: 25px; }
.reading-progress i { display: block; height: 100%; background: #d5ae15; transform: scaleX(0); transform-origin: left; }
.policy-toc a { transition: color .2s, box-shadow .2s; }
.policy-toc a[aria-current="location"] { color: var(--ink); box-shadow: 0 3px 0 #ffcc00; }
.policy-content section { scroll-margin-top: 24px; }

@media (max-width: 760px) { .reading-progress { width: 100%; margin-top: 18px; } }
@media (prefers-reduced-motion: reduce) {
  .app-card:focus-within :is(.mini-window, .phone-preview, .mixer-panel, .launcher-panel, .mouse-icon-wrap),
  .ellie-ui-icon, .contact-illustration img { translate: none; rotate: none; scale: none; }
}
@media print {
  .reading-progress { display: none; }
  .policy-content section > *, .policy-header > * { opacity: 1 !important; translate: none !important; transform: none !important; }
}
