/* Site motion. Everything here is inside prefers-reduced-motion:no-preference, so with reduced motion
   the page is static and fully visible; without JS nothing is hidden (reveal.js adds .rv). */
@media (prefers-reduced-motion: no-preference) {
  /* ---- scroll reveal (class added by reveal.js to below-the-fold items only) ---- */
  .rv{opacity:0;transform:translateY(22px);will-change:opacity,transform}
  .rv.rv-in{opacity:1;transform:none;transition:opacity .6s ease,transform .65s cubic-bezier(.2,.7,.2,1);transition-delay:calc(var(--rv-i,0)*80ms)}

  /* ---- hover: nav links and cards (colours per theme below) ---- */
  .header nav a:hover{box-shadow:0 0 16px -5px var(--frame-accent,#3ef0ff)}
  .cards>.card{transition:transform .25s cubic-bezier(.2,.7,.2,1),box-shadow .25s,border-color .25s}
  .cards>.card:hover{transform:translateY(-5px)}
  body.theme-blackshield{--lift:0 16px 30px -18px #000,0 0 0 1px rgba(193,18,31,.55),0 0 22px -10px rgba(193,18,31,.7)}
  body.theme-mods{--lift:0 16px 30px -18px #000,0 0 0 1px rgba(193,18,31,.55),0 0 22px -10px rgba(193,18,31,.7)}
  body.theme-glyphsmith{--lift:0 16px 30px -18px #000,0 0 0 1px rgba(143,151,161,.55),0 0 22px -10px rgba(143,151,161,.6)}
  body.theme-glyphsmith.palette-blackshield{--lift:0 16px 30px -18px #000,0 0 0 1px rgba(193,18,31,.55),0 0 22px -10px rgba(193,18,31,.7)}
  body.theme-glyphsmith.palette-steel-and-ember{--lift:0 16px 30px -18px #000,0 0 0 1px rgba(242,140,56,.55),0 0 22px -10px rgba(242,140,56,.6)}
  body.theme-ironwright{--lift:0 16px 30px -18px #000,0 0 0 1px rgba(124,196,196,.5),0 0 22px -10px rgba(224,178,92,.55)}
  body.theme-lampstand{--lift:0 16px 30px -18px #000,0 0 0 1px rgba(212,162,76,.45),0 0 26px -8px rgba(240,204,130,.35)}
  body.flat .card:hover,body.flat .card:focus-within{box-shadow:var(--lift,none)}

  /* ---- synthwave pages (home, projects, 404): grid, sun, haze, stars, hero gradient, neon accents ---- */
  /* grid lines run toward the horizon, seamless (one grid cell per loop; extra row below hides the seam) */
  .floor-grid{bottom:-64px;animation:grid-recede 2.6s linear infinite}
  .footer-floor{animation:footer-recede 3.2s linear infinite}
  /* sun: slice bands slide down in a seamless loop; the pulse also breathes the size slightly */
  .sun{-webkit-mask-size:100% 100%;mask-size:100% 100%;-webkit-mask-repeat:repeat-y;mask-repeat:repeat-y;
    animation:sun-pulse 6s ease-in-out infinite alternate,sun-slices 9s linear infinite,sun-breathe 6s ease-in-out infinite alternate}
  /* sun glow and horizon haze breathe (opacity only) */
  .horizon::before{animation:haze 7s ease-in-out infinite alternate}
  .horizon::after{content:"";position:absolute;left:50%;bottom:0;width:min(46vw,640px);height:clamp(80px,12vw,190px);margin-left:calc(min(46vw,640px)/-2);pointer-events:none;
    background:radial-gradient(ellipse 50% 100% at 50% 100%,rgba(224,204,255,.42),rgba(181,123,255,.18) 45%,transparent 72%);animation:sun-glow 5s ease-in-out infinite alternate}
  .stars{animation:twinkle 5s ease-in-out infinite alternate,star-drift 36s ease-in-out infinite alternate}
  .stars::after{animation:twinkle 3.4s ease-in-out infinite alternate-reverse}
  body.theme-home h1{background-size:200% 100%;animation:title-shift 11s ease-in-out infinite alternate}
  body.theme-home h2::after,.eyebrow::before{animation:neon-bar 3.6s ease-in-out infinite alternate}
  body.theme-home .button{transition:transform .2s,box-shadow .25s,filter .25s}
  body.theme-home .button:hover{filter:brightness(1.12);box-shadow:0 0 22px -4px rgba(181,123,255,.85)}
  body.theme-home .portrait-frame{animation:frame-glow 5s ease-in-out infinite alternate}

  /* ---- Blackshield and Mods: steel/blood edge sweep along the top band ---- */
  body.theme-blackshield main>.section:first-child::before,body.theme-mods main>.section:first-child::before{
    content:"";position:absolute;left:0;right:0;top:0;height:3px;pointer-events:none;
    background:linear-gradient(90deg,transparent,rgba(216,211,200,.9) 45%,rgba(193,18,31,.95) 55%,transparent) -50vw 0/40vw 100% no-repeat;animation:edge-sweep 7s ease-in-out infinite}
  body.theme-blackshield .lockup>img,body.theme-mods .lockup>img{animation:steel-gleam 6s ease-in-out infinite}

  /* ---- Glyphsmith: diamond shimmer ---- */
  body.theme-glyphsmith main>.section:first-child::before{content:"";position:absolute;inset:0;pointer-events:none;
    background:linear-gradient(105deg,transparent 40%,rgba(255,255,255,.055) 50%,transparent 60%) -60vw 0/60vw 100% no-repeat;animation:diamond-glint 9s ease-in-out infinite}
  body.theme-glyphsmith .lockup>img{animation:diamond-shimmer 4.8s ease-in-out infinite}
  body.theme-glyphsmith h2::before{animation:diamond-shimmer 4.8s ease-in-out infinite}

  /* ---- Ironwright: forge glow and amber sparks (the mark spark pulse is in ironwright.css) ---- */
  body.theme-ironwright main>.section:first-child::before{content:"";position:absolute;left:0;right:0;bottom:0;height:70%;pointer-events:none;
    background:radial-gradient(ellipse 45% 100% at 78% 100%,rgba(224,178,92,.14),transparent 70%);animation:forge-glow 5.5s ease-in-out infinite alternate}
  body.theme-ironwright p.tags.st-built{animation:spark 3.6s ease-in-out infinite}

  /* ---- Lampstand: soft candle flicker, no neon ---- */
  body.theme-lampstand .lamp-hero img{animation:candle-img 6.5s ease-in-out infinite}
  body.theme-lampstand .frame-mark{animation:candle-img 4.7s ease-in-out infinite}
  body.theme-lampstand .ministry .clip{animation:candle-box 7s ease-in-out infinite}

  @keyframes grid-recede{to{transform:translateY(-64px)}}
  @keyframes footer-recede{to{background-position:0 -44px,0 0}}
  @keyframes sun-slices{to{-webkit-mask-position:0 var(--sun-d);mask-position:0 var(--sun-d)}}
  @keyframes sun-breathe{from{transform:scale(1)}to{transform:scale(1.025)}}
  @keyframes haze{from{opacity:.72}to{opacity:1}}
  @keyframes sun-glow{from{opacity:.25}to{opacity:.85}}
  @keyframes star-drift{from{transform:translate3d(-6px,0,0)}to{transform:translate3d(8px,3px,0)}}
  @keyframes title-shift{to{background-position:100% 0}}
  @keyframes neon-bar{from{opacity:.65}to{opacity:1}}
  @keyframes frame-glow{from{box-shadow:0 0 0 1px rgba(62,240,255,.18),0 0 26px rgba(157,77,255,.35)}to{box-shadow:0 0 0 1px rgba(62,240,255,.4),0 0 44px rgba(157,77,255,.65)}}
  @keyframes edge-sweep{0%,18%{background-position:-50vw 0}75%,100%{background-position:110vw 0}}
  @keyframes steel-gleam{0%,100%{filter:brightness(1)}50%{filter:brightness(1.25) saturate(1.1)}}
  @keyframes diamond-glint{0%,15%{background-position:-60vw 0}70%,100%{background-position:110vw 0}}
  @keyframes diamond-shimmer{0%,100%{filter:brightness(1)}50%{filter:brightness(1.4) drop-shadow(0 0 6px rgba(224,230,240,.5))}}
  @keyframes forge-glow{from{opacity:.45}to{opacity:1}}
  @keyframes candle-img{0%,100%{filter:brightness(1)}30%{filter:brightness(1.05)}55%{filter:brightness(.97)}78%{filter:brightness(1.04)}}
  @keyframes candle-box{0%,100%{box-shadow:0 0 30px -10px rgba(240,204,130,.25)}50%{box-shadow:0 0 40px -8px rgba(240,204,130,.4)}}
}
/* defensive: nothing at all animates under reduced motion, and nothing stays hidden */
@media (prefers-reduced-motion: reduce) {
  .rv{opacity:1!important;transform:none!important}
  .floor-grid,.footer-floor,.sun,.horizon::before,.horizon::after,.stars,.stars::after,body.flat *{animation:none!important}
}
