/* A lightweight sky and one progress lap around the existing Story House logo. */
.experience .loading {
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(180deg, #73bdf0 0%, #b7e2fa 58%, #eaf7ff 100%);
}
:root[data-welcome-time="night"] .experience .loading {
  background: linear-gradient(180deg, #080f2b 0%, #17284f 56%, #304774 100%);
}
.welcome-sky { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.welcome-sun {
  position: absolute; top: 12%; right: 16%; width: 78px; height: 78px;
  border-radius: 50%; background: #ffdf80;
  box-shadow: 0 0 0 12px #ffe6a344, 0 0 0 27px #ffe6a320, 0 0 90px 18px #fff0b77a;
}
.welcome-cloud { position: absolute; width: clamp(120px, 19vw, 280px); fill: #fff; opacity: 0.76; animation: welcome-cloud-drift 24s ease-in-out infinite alternate; }
.welcome-cloud--one { left: 7%; top: 20%; }
.welcome-cloud--two { right: 6%; top: 39%; width: clamp(100px, 13vw, 190px); opacity: 0.55; animation-delay: -10s; }
.welcome-cloud--three { left: 18%; bottom: 13%; width: clamp(120px, 21vw, 310px); opacity: 0.4; animation-delay: -16s; }
.welcome-stars, .welcome-aurora, .welcome-moon { display: none; }
:root[data-welcome-time="night"] .welcome-cloud,
:root[data-welcome-time="night"] .welcome-sun { display: none; }
:root[data-welcome-time="night"] .welcome-stars,
:root[data-welcome-time="night"] .welcome-aurora,
:root[data-welcome-time="night"] .welcome-moon { display: block; }
.welcome-stars { position: absolute; inset: 0; width: 100%; height: 100%; fill: #eef5ff; }
.welcome-star { animation: welcome-star-glow 5s ease-in-out infinite alternate; }
.welcome-star--1 { animation-delay: -2s; }
.welcome-star--2 { animation-delay: -4s; opacity: 0.45; }
.welcome-moon { position: absolute; top: 12%; right: 17%; width: 68px; fill: #fff1c4; filter: drop-shadow(0 0 14px #f5e4bd66); }
.welcome-aurora { position: absolute; inset: -15% -12% 35%; opacity: 0.55; }
.welcome-aurora span {
  position: absolute; left: -10%; top: 16%; width: 120%; height: 45%;
  border-radius: 50%; transform: rotate(-18deg);
  background: linear-gradient(180deg, transparent 14%, #65efc000 35%, #65efc052 57%, #74dfff88 67%, transparent 76%);
  filter: blur(22px); animation: welcome-aurora-flow 16s ease-in-out infinite alternate;
}
.welcome-aurora span:nth-child(2) { top: 23%; transform: rotate(14deg); background: linear-gradient(180deg, transparent 26%, #9d86f077 60%, #c39dff66 67%, transparent 80%); animation-delay: -7s; }
.welcome-aurora span:nth-child(3) { top: 34%; left: -30%; opacity: 0.65; animation-delay: -12s; }
.experience .loading .loading__inner { position: relative; z-index: 1; gap: 12px; padding: 24px; }
.experience .legal-footer {
  position: fixed; z-index: 20; left: 50%; bottom: max(8px, env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0;
  border: 0; border-radius: 0; background: transparent; color: #745e4b;
  font: 600 8px/1.3 system-ui, sans-serif; white-space: nowrap;
  box-shadow: none; backdrop-filter: none; transform: translateX(-50%);
}
.experience.mode-detail .legal-footer, .experience.mode-reading .legal-footer { display: none; }
.experience .legal-footer a { color: inherit; text-decoration: none; }
.experience .legal-footer a:hover, .experience .legal-footer a:focus-visible { color: #b55b3c; text-decoration: underline; text-underline-offset: 3px; }
:root[data-welcome-time="night"] .experience .legal-footer { background: transparent; color: #e3edff; border-color: transparent; }
.experience .loading .loading__logo {
  display: block; position: relative; width: clamp(170px, 26vh, 220px); height: clamp(170px, 26vh, 220px);
  padding: 0; border: 0; background: transparent; border-radius: 25%;
  isolation: isolate; animation: loading-hop 1.8s ease-in-out infinite;
  cursor: default; -webkit-tap-highlight-color: transparent;
}
.experience .loading.is-ready .loading__logo { cursor: default; }
.experience .loading .loading__logo:focus-visible { outline: none; }
.experience .loading .loading__logo:focus-visible .loading__orbit { filter: blur(10px) brightness(1.2); }
.experience .loading .loading__house { position: relative; z-index: 1; }
.experience .loading .loading__bell, .experience .loading .loading__wave { z-index: 2; }
.experience .loading .loading__house .brand__window { fill: #879cba; transition: fill 650ms ease, filter 650ms ease; }
.experience .loading.is-ready .loading__house .brand__window { fill: #fff3a4; filter: drop-shadow(0 0 4px #ffd776) drop-shadow(0 0 8px #ffcc6680); }
.experience .loading .loading__orbit {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  pointer-events: none; opacity: 1; filter: blur(10px); transform: scale(1.045);
}
.loading__track { display: none; }
.loading__trail { fill: none; stroke: url(#welcome-rainbow); stroke-width: 9; }
.loading__spark { fill: #dab5ff; opacity: 0.55; transition: opacity 400ms ease; }
.is-ready .loading__spark { opacity: 0; }
.experience .loading p.loading__text { color: #315c80; text-shadow: 0 1px 8px #ffffff70; font-size: clamp(15px, 2.4vw, 18px); }
:root[data-welcome-time="night"] .experience .loading p.loading__text { color: #e3edff; text-shadow: none; }
@keyframes welcome-cloud-drift { from { transform: translateX(-12px); } to { transform: translateX(18px); } }
@keyframes welcome-star-glow { from { opacity: 0.35; } to { opacity: 0.95; } }
@keyframes welcome-aurora-flow { from { translate: -3% -3%; scale: 0.95 1; } to { translate: 4% 5%; scale: 1.04 1.1; } }
@media (max-width: 600px) {
  .welcome-sun { width: 58px; height: 58px; top: 10%; right: 13%; }
  .welcome-moon { width: 54px; top: 10%; right: 13%; }
  .welcome-cloud--one { left: -3%; top: 23%; }
  .welcome-cloud--two { right: -8%; top: 58%; }
  .welcome-cloud--three { left: 7%; bottom: 10%; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .experience .loading .loading__logo { width: 135px; height: 135px; }
  .experience .loading .loading__inner { gap: 5px; padding: 12px; }
  .experience .loading .loading__title { width: 230px; }
}
@media (prefers-reduced-motion: reduce) {
  .experience .loading .welcome-cloud, .experience .loading .welcome-star,
  .experience .loading .welcome-aurora span, .experience .loading .loading__logo,
  .experience .loading .loading__bell, .experience .loading .loading__wave,
  .experience .loading.is-ready .loading__logo,
  .experience .loading.is-ready .loading__bell { animation: none; }
  .experience .loading .loading__house .brand__window { transition: none; }
}
