/* Hero illustration animation, shared by the main page and the screens page.
   The picture starts as a pencil sketch, an arc draws itself, a heart is drawn, fills and beats,
   and colour spreads out from the heart. Plays once.
   Turned off for reduced motion and for "עצירת אנימציות" in the accessibility menu.
   Each page sets the heart's position as --hero-x / --hero-y on .hero-art-stage. */
@property --hero-r { syntax: '<percentage>'; inherits: false; initial-value: -15%; }
.hero-art-stage { position: relative; }
.hero-art-stage img { display: block; }
.hero-art-sketch { filter: grayscale(1) sepia(.35) contrast(1.25) brightness(1.06); }
.hero-art-color, .hero-art-fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-art-color {
  -webkit-mask-image: radial-gradient(circle at var(--hero-x, 50%) var(--hero-y, 40%), #000 var(--hero-r), transparent calc(var(--hero-r) + 14%));
          mask-image: radial-gradient(circle at var(--hero-x, 50%) var(--hero-y, 40%), #000 var(--hero-r), transparent calc(var(--hero-r) + 14%));
  animation: hero-colour 2.4s cubic-bezier(.45, 0, .2, 1) 1.85s both;
}
@keyframes hero-colour { from { --hero-r: -15%; } to { --hero-r: 120%; } }
.hero-art-fx { pointer-events: none; overflow: visible; }
.hero-arc { fill: none; stroke: #5b4a39; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: hero-draw 1.2s cubic-bezier(.45, 0, .25, 1) .3s forwards; }
.hero-heart { fill: #a7ad84; fill-opacity: 0; stroke: #5b4a39; stroke-width: 2.2; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  transform-box: fill-box; transform-origin: 50% 60%;
  animation: hero-draw .7s ease-in-out 1.2s forwards, hero-fill .5s ease-out 1.75s forwards, hero-beat 1.3s ease-in-out 2.35s 2; }
.hero-glow { opacity: 0; transform-box: fill-box; transform-origin: center; animation: hero-glow 1.6s ease-out 1.9s; }
@keyframes hero-draw { to { stroke-dashoffset: 0; } }
@keyframes hero-fill { to { fill-opacity: 1; } }
@keyframes hero-beat { 0%, 100% { scale: 1; } 14% { scale: 1.16; } 28% { scale: 1; } 42% { scale: 1.09; } 60% { scale: 1; } }
@keyframes hero-glow { 0% { opacity: 0; scale: .5; } 35% { opacity: 1; } 100% { opacity: 0; scale: 2.6; } }
@media (prefers-reduced-motion: reduce) {
  .hero-art-color { -webkit-mask-image: none; mask-image: none; animation: none; }
  .hero-arc, .hero-heart, .hero-glow { animation: none; }
  .hero-arc, .hero-heart { stroke-dashoffset: 0; }
  .hero-heart { fill-opacity: 1; }
}
html.a11y-motion .hero-art-color { -webkit-mask-image: none !important; mask-image: none !important; }
html.a11y-motion .hero-arc, html.a11y-motion .hero-heart { stroke-dashoffset: 0 !important; }
html.a11y-motion .hero-heart { fill-opacity: 1 !important; scale: 1 !important; }

/* The hero background starts white and its own colour spreads out from the heart, a beat after the illustration's.
   A white layer sits over the background (under the text and the picture) and clears outward from the heart.
   hero-anim.js puts the heart's position on the hero as --bg-x / --bg-y. */
@property --bg-r { syntax: '<length>'; inherits: false; initial-value: -45vmax; }
@supports ((mask-image: radial-gradient(#000, transparent)) or (-webkit-mask-image: radial-gradient(#000, transparent))) {
  .hero:has(.hero-anim) { position: relative; isolation: isolate; }
  .hero:has(.hero-anim)::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: #fff;
    -webkit-mask-image: radial-gradient(circle at var(--bg-x, 50%) var(--bg-y, 40%), transparent var(--bg-r), #000 calc(var(--bg-r) + 45vmax));
            mask-image: radial-gradient(circle at var(--bg-x, 50%) var(--bg-y, 40%), transparent var(--bg-r), #000 calc(var(--bg-r) + 45vmax));
    animation: hero-bg 2.8s cubic-bezier(.4, 0, .25, 1) 2.1s both;
  }
}
/* Ends fully clear even where the radius cannot animate */
@keyframes hero-bg { 0% { --bg-r: -45vmax; opacity: 1; } 85% { opacity: 1; } 100% { --bg-r: 150vmax; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero:has(.hero-anim)::before { display: none; } }
html.a11y-motion .hero:has(.hero-anim)::before { display: none !important; }
