/* The opening screen (splash.js): the logo first big in the middle while the ink-wash figure loads, then the figure shows
   and the logo glides down, shrinking to its place over the paper at the bottom; about 4 s in all.
   A tap, a click or any key skips it. The failsafe animation lifts it by itself if the script never runs. */
#splash { position: fixed; inset: 0; z-index: 2147483000; display: block; overflow: hidden; background: #dccdab; cursor: pointer; transition: opacity .5s ease;
  animation: sp-gone .5s 8s forwards; }
#splash.out { opacity: 0; pointer-events: none; }
html.splashing dialog { visibility: hidden; }
.sp-back { visibility: hidden; display: none; position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; filter: blur(30px) saturate(.9); }
.sp-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--sp-pos, center 30%); opacity: 0; }
.sp-art.ready { opacity: 1; }
#splash.ready .sp-back { visibility: visible; }
.sp-veil { position: absolute; inset: auto 0 0; height: var(--sp-veil, 44%); background: linear-gradient(to top, #dccdabf2 35%, #dccdab00); }
.sp-txt { position: absolute; inset: auto 24px calc(var(--sp-txt, 196px) + env(safe-area-inset-bottom, 0px)); text-align: center; animation: sp-in .5s ease both;
  transition: transform 1.1s cubic-bezier(.4, 0, .2, 1); }
/* .intro (d-orbit.html): the logo big in the middle until the picture shows, then it glides down (the class goes). */
#splash.intro .sp-txt { transform: translateY(calc(var(--sp-txt, 196px) + 30px - 50svh)); }
#splash.intro .sp-logo { transform: none; }
#splash.intro .sp-slogan { opacity: 0; transition: none; }
/* Drawn at 82px and shrunk (× .415 = 34px), so the raster stays sharp; it shrinks toward its bottom edge. */
/* Drawn at its big size and shrunk at rest (82px × .415 = 34px), never blown up from small: a raster scaled up while it
   moves is blurry until it settles. It shrinks toward its bottom edge, so at rest it sits where it did. */
.sp-logo { display: block; height: 82px; width: auto; margin: 0 auto; transform: scale(.415); transform-origin: 50% 100%; transition: transform 1.1s cubic-bezier(.4, 0, .2, 1); }
.sp-slogan { margin: 6px 0 0; min-height: 1.25em; font: 500 13px/1.25 "Plus Jakarta Sans", system-ui, sans-serif; color: #3a2c1c; opacity: 0; transition: opacity .8s ease .6s; }
.sp-slogan.on { opacity: .85; } /* splash.js: the line fades in slowly once its words are in */
.sp-hint { position: absolute; inset: auto 0 calc(16px + env(safe-area-inset-bottom, 0px)); margin: 0; text-align: center; font: 500 12px "Plus Jakarta Sans", system-ui, sans-serif; color: #3a2c1c; opacity: .7; animation: sp-rise 3.2s ease both; }
.sp-bar { display: none; position: absolute; inset: auto 40px calc(14px + env(safe-area-inset-bottom, 0px)); height: 3px; border-radius: 2px; background: #3a2c1c22; overflow: hidden; }
.sp-bar b { display: block; height: 100%; width: 0; background: #3a2c1c; animation: sp-fill 2.5s linear forwards; }
/* Wide screens: the whole portrait, centred, its sides fading into the paper colour. */
@media (min-aspect-ratio: 1/1) {
  .sp-back { display: block; }
  .sp-art { object-fit: contain; object-position: center; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
  .sp-logo { height: 106px; } /* × .415 = 44px */
  .sp-slogan { font-size: 15px; }
}
@keyframes sp-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sp-in { from { opacity: 0; } }
@keyframes sp-fill { to { width: 100%; } }
@keyframes sp-gone { to { opacity: 0; visibility: hidden; pointer-events: none; } }
/* No Reduce Motion exception: the owner wants the same opening on every device (a tap skips it). */

/* splash.js homeHint(): the add-to-home-screen card for iPhone and iPad in a browser tab */
.home-hint { position: fixed; z-index: 1000; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: 420px; margin: 0 auto; padding: 14px 44px 14px 16px; border-radius: 14px; background: var(--d-panel, #fff); color: var(--d-ink, #1b1f24); border: 1px solid var(--d-line, transparent); box-shadow: 0 8px 30px rgba(0,0,0,.25); font-size: 15px; line-height: 1.45; }
[dir="rtl"] .home-hint { padding: 14px 16px 14px 44px; }
.home-hint b { display: block; margin-bottom: 4px; }
.home-hint p { margin: 0; }
.home-hint svg { vertical-align: -3px; color: #2f6fe0; }
.home-hint .hh-x { position: absolute; top: 8px; inset-inline-end: 8px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 16px; cursor: pointer; }
