/* =====================================================================
   Light Tracer · patch v6 — longer beams + beam motion
   Append AFTER lighttracer-patch-v5.css.
   1. phones/tablets: hero beam runs off the top of the screen (was 150px)
   2. hero: power-on, photon pulse every 4.6s, breathing glow, twinkling stars
   3. anatomy diagram: longer beam + the same photon pulse, dots breathe
   4. video poster: photon pulse on the poster beam until play is pressed
   Everything animated is inside prefers-reduced-motion: no-preference.
   ===================================================================== */

/* 1 */
@media (max-width: 1023px) {
  /* v6: full-length beam on small screens too. It runs behind the copy (z -1) and thins out
     as it passes the headline, so text contrast stays above 4.5:1. */
  .tip-beam { width: 160vh; height: 2px; background: linear-gradient(270deg, var(--laser-hi) 0, var(--laser) 4%, rgba(61,255,110,.75) 30%, rgba(61,255,110,.35) 60%, rgba(61,255,110,.12) 100%); box-shadow: 0 0 8px rgba(61,255,110,.45); }
}

/* 2 + 4 */
/* ---------- v6 beam motion: power-on, photon pulses, breathing glow, twinkling sky ----------
   All CSS. Every rule sits inside prefers-reduced-motion: no-preference, so reduced-motion users
   get the static, full-length beam. */
.tip-beam::before, .tip-beam::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.tip-beam::before { inset: -5px 0; background: linear-gradient(270deg, rgba(61,255,110,.55) 0, rgba(61,255,110,.22) 35%, rgba(61,255,110,0) 100%); filter: blur(5px); opacity: .6; }
.tip-beam::after { opacity: 0; background: linear-gradient(270deg, rgba(255,255,255,0) 0, #f2fff5 2.2%, rgba(141,255,170,.9) 4%, rgba(61,255,110,0) 9%); background-size: 100% 100%; height: 4px; top: -1px; box-shadow: none; }
.hero::after { content: ""; position: absolute; inset: 0 0 35% 0; z-index: -1; pointer-events: none; opacity: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 27% 9%, #dfffe8 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 46% 22%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 63% 7%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 28%, #e6fff0 50%, transparent 51%), radial-gradient(1.2px 1.2px at 91% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 36% 40%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 85% 46%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 52%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 56% 48%, #dfffe8 50%, transparent 51%); }
@media (prefers-reduced-motion: no-preference) {
  .tip-beam { animation: lt-shoot 1.1s var(--ease-out) .35s both; }
  .tip-beam::before { animation: lt-beam-breathe 3.6s ease-in-out 1.5s infinite; }
  .tip-beam::after { animation: lt-photon 4.6s cubic-bezier(.35, .1, .6, 1) 1.6s infinite; }
  .tip-glow { animation: lt-glow 1.1s var(--ease-out) .2s both, lt-tip-pulse 3.6s ease-in-out 1.5s infinite; }
  .hero::after { animation: lt-twinkle 5.5s ease-in-out 1s infinite alternate; }
}
@keyframes lt-photon { 0% { transform: translateX(0); opacity: 0; } 4% { opacity: 1; } 42% { opacity: .9; } 55%, 100% { transform: translateX(-100%); opacity: 0; } }
@keyframes lt-beam-breathe { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes lt-tip-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .85; } }
@keyframes lt-twinkle { 0% { opacity: .15; } 35% { opacity: .7; } 60% { opacity: .3; } 100% { opacity: .8; } }

/* video poster: pulse rides the beam baked into video-poster-*.webp until the visitor presses play.
   Beam in the poster runs from the emitter (58.1%, 33.3%) to the top edge at (47.4%, 0). */
.poster-beam { position: absolute; left: 58.1%; top: 33.3%; width: 21.8%; height: 3px; margin-top: -1.5px; transform-origin: 0 50%; transform: rotate(-119.8deg); pointer-events: none; overflow: hidden; z-index: 1; }
.poster-beam::after { content: ""; position: absolute; inset: 0; opacity: 0; background: linear-gradient(90deg, rgba(61,255,110,0) 0, #f2fff5 6%, rgba(141,255,170,.85) 10%, rgba(61,255,110,0) 20%); }
.poster-glow { position: absolute; left: 58.1%; top: 33.3%; width: 5%; aspect-ratio: 1; margin: -2.5% 0 0 -2.5%; border-radius: 50%; background: radial-gradient(circle, rgba(220,255,230,.75) 0, rgba(61,255,110,.35) 40%, rgba(61,255,110,0) 70%); pointer-events: none; z-index: 1; opacity: .7; }
.video-frame.playing .poster-beam, .video-frame.playing .poster-glow { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .poster-beam::after { animation: lt-poster-photon 4.6s cubic-bezier(.35, .1, .6, 1) 1s infinite; }
  .poster-glow { animation: lt-tip-pulse 3.6s ease-in-out infinite; }
}
@keyframes lt-poster-photon { 0% { transform: translateX(-20%); opacity: 0; } 5% { opacity: 1; } 45% { opacity: 1; } 60%, 100% { transform: translateX(100%); opacity: 0; } }

/* 3 */
/* anatomy: let the longer beam leave the canvas (phones) */
.anatomy-clip { clip-path: inset(-40% 0 0 0); overflow: visible; }
@media (min-width: 900px) { .anatomy-clip { clip-path: none; } }
.block-head:has(+ .anatomy) { position: relative; z-index: 2; }
@media (prefers-reduced-motion: no-preference) {
  .anatomy.in .beam-pulse, .anatomy:not(.arm) .beam-pulse { animation: lt-svg-photon 4.6s cubic-bezier(.35, .1, .6, 1) 1.4s infinite; }
  .anatomy.in .anatomy-dot, .anatomy:not(.arm) .anatomy-dot { animation: lt-dot-breathe 3.6s ease-in-out calc(1.6s + var(--i) * .35s) infinite; }
}
.anatomy .beam-pulse { stroke: #f2fff5; stroke-width: 4; stroke-linecap: round; fill: none; stroke-dasharray: .06 3; stroke-dashoffset: .06; opacity: 0; filter: drop-shadow(0 0 6px var(--laser)); }
@keyframes lt-svg-photon { 0% { stroke-dashoffset: .06; opacity: 0; } 5% { opacity: 1; } 45% { opacity: .9; } 60%, 100% { stroke-dashoffset: -1; opacity: 0; } }
@keyframes lt-dot-breathe { 0%, 100% { box-shadow: 0 0 10px var(--laser-glow); } 50% { box-shadow: 0 0 18px 3px var(--laser-glow); } }
