/* Final layout pass: fix structural gaps, keep the page rhythm compact, and put subtle glints behind content. */
#story,#moments,#light,#jar,#grief{margin-top:0!important;margin-bottom:0!important;min-height:0!important}
#story{padding-top:3rem!important;padding-bottom:3rem!important}
#story .story-heading{margin-top:0!important;margin-bottom:2rem!important}
#story .story-inner{margin-top:0!important}

/* Moments: the rail itself must collapse to the actual card height. */
#moments{padding-top:2.5rem!important;padding-bottom:2.5rem!important;height:auto!important;overflow:hidden!important}
#moments .moments-head{margin-top:0!important;margin-bottom:1rem!important}
#moments .moment-track{height:auto!important;min-height:0!important;padding-top:0!important;padding-bottom:0!important;margin:0!important}
#moments .moment-grid{height:auto!important;min-height:0!important;padding-top:0!important;padding-bottom:0!important;align-items:flex-start!important}
#moments .moment-card:nth-child(2n){margin-top:30px!important}
#moments .moment-card:nth-child(3n){margin-top:8px!important}
#moments .moment-card:nth-child(4n){margin-top:42px!important}

/* Liam's Light: explicit grid rows prevent the project block from creating unexplained space. */
#light{padding-top:3rem!important;padding-bottom:3rem!important}
#light .light-inner{margin:0!important;display:grid!important;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)!important;grid-template-rows:auto auto!important;align-items:start!important;align-content:start!important;row-gap:2rem!important}
#light .light-copy{grid-column:1!important;grid-row:1!important;margin:0!important;align-self:start!important}
#light .places-note{grid-column:2!important;grid-row:1!important;margin:0!important;align-self:start!important}
#light .projects-in-light{grid-column:1 / -1!important;grid-row:2!important;margin:0!important;padding:0!important;min-height:0!important;align-self:start!important}
#light .projects{margin:0!important;padding:0 0 2rem!important;min-height:0!important}
#light .project-stories{margin:0!important;gap:2.25rem!important}
#light .project-story{margin:0!important}

/* Memory Jar: preserve the successful layout while removing outer dead space. */
#jar{padding-top:3rem!important;padding-bottom:3rem!important}
#jar>.section{margin:0 auto!important}
.jar>.section{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(360px,.9fr)!important;grid-template-rows:auto auto!important;column-gap:clamp(2rem,5vw,5rem)!important;row-gap:1rem!important;align-items:start!important}
.jar .section-heading.split{grid-column:1!important;grid-row:1!important;display:block!important;margin:0!important;max-width:560px!important;align-self:start!important}
.jar .section-heading.split>div{max-width:560px!important}
.jar .section-heading.split>p{max-width:480px!important;margin:1rem 0 0!important}
.jar .jar-inner{display:contents!important}
.jar .jar-copy{grid-column:1!important;grid-row:2!important;display:flex!important;flex-direction:column!important;justify-content:flex-start!important;align-self:start!important;max-width:500px!important;padding:0!important;margin:0!important}
.jar .jar-copy .button{align-self:flex-start!important;margin-top:.35rem!important}
.jar .jar-visual{grid-column:2!important;grid-row:1 / span 2!important;min-height:420px!important;width:100%!important;margin:0!important}
.jar .memory-jar-image{width:min(520px,100%)!important}

/* Space for Grief: start immediately after Memory Jar's real content. */
#grief{padding-top:3rem!important;padding-bottom:3rem!important}
#grief .grief-inner{margin:0!important;min-height:0!important}

/* Site-wide glints: generated individually, never the sprite, and always behind section content. */
.world::before,.world::after{display:none!important}
.site-sparkles{position:absolute!important;inset:0!important;z-index:0!important;pointer-events:none!important;overflow:hidden!important;background:none!important;background-image:none!important}
.site-sparkle{position:absolute!important;border-radius:50%!important;width:56px!important;height:56px!important;background-image:none!important;background:radial-gradient(circle at center,#fff 0 7%,rgba(255,235,160,.72) 10% 20%,transparent 48%)!important;opacity:.72!important;filter:drop-shadow(0 0 8px rgba(255,255,255,.95))!important;animation:sparkleTwinkle 5.8s ease-in-out infinite!important;transform:scale(.7)!important;will-change:opacity,transform,filter!important}
.site-sparkle:before,.site-sparkle:after{content:''!important;position:absolute!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;border-radius:999px!important;pointer-events:none!important}
.site-sparkle:before{width:2px!important;height:100%!important;background:linear-gradient(to bottom,transparent,rgba(255,255,255,.88) 34%,#fff 50%,rgba(255,255,255,.88) 66%,transparent)!important}
.site-sparkle:after{width:100%!important;height:2px!important;background:linear-gradient(to right,transparent,rgba(255,255,255,.88) 34%,#fff 50%,rgba(255,255,255,.88) 66%,transparent)!important}
.site-sparkle.s1{left:7%!important;top:12%!important;width:64px!important;height:64px!important;animation-delay:-1.2s!important}
.site-sparkle.s2{left:30%!important;top:25%!important;width:42px!important;height:42px!important;animation-delay:-4s!important}
.site-sparkle.s3{right:8%!important;top:39%!important;width:68px!important;height:68px!important;animation-delay:-2.4s!important}
.site-sparkle.s4{left:13%!important;top:53%!important;width:48px!important;height:48px!important;animation-delay:-4.8s!important}
.site-sparkle.s5{right:24%!important;top:68%!important;width:60px!important;height:60px!important;animation-delay:-3.1s!important}
.site-sparkle.s6{left:52%!important;top:84%!important;width:40px!important;height:40px!important;animation-delay:-5.5s!important}
.site-sparkles:before,.site-sparkles:after{content:''!important;position:absolute!important;border-radius:50%!important;background:radial-gradient(circle at center,#fff 0 9%,rgba(255,235,160,.62) 12% 22%,transparent 52%)!important;filter:drop-shadow(0 0 7px rgba(255,255,255,.8))!important;animation:sparkleTwinkle 6.8s ease-in-out infinite!important;pointer-events:none!important}
.site-sparkles:before{left:23%!important;top:42%!important;width:34px!important;height:34px!important;animation-delay:-2.4s!important}
.site-sparkles:after{right:34%!important;top:18%!important;width:28px!important;height:28px!important;animation-delay:-5.8s!important}
@keyframes sparkleTwinkle{0%,100%{opacity:.12;transform:scale(.55)}22%{opacity:.5;transform:scale(.72)}42%{opacity:1;transform:scale(1.08);filter:drop-shadow(0 0 12px rgba(255,255,255,1))}58%{opacity:.58;transform:scale(.82)}74%{opacity:.9;transform:scale(1)}86%{opacity:.2;transform:scale(.64)}}
.world>section{position:relative!important;z-index:1!important}

/* Keep the hero clean and distinctly white while retaining the warm lantern glow. */
#top.hero{background:linear-gradient(180deg,rgba(255,255,255,.78),rgba(255,255,255,.58))!important}

@media(max-width:800px){
  #story{padding-top:2rem!important;padding-bottom:2rem!important}
  #moments{padding-top:2rem!important;padding-bottom:2rem!important}
  #moments .moment-card:nth-child(2n){margin-top:20px!important}
  #moments .moment-card:nth-child(3n){margin-top:7px!important}
  #moments .moment-card:nth-child(4n){margin-top:30px!important}
  #light{padding-top:2rem!important;padding-bottom:2rem!important}
  #light .light-inner{display:block!important}
  #light .light-copy,#light .places-note,#light .projects-in-light{display:block!important;margin:0!important}
  #light .places-note{margin-top:1.5rem!important}
  #light .projects-in-light{margin-top:1.5rem!important}
  #light .project-stories{gap:1.5rem!important}
  #jar{padding-top:2rem!important;padding-bottom:2rem!important}
  .jar>.section{display:block!important}
  .jar .section-heading.split{margin:0 0 1rem!important;max-width:100%!important}
  .jar .section-heading.split>p{max-width:100%!important}
  .jar .jar-inner{display:block!important}
  .jar .jar-copy{display:block!important;max-width:100%!important;margin:0 0 1rem!important}
  .jar .jar-visual{min-height:340px!important}
  .jar .memory-jar-image{width:min(400px,94vw)!important}
  #grief{padding-top:2rem!important;padding-bottom:2rem!important}
  .site-sparkles{position:absolute!important;z-index:0!important}
  .site-sparkle{transform:scale(.72)!important}
}
@media(prefers-reduced-motion:reduce){.site-sparkle,.site-sparkles:before,.site-sparkles:after{animation:none!important;opacity:.75!important;transform:scale(.82)!important}}
