/* The opening screen (Laz, 11-23): on the first visit in a browser tab the sun rises over its horizon and the
   name follows, while the page and the inventory load behind it. js/theme.js switches it on (html.sl-on)
   and off (html.sl-out). If that script never runs it stays hidden; if the page stalls it leaves by itself. */
.sunload{display:none}
html.sl-on .sunload{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;background:#EFEFE7;animation:sl-leave .45s ease 3.4s forwards}
html.sl-on[data-theme="dark"] .sunload{background:#0B0E0A}
html.sl-on.sl-out .sunload{opacity:0;visibility:hidden;pointer-events:none;transition:opacity .45s ease,visibility 0s .45s}
.sl-in{display:grid;justify-items:center;gap:1.125rem;width:min(15rem,62vw)}
.sl-sun{display:block;width:46%;overflow:hidden;position:relative;padding-bottom:1px}
.sl-sun img{display:block;width:100%;height:auto;transform:translateY(104%);animation:sl-rise .95s cubic-bezier(.2,.8,.2,1) .08s forwards}
.sl-sun::after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:#FCB33B;transform:scaleX(0);animation:sl-line .7s cubic-bezier(.2,.8,.2,1) forwards}
.sl-word{display:block;width:100%;height:auto;opacity:0;transform:translateY(.375rem);animation:sl-word .5s ease .55s forwards}
.sl-d,html[data-theme="dark"] .sl-l{display:none}
html[data-theme="dark"] .sl-d{display:block}
@keyframes sl-rise{to{transform:none}}
@keyframes sl-line{to{transform:scaleX(1)}}
@keyframes sl-word{to{opacity:1;transform:none}}
@keyframes sl-leave{to{opacity:0;visibility:hidden}}
@media (prefers-reduced-motion:reduce){
  .sl-sun img,.sl-word{animation:none;transform:none;opacity:1}
  .sl-sun::after{animation:none;transform:none}
  html.sl-on.sl-out .sunload{transition:none}
}

/* PAGE CHANGES (Laz, 11-24: "make sure the page changes are fast and smooth").
   Until the page's script has drawn it, <main> holds a full screen, so the footer can never show first.
   Where the browser supports it, one page cross-fades into the next; with reduced motion it simply swaps. */
#main:empty{min-height:100vh;min-height:100dvh}
@media (prefers-reduced-motion:no-preference){
  @view-transition{navigation:auto}
  ::view-transition-old(root),::view-transition-new(root){animation-duration:.16s;animation-timing-function:ease}
}

