/* Decorative layers. Every moving layer uses transform/opacity or a bounded canvas. */
.page-ambience{position:fixed;inset:0;z-index:-3;overflow:hidden;pointer-events:none;background:radial-gradient(ellipse at 15% 20%,rgba(18,54,101,.32),transparent 55%),radial-gradient(ellipse at 90% 70%,rgba(18,54,101,.2),transparent 45%),var(--night)}
.pattern-stars,.pattern-constellations{position:absolute;inset:0;pointer-events:none;background-repeat:repeat}
.pattern-stars{background-image:url('/static/patterns/celestial-stars.svg');background-size:320px 260px;opacity:.6;animation:star-breath 9s ease-in-out infinite alternate}
.pattern-constellations{background-image:url('/static/patterns/constellations.svg');background-size:640px 480px;opacity:var(--pattern-opacity)}
.magic-particles{position:fixed;inset:0;z-index:2;pointer-events:none;opacity:.65}
.emblem-orbit{animation:astral-turn 200s linear infinite}
.footer-astral .arcane-art{animation:star-breath 12s ease-in-out infinite alternate}
.lore-watermark{right:0;animation:astral-turn 320s linear infinite}
.hero-trails{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:-1;opacity:.5}
.hero-trails span{position:absolute;left:38%;top:32%;width:230px;height:1px;background:linear-gradient(90deg,transparent,rgba(212,175,55,.45),var(--gold-bright));transform:rotate(-25deg);animation:magical-trail 22s ease-in-out infinite}
.hero-trails span:after{content:'';position:absolute;right:0;top:-2px;width:4px;height:4px;border-radius:50%;background:var(--gold-bright);box-shadow:0 0 12px rgba(255,215,0,.5)}
.enchanted-mist{position:absolute;bottom:-12px;left:-10%;width:120%;height:160px;z-index:0;pointer-events:none;background:radial-gradient(ellipse at 25% 95%,rgba(18,54,101,.32),transparent 65%),radial-gradient(ellipse at 70% 100%,rgba(28,62,105,.25),transparent 60%),linear-gradient(0deg,var(--night),transparent);opacity:.8;animation:mist-drift 24s ease-in-out infinite alternate}
.hero-rise{animation:content-rise .9s var(--ease) both}
.hero-delay-1{animation-delay:.1s}.hero-delay-2{animation-delay:.2s}.hero-delay-3{animation-delay:.3s}.hero-delay-4{animation-delay:.4s}
[data-reveal].reveal-ready{opacity:0;transform:translateY(18px);transition:opacity var(--duration-reveal) var(--ease),transform var(--duration-reveal) var(--ease),border-color var(--duration-base)}
[data-reveal].revealed{opacity:1;transform:none}
@keyframes content-rise{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
@keyframes star-breath{from{opacity:.35}to{opacity:.7}}
@keyframes astral-turn{to{transform:rotate(360deg)}}
@keyframes magical-trail{0%,68%{opacity:0;transform:translate(-120px,80px) rotate(-25deg)}72%{opacity:.65}83%{opacity:0;transform:translate(300px,-100px) rotate(-25deg)}100%{opacity:0;transform:translate(300px,-100px) rotate(-25deg)}}
@keyframes mist-drift{from{transform:translateX(-3%);opacity:.6}to{transform:translateX(3%);opacity:.85}}
@view-transition{navigation:auto}
::view-transition-old(root){animation:page-out 140ms ease-out both}
::view-transition-new(root){animation:page-in 220ms ease-out both}
@keyframes page-out{to{opacity:0}}
@keyframes page-in{from{opacity:0}to{opacity:1}}
@media(max-width:899px){.hero-scenery{will-change:auto}.emblem-orbit{animation:none}.pattern-stars{animation-duration:15s}.hero-trails{display:none}.enchanted-mist{animation:none;opacity:.7}.footer-astral .arcane-art{animation:none}.lore-watermark{animation:none}}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*:before,*:after{animation:none!important;transition:none!important}
  .magic-particles,.hero-trails{display:none}
  .hero-scenery{will-change:auto;transform:none!important}
  [data-reveal].reveal-ready{opacity:1;transform:none}
  ::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none!important}
}
@media print{.main-header,.footer,.page-ambience,.magic-particles,.hero-trails,.enchanted-mist,.section-watermark{display:none!important}body{background:#fff;color:#111}.rule-card,.chapter,.application-content{box-shadow:none;break-inside:avoid}.container{width:100%}a{color:inherit}}
