/* Small, optional interactions. No animation library or hidden-content script. */

/* Native static cursors: no trailing element, listeners, or touch interception.
   The hotspot is the top of the swirl. Links get a cream scoop and a sparkle. */
@media (hover: hover) and (pointer: fine) {
  body { cursor: url("ice-cream-cursor.svg") 16 3, auto; }
  body :is(a, button, summary, [role="button"]) {
    cursor: url("ice-cream-cursor-link.svg") 16 3, pointer;
  }
  body :is(input, textarea, [contenteditable="true"]) { cursor: text; }
  body :is(button:disabled, [aria-disabled="true"]) { cursor: not-allowed; }
}

/* The image moves, not its label or click target. Nothing moves on touch. */
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .favourite-art {
    transform-origin: center 85%;
    transition: transform 340ms cubic-bezier(.2, .75, .25, 1);
  }
  .favourite:hover .favourite-art,
  .favourite:focus-visible .favourite-art {
    transform: translateY(-12px) scale(1.025);
  }
  .favourite:active .favourite-art {
    transform: translateY(-5px) scale(1.01);
    transition-duration: 130ms;
  }
}

/* Default content is visible. Backwards fill exists only during these finite
   entrance animations; no observer, opacity class, or JS completion is needed. */
@keyframes rr-text-arrive {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rr-soft-arrive {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .page-frame { animation: rr-soft-arrive 320ms ease-out backwards; }
  .site-header { animation: rr-soft-arrive 380ms ease-out backwards; }
  .hero-copy > .location { animation: rr-text-arrive 460ms ease-out 40ms backwards; }
  .hero-title > span { animation: rr-text-arrive 620ms cubic-bezier(.2, .7, .2, 1) backwards; }
  .hero-title > span:nth-child(1) { animation-delay: 90ms; }
  .hero-title > span:nth-child(2) { animation-delay: 150ms; }
  .hero-title > span:nth-child(3) { animation-delay: 210ms; }
  .hero-copy > p { animation: rr-text-arrive 560ms ease-out 240ms backwards; }
  .hero-copy > .button { animation: rr-text-arrive 500ms ease-out 290ms backwards; }
  .hero-product { animation: rr-soft-arrive 800ms ease-out 100ms backwards; }

  .page-heading > *, .about-copy > *, .contact-intro > h1,
  .contact-intro > .location, .contact-intro > p,
  .visit-panel > h2, .visit-panel > p, .visit-panel > address,
  .section-title > * {
    animation: rr-text-arrive 540ms ease-out 80ms backwards;
  }
  .page-heading > :nth-child(2), .about-copy > :nth-child(2),
  .contact-intro > .location, .section-title > :nth-child(2) { animation-delay: 150ms; }
  .page-heading > :nth-child(3), .about-copy > :nth-child(n+3),
  .contact-intro > p { animation-delay: 210ms; }
  .about-art, .contact-visual, .favourites { animation: rr-soft-arrive 650ms ease-out 140ms backwards; }

  /* Focus reveals content immediately, including a fading ancestor. */
  .page-frame:focus-within, .site-header:focus-within, .favourites:focus-within,
  .hero-copy:focus-within > *, .about-copy:focus-within > *,
  .visit-panel:focus-within > *, .hero-copy:focus-within .hero-title > span {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .favourite-art { transform: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  body { cursor: auto; }
  body :is(a, button, summary, [role="button"]) { cursor: pointer; }
  body :is(input, textarea, [contenteditable="true"]) { cursor: text; }
  body :is(button:disabled, [aria-disabled="true"]) { cursor: not-allowed; }
}
@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .favourite-art { transform: none !important; }
}
