/* effects.css: pairs with effects.js. Everything is visible without JS (rules gated on .js). */

/* parallax: JS writes --py; scale hides edges. Static (no transform) on mobile / reduced motion. */
@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
  .js [data-parallax] {
    transform: translate3d(0, var(--py, 0px), 0) scale(1.12);
    will-change: transform;
  }
  .js [data-layers] [data-depth] {
    transform: translate3d(0, var(--py, 0px), 0);
    will-change: transform;
  }
}
[data-parallax]:has(img), picture[data-parallax] { overflow: visible; }

/* self-drawing line, then dim to a ghost */
.js svg.draw-line path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js svg.draw-line { transition: opacity 1.2s ease; }
.js svg.draw-line.drawn path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.6s cubic-bezier(0.16, 1, 0.3, 1); /* ease-out: spring would overshoot the dash */
}
.js svg.draw-line.settled { opacity: 0.25; }
.js svg.draw-line.instant, .js svg.draw-line.instant path { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .js svg.draw-line, .js svg.draw-line path { transition: none; }
}

/* ---- icon auto-draw (JS tags svg.ad, strokes [data-ad-s], solid fills [data-ad-f], faint tints [data-ad-tint]) ---- */
.js svg.ad:not(.scrub) [data-ad-s] { stroke-dasharray: 1 1.2; stroke-dashoffset: 1.1; stroke-opacity: 0; }
.js svg.draw-scrub [data-ad-s] { stroke-dasharray: 1 1.2; stroke-dashoffset: 1.1; }
.js svg.ad:not(.scrub) [data-ad-f] { opacity: 0; transform: scale(.3); transform-box: fill-box; transform-origin: center; }
.js svg.ad [data-ad-tint] { fill-opacity: 0; }
.js svg.ad.in [data-ad-s] {
  stroke-dashoffset: 0; stroke-opacity: 1;
  transition: stroke-dashoffset 1.25s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--gd, 0s) + var(--dp, 0s)),
              stroke-opacity .12s linear calc(var(--gd, 0s) + var(--dp, 0s));
}
.js svg.ad.in [data-ad-f] {
  opacity: 1; transform: none;
  transition: opacity .5s ease calc(var(--gd, 0s) + var(--dp, 0s)), transform .6s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--gd, 0s) + var(--dp, 0s));
}
.js svg.ad.in [data-ad-tint] { fill-opacity: 1; transition: fill-opacity .9s ease calc(var(--gd, 0s) + .5s); }
/* hover/focus redraw: 0.6s, inner stagger halved, no grid delay */
.js svg.ad.fast { --gd: 0s; }
.js svg.ad.fast.in [data-ad-s] { transition-duration: .6s, .08s; transition-delay: calc(var(--dp, 0s) * .5); }
.js svg.ad.reset [data-ad-s], .js svg.ad.reset [data-ad-f], .js svg.ad.reset [data-ad-tint] { transition: none !important; }
.js svg.ad.fast [data-ad-f], .js svg.ad.fast [data-ad-tint] { opacity: 1; fill-opacity: 1; transform: none; transition: none; }
.js svg.ad.instant [data-ad-s], .js svg.ad.instant [data-ad-f], .js svg.ad.instant [data-ad-tint] { transition: none !important; }

/* ---- scroll-scrubbed draw: JS writes stroke-dashoffset inline per frame; fills toggle .on ---- */
.js svg.draw-scrub [data-ad-f] { opacity: 0; transform: scale(.2); transform-box: fill-box; transform-origin: center;
  transition: opacity .4s ease, transform .55s cubic-bezier(0.34, 1.56, 0.64, 1); }
.js svg.draw-scrub [data-ad-f].on { opacity: 1; transform: none; }

/* ---- homepage WOW line band (research/wow-snippet.html) ---- */
.wow-line { position: relative; z-index: 0; pointer-events: none; width: 100%; max-width: 1200px;
  margin: clamp(-1rem, -2vw, 0rem) auto clamp(-1.5rem, -3vw, -0.5rem); padding: 0 clamp(1rem, 3vw, 2rem); }
.wow-line svg { display: block; width: 100%; height: auto; overflow: visible; }
.wow-line .wow-base { stroke: #1a8a7d; stroke-opacity: .55; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: opacity 1.4s ease; }
.wow-line .wow-coral { stroke: #f0814f; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wow-line .wow-dot { fill: #f0814f; }
.wow-line .wow-dot.teal { fill: #1a8a7d; fill-opacity: .7; }
/* self-drawing then dim: once fully drawn, the teal line recedes so the coral accent leads */
.wow-line svg.complete .wow-base { opacity: .6; }
@media (prefers-reduced-motion: reduce) { .wow-line .wow-base { transition: none; } }

/* ---- tooth glints (svg.draw-line tooth art): twinkle after draw; dim the stroke, not the glints ---- */
.js svg.draw-line.has-glints { overflow: visible; }
.js svg.draw-line.has-glints.settled { opacity: 1; }
.js svg.draw-line.has-glints.settled > path:not(.tsp-sweep) { stroke-opacity: .3; transition: stroke-opacity 1.2s ease; }
.tsp path { opacity: 0; transform-box: fill-box; transform-origin: center; stroke: none; }
.tsp .tsp-a { fill: #1a8a7d; } .tsp .tsp-b { fill: #7fd0c4; } .tsp .tsp-c { fill: #f0814f; }
.js svg.draw-line.has-glints .tsp-sweep, .tsp-sweep { fill: none !important; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: .12 1.3; stroke-dashoffset: .12; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .tsp-on .tsp path { animation: tsp-tw 3.6s ease-in-out var(--td, 0s) infinite both; animation-play-state: paused; }
  .tsp-on.tsp-run .tsp path { animation-play-state: running; }
  .js svg.draw-line.has-glints.tsp-on .tsp-sweep { animation: tsp-sweep 1.4s cubic-bezier(.45, 0, .2, 1) .1s 1 both; }
}
.tsp-static .tsp path { opacity: .35; }
@keyframes tsp-tw { 0%, 100% { opacity: 0; transform: scale(.2) rotate(0deg); } 18% { opacity: .95; transform: scale(1) rotate(20deg); } 36% { opacity: 0; transform: scale(.25) rotate(45deg); } }
@keyframes tsp-sweep { 0% { opacity: .9; stroke-dashoffset: .12; } 100% { opacity: .9; stroke-dashoffset: -1; } }

/* ---- hero shine (port of chabad-on-wheels .sweep, 115deg band, toned down): transform-only, sits above the photo (z -2), under content ---- */
.fx-shine { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.fx-shine::before { content: ""; position: absolute; top: -10%; bottom: -10%; left: 0; width: 55%;
  background: linear-gradient(115deg, rgba(255,250,240,0) 20%, rgba(255,250,240,.15) 50%, rgba(255,250,240,0) 80%);
  transform: translate3d(-110%, 0, 0); will-change: transform; }
@media (prefers-reduced-motion: no-preference) {
  .fx-shine-run .fx-shine::before { animation: fx-shine 8s cubic-bezier(.45, 0, .2, 1) 1.2s infinite; }
}
@keyframes fx-shine { 0% { transform: translate3d(-110%, 0, 0); } 30%, 100% { transform: translate3d(200%, 0, 0); } }

/* ---- photo hover sparkle (port of bocatreasures twinkle band 115deg + corner glints, white/teal) ---- */
.fx-spk { position: absolute; pointer-events: none; overflow: hidden; border-radius: inherit; z-index: 1; }
.fx-sheen { position: absolute; inset: 0; opacity: 0; mix-blend-mode: screen;
  background: linear-gradient(115deg, rgba(220,245,240,0) 28%, rgba(235,250,247,.28) 50%, rgba(220,245,240,0) 72%) no-repeat;
  background-size: 200% 100%; background-position: 197% 0; }
.fx-st { position: absolute; width: 18px; height: 18px; opacity: 0; transform: scale(.2); fill: #fff; filter: drop-shadow(0 0 3px rgba(26,138,125,.8)); }
.fx-st1 { top: 9%; left: 8%; } .fx-st2 { top: 7%; right: 10%; width: 12px; height: 12px; fill: #bfeee6; }
.fx-st3 { bottom: 11%; right: 7%; } .fx-st4 { bottom: 9%; left: 12%; width: 11px; height: 11px; fill: #bfeee6; }
.fx-spk.go .fx-sheen { opacity: .9; animation: fx-sheen 1.1s cubic-bezier(.45, 0, .2, 1) both; }
.fx-spk.go .fx-st { animation: fx-st .9s ease-out both; }
.fx-spk.go .fx-st2 { animation-delay: .12s; } .fx-spk.go .fx-st3 { animation-delay: .26s; } .fx-spk.go .fx-st4 { animation-delay: .36s; }
@keyframes fx-sheen { 0% { background-position: 197% 0; } 100% { background-position: -36% 0; opacity: 0; } }
@keyframes fx-st { 0% { opacity: 0; transform: scale(.2) rotate(0); } 40% { opacity: 1; transform: scale(1) rotate(30deg); } 100% { opacity: 0; transform: scale(.3) rotate(60deg); } }
@media (prefers-reduced-motion: reduce) { .fx-spk { display: none; } }
