/* iSAN Poker · Premium Cinematic Animation Layer v1.1
   ADDITIVE ONLY. Brand colors inherit current site's --gold / --red / --bg.
   No AnimatedWebs style token is claimed or inferred.
   Never target #admin or form controls. Motion opt-out is honored.
*/
:root {
  --isan-float-distance: 9px;
  --isan-motion-soft: cubic-bezier(.22,1,.36,1);
}

/* Static refinements remain legible when motion is disabled. */
.hero .emblem-halo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.events-grid .event-card:is(:hover,:focus-within),
.poster-grid .poster-card:is(:hover,:focus-within) {
  border-color: var(--gold-deep, #a8793f);
  box-shadow: 0 18px 42px rgba(0,0,0,.25);
}

@media (prefers-reduced-motion: no-preference) {
  /* 01 — slow background breathing: opacity and transform only. */
  html.isan-motion-active .hero .hero-backdrop {
    transform-origin: 55% 60%;
    animation: isan-ambient 18s ease-in-out infinite alternate;
  }
  @keyframes isan-ambient {
    from { opacity: .48; transform: scale(1); }
    to   { opacity: .60; transform: scale(1.045); }
  }

  /* 02 — float the artwork while the border stays anchored. */
  html.isan-motion-active .hero .emblem-halo > picture {
    display:block;
    animation: isan-elephant-float 8.5s ease-in-out infinite;
    transform: translate3d(0,0,0);
  }
  @keyframes isan-elephant-float {
    0%, 100% { transform: translate3d(0,0,0); }
    50% { transform: translate3d(0,calc(-1 * var(--isan-float-distance)),0); }
  }

  /* 03 — soft ruby reflection on the artwork itself. Uses picture::after so
       the V9.3 emblem sheen (.emblem-halo::after) stays intact. */
  html.isan-motion-active .hero .emblem-halo > picture { position:relative; }
  html.isan-motion-active .hero .emblem-halo > picture::after {
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
    z-index:1;
    background:radial-gradient(ellipse 15% 10% at 51% 60%,
      rgba(255,220,215,.24) 0%, rgba(255,92,110,.12) 30%,
      rgba(255,30,75,0) 82%);
    mix-blend-mode:screen;
    animation: isan-ruby-reflection 10s ease-in-out infinite;
  }
  @keyframes isan-ruby-reflection {
    0%, 100% { opacity: .20; transform: translate3d(-4px,3px,0) scale(.93); }
    52% { opacity:.78; transform: translate3d(4px,-3px,0) scale(1.04); }
  }

  /* 04 — metallic glint: the accessible original text stays opaque and
       readable; a duplicated CSS-only overlay fades in briefly. Animation
       touches opacity only (no expensive background-position repaint). */
  html.isan-motion-active .hero h1 > span.isan-shimmer-ready,
  html.isan-motion-active .site-header .brand-link strong.isan-shimmer-ready {
    position:relative;
    display:inline-block;
    color:var(--gold, #e9bf71);
    isolation:isolate;
  }
  html.isan-motion-active .isan-shimmer-ready::after {
    content:attr(data-isan-shimmer);
    position:absolute;
    inset:0;
    pointer-events:none;
    color:transparent;
    background-image:linear-gradient(112deg, transparent 5%, #fff5d2 42%, #e7b761 56%, transparent 90%);
    -webkit-background-clip:text;
    background-clip:text;
    -webkit-text-fill-color:transparent;
    opacity:0;
    white-space:nowrap;
    animation:isan-gold-shimmer 10s ease-in-out infinite;
  }
  html.isan-motion-active .site-header .brand-link strong.isan-shimmer-ready::after {
    animation-duration:13s;
    animation-delay:-3s;
  }
  @keyframes isan-gold-shimmer {
    0%, 44%, 70%, 100% { opacity:0; }
    53%, 59% { opacity:.88; }
  }

  /* 05 — hover lifts; focus remains keyboard-visible. */
  @media (hover:hover) and (pointer:fine) {
    html.isan-motion-active .events-grid .event-card,
    html.isan-motion-active .poster-grid .poster-card {
      transition: transform 320ms var(--isan-motion-soft),
        border-color 260ms ease, box-shadow 320ms ease;
    }
    html.isan-motion-active .events-grid .event-card:hover,
    html.isan-motion-active .poster-grid .poster-card:hover { transform:translate3d(0,-5px,0); }
  }

  /* 06 — light sweep ONLY on marketing CTA; not on Registration controls. */
  html.isan-motion-active .hero-actions .btn-gold,
  html.isan-motion-active .contact-action .btn-gold {
    position:relative;
    isolation:isolate;
    overflow:hidden;
  }
  html.isan-motion-active .hero-actions .btn-gold::after,
  html.isan-motion-active .contact-action .btn-gold::after {
    content:"";
    position:absolute;
    pointer-events:none;
    inset:-80% -45%;
    background:linear-gradient(105deg,transparent 38%,rgba(255,255,255,.35) 50%,transparent 62%);
    transform:translate3d(-125%,0,0) rotate(8deg);
  }
  @media (hover:hover) and (pointer:fine) {
    html.isan-motion-active .hero-actions .btn-gold:hover::after,
    html.isan-motion-active .contact-action .btn-gold:hover::after {
      animation:isan-cta-sweep 850ms ease-out 1;
    }
  }
  @keyframes isan-cta-sweep { to { transform:translate3d(125%,0,0) rotate(8deg); } }

  /* 07 — One-shot reveal on intersection; unvisited sections remain visible.
          Important for full-page screenshots, browser text search and no-JS. */
  html.isan-motion-active .isan-reveal-ready.isan-in-view {
    animation: isan-section-reveal 640ms var(--isan-motion-soft) 1 both;
  }
  @keyframes isan-section-reveal {
    from { opacity:.68; transform:translate3d(0,16px,0); }
    to { opacity:1; transform:translate3d(0,0,0); }
  }

  /* 08 — existing drawer tab panel: no changes to tab events or content. */
  html.isan-motion-active #drawer-panel.isan-panel-fade {
    animation:isan-tab-fade 330ms ease-out 1 both;
  }
  @keyframes isan-tab-fade {
    from { opacity:.38; transform:translate3d(0,6px,0); }
    to { opacity:1; transform:translate3d(0,0,0); }
  }
}

/* Respect explicit system setting even when the preference changes at runtime. */
@media (prefers-reduced-motion: reduce) {
  .hero .hero-backdrop,
  .hero .emblem-halo > picture,
  .hero .emblem-halo > picture::after,
  .isan-shimmer-ready::after,
  .hero-actions .btn-gold::after,
  .contact-action .btn-gold::after,
  #drawer-panel,
  .isan-reveal-ready,
  .events-grid .event-card,
  .poster-grid .poster-card {
    animation:none !important;
    transition:none !important;
    transform:none !important;
  }
  .hero .hero-backdrop { opacity:.52 !important; }
  .hero .emblem-halo > picture::after, .isan-shimmer-ready::after { display:none !important; }
  .isan-reveal-ready, #drawer-panel { opacity:1 !important; }
}

@media (prefers-reduced-motion: no-preference) {
  html.isan-motion-paused .hero .hero-backdrop,
  html.isan-motion-paused .hero .emblem-halo > picture,
  html.isan-motion-paused .hero .emblem-halo > picture::after,
  html.isan-motion-paused .isan-shimmer-ready::after {
    animation-play-state: paused;
  }
}

/* Slightly quieter movement on compact/mobile screens. */
@media (max-width:600px) {
  :root { --isan-float-distance:5px; }
}
