/* ============================================================
   LUCIDE ICONS — animated (lucide.dev, ISC), shared by every prototype page.
   Icons are inline SVG with class "lu lu-<name>"; motion is CSS only.
   pathLength="1" lets any stroke "draw" via dashoffset 1 → 0.
   All motion sits inside prefers-reduced-motion: no-preference.
   ============================================================ */
.lu * { transform-box: fill-box; transform-origin: center; }
.case-arrow, .btn-contact, .contact-btn { overflow: hidden; }

@keyframes luDraw { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
@keyframes luPop  { 0% { transform: scale(1); } 40% { transform: scale(.82); } 75% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes luBob  { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-2.2px); } }
@keyframes luWiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-10deg); } 45% { transform: rotate(8deg); } 70% { transform: rotate(-4deg); } }
@keyframes luSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes luQuarter { from { transform: rotate(0); } to { transform: rotate(90deg); } }
@keyframes luTwinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .15; transform: scale(.4); } }
@keyframes luFlap { 0% { transform: translateY(0); } 35% { transform: translateY(-3px) scaleY(-1); } 70%, 100% { transform: translateY(0) scaleY(1); } }
@keyframes luFly { 0% { transform: translate(0,0); opacity: 1; } 45% { transform: translate(9px,-9px); opacity: 0; } 46% { transform: translate(-9px,9px); opacity: 0; } 100% { transform: translate(0,0); opacity: 1; } }
@keyframes luSlide { 0% { transform: translateX(0); opacity: 1; } 45% { transform: translateX(10px); opacity: 0; } 46% { transform: translateX(-10px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes luNudgeL { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-3px); } }
@keyframes luNudgeR { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@keyframes luExpandA { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(1.5px,-1.5px); } }
@keyframes luExpandB { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(-1.5px,1.5px); } }
@keyframes luClick { 0%, 100% { transform: translate(0,0) scale(1); } 40% { transform: translate(-2.5px,-2.5px) scale(1); } 60% { transform: translate(0,0) scale(.85); } }
@keyframes luWave { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-14deg); } 65% { transform: rotate(6deg); } }

@media (prefers-reduced-motion: no-preference) {
  /* Home side nav — icons draw in once on load (JS toggles .lu-intro) */
  .side-nav.lu-intro .lu [pathLength] { animation: luDraw .9s cubic-bezier(.6,0,.2,1) both; }
  .side-nav.lu-intro a:nth-child(2) .lu [pathLength] { animation-delay: .08s; }
  .side-nav.lu-intro a:nth-child(3) .lu [pathLength] { animation-delay: .16s; }
  .side-nav.lu-intro a:nth-child(4) .lu [pathLength] { animation-delay: .24s; }
  .side-nav.lu-intro a:nth-child(5) .lu [pathLength] { animation-delay: .32s; }
  .side-nav.lu-intro a:nth-child(6) .lu [pathLength] { animation-delay: .40s; }
  .side-nav.lu-intro a:nth-child(7) .lu [pathLength] { animation-delay: .48s; }

  /* Home side nav — each icon has its own gesture on hover and when its section becomes active */
  .side-nav a:is(:hover, .active) .lu-user .lu-head { animation: luBob .7s ease-in-out; }
  .side-nav a:is(:hover, .active) .lu-user .lu-body { animation: luDraw .6s ease-out; }
  .side-nav a:is(:hover, .active) .lu-trend .lu-line { animation: luDraw .6s ease-out; }
  .side-nav a:is(:hover, .active) .lu-trend .lu-tip { animation: luDraw .35s ease-out .45s both; }
  .side-nav a:is(:hover, .active) .lu-case { animation: luWiggle .6s ease-in-out; transform-origin: 50% 20%; }
  .side-nav a:is(:hover, .active) .lu-compass .lu-needle { animation: luSpin .9s cubic-bezier(.5,-0.3,.3,1.4); }
  .side-nav a:is(:hover, .active) .lu-sparkles .lu-star { animation: luPop .6s ease-out; }
  .side-nav a:is(:hover, .active) .lu-sparkles .lu-tw1 { animation: luTwinkle .6s ease-in-out .1s; }
  .side-nav a:is(:hover, .active) .lu-sparkles .lu-tw2 { animation: luTwinkle .6s ease-in-out .25s; }
  .side-nav a:is(:hover, .active) .lu-route .lu-path { animation: luDraw .8s ease-in-out; }
  .side-nav a:is(:hover, .active) .lu-route .lu-b { animation: luPop .45s ease-out .6s; }
  .side-nav a:is(:hover, .active) .lu-mail .lu-flap { animation: luFlap .7s ease-in-out; transform-origin: 50% 0%; }

  /* AI tools — gesture on card hover / focus */
  .tool-card:is(:hover, :focus-within) .lu-sparkles .lu-star { animation: luPop .6s ease-out; }
  .tool-card:is(:hover, :focus-within) .lu-sparkles .lu-tw1 { animation: luTwinkle .8s ease-in-out .1s infinite; }
  .tool-card:is(:hover, :focus-within) .lu-sparkles .lu-tw2 { animation: luTwinkle .8s ease-in-out .4s infinite; }
  .tool-card:is(:hover, :focus-within) .lu-pointer path { animation: luClick .8s ease-in-out; }
  .tool-card:is(:hover, :focus-within) .lu-grid rect { animation: luPop .5s ease-out both; }
  .tool-card:is(:hover, :focus-within) .lu-grid .lu-g2 { animation-delay: .08s; }
  .tool-card:is(:hover, :focus-within) .lu-grid .lu-g3 { animation-delay: .16s; }
  .tool-card:is(:hover, :focus-within) .lu-grid .lu-g4 { animation-delay: .24s; }
  .tool-card:is(:hover, :focus-within) .lu-wand .lu-stick { animation: luWave .7s ease-in-out; transform-origin: 0% 100%; }
  .tool-card:is(:hover, :focus-within) .lu-wand .lu-tw1 { animation: luTwinkle .7s ease-in-out .15s; }
  .tool-card:is(:hover, :focus-within) .lu-wand .lu-tw2 { animation: luTwinkle .7s ease-in-out .3s; }
  .tool-card:is(:hover, :focus-within) .lu-wand .lu-tw3 { animation: luTwinkle .7s ease-in-out .45s; }

  /* Arrows — fly out and come back in */
  .case-card:hover .lu-arrow-ur, .btn-contact:hover .lu-arrow-ur { animation: luFly .55s cubic-bezier(.6,0,.2,1); }
  .contact-btn:hover .lu-arrow-r, .more-btn:hover .lu-arrow-r { animation: luSlide .55s cubic-bezier(.6,0,.2,1); }

  /* Theme toggle — sun rays turn, moon tilts */
  :is(.theme-btn, .side-theme):hover .lu-sun .lu-rays { animation: luSpin 1s cubic-bezier(.5,0,.2,1); transform-origin: 12px 12px; transform-box: view-box; }
  :is(.theme-btn, .side-theme):hover .lu-moon path { animation: luWiggle .7s ease-in-out; }

  /* Case pages — lightbox, demo link */
  [data-lightbox]:hover .lu-expand .lu-ea { animation: luExpandA .6s ease-in-out; }
  [data-lightbox]:hover .lu-expand .lu-eb { animation: luExpandB .6s ease-in-out; }
  [data-lightbox]:hover .lb-zoom .lu-play path { animation: luPop .5s ease-out; }
  .lb-prev:hover .lu-chev path { animation: luNudgeL .5s ease-in-out; }
  .lb-next:hover .lu-chev path { animation: luNudgeR .5s ease-in-out; }
  .lb-close:hover .lu-x { animation: luQuarter .35s cubic-bezier(.5,0,.2,1); }
  .demo-link:hover .lu-circle-play circle { animation: luDraw .7s ease-out; }
  .demo-link:hover .lu-circle-play .lu-tri { animation: luPop .5s ease-out .2s; }
}
