/* Home, first visit only: the felt-paper curtain. Suri rises over a hill like a sunrise while the site is kept on the device;
   a paper progress bar fills with real progress. It lifts like torn paper (sky up, hill down; transforms and opacity only),
   or fades under reduced motion. js/sections/home/00-loader.js shows it; without that it stays hidden. */
.ld { position: fixed; inset: 0; z-index: 10000; display: block; overflow: hidden; contain: layout paint; --hill: 54vh; }
.ld[hidden] { display: none; }
html.ld-open { overflow: hidden; }

.ld__sky { position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(120% 70% at 50% 62%, #FFE9A8 0%, #FFF0CA 42%, var(--paper) 100%), var(--paper);
  clip-path: polygon(0% 0%, 100% 0%, 100.0% 97.3%, 97.1% 100.0%, 94.1% 100.0%, 91.2% 99.4%, 88.2% 98.9%, 85.3% 97.4%, 82.4% 97.1%, 79.4% 97.3%, 76.5% 96.5%, 73.5% 99.1%, 70.6% 97.7%, 67.6% 99.4%, 64.7% 97.7%, 61.8% 99.8%, 58.8% 99.4%, 55.9% 96.2%, 52.9% 97.0%, 50.0% 99.7%, 47.1% 98.0%, 44.1% 99.9%, 41.2% 97.7%, 38.2% 96.5%, 35.3% 98.6%, 32.4% 99.2%, 29.4% 97.2%, 26.5% 96.5%, 23.5% 97.5%, 20.6% 99.9%, 17.6% 99.1%, 14.7% 96.6%, 11.8% 97.1%, 8.8% 96.6%, 5.9% 96.4%, 2.9% 99.2%, 0.0% 96.9%); }
.ld__sky::before { content: ""; position: absolute; inset: 0; background: url(/assets/art/textures/paper-tile.webp) 0 0 / 512px 512px; opacity: .55; mix-blend-mode: multiply; }
.ld__glow { position: absolute; left: 50%; bottom: calc(var(--hill) - 10vh); width: min(120vmin, 900px); aspect-ratio: 1; translate: -50% 50%;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 203, 61, .75), rgba(255, 203, 61, .28) 55%, rgba(255, 203, 61, 0) 100%);
  opacity: 0; transform: scale(.4); }
.ld__suri { position: absolute; left: 50%; bottom: calc(var(--hill) - 13vh); width: clamp(150px, 30vmin, 300px); height: auto; margin-left: calc(clamp(150px, 30vmin, 300px) / -2);
  transform: translateY(62%); opacity: 0; filter: drop-shadow(0 8px 12px rgba(90, 42, 0, .28)); }

.ld__hill { position: absolute; left: 0; right: 0; bottom: 0; height: var(--hill); z-index: 2; }
.ld__rim, .ld__grass { position: absolute; inset: 0;
  clip-path: polygon(0.0% 29.8%, 2.9% 31.4%, 5.9% 29.8%, 8.8% 25.7%, 11.8% 23.2%, 14.7% 20.9%, 17.6% 17.2%, 20.6% 16.0%, 23.5% 14.2%, 26.5% 12.8%, 29.4% 8.8%, 32.4% 7.9%, 35.3% 5.8%, 38.2% 7.0%, 41.2% 5.8%, 44.1% 3.0%, 47.1% 5.7%, 50.0% 5.5%, 52.9% 4.6%, 55.9% 4.9%, 58.8% 4.0%, 61.8% 4.5%, 64.7% 7.2%, 67.6% 7.1%, 70.6% 9.1%, 73.5% 11.0%, 76.5% 12.3%, 79.4% 15.8%, 82.4% 18.0%, 85.3% 21.7%, 88.2% 23.2%, 91.2% 26.2%, 94.1% 28.5%, 97.1% 31.8%, 100.0% 29.9%, 100% 100%, 0% 100%); }
.ld__rim { background: #FFFDF8; translate: 0 -7px; }
.ld__grass { background: #5BB36C url(/assets/art/textures/grain-tile.webp) 0 0 / 512px 512px; background-blend-mode: multiply; }

.ld__card { position: absolute; left: 50%; bottom: clamp(70px, 14vh, 130px); width: min(440px, calc(100% - 32px)); translate: -50% 0; rotate: -1deg;
  padding: 20px 22px 16px; border-radius: 18px; background: #FFFDF8; box-shadow: var(--sh-paper-lift); text-align: center; color: var(--ink); }
.ld__line { margin: 0 0 14px; font: 800 clamp(19px, 2.6vw, 24px)/1.15 var(--font-display); letter-spacing: -.01em; text-wrap: balance; }
.ld__bar { position: relative; height: 16px; border-radius: 999px; overflow: hidden; background: var(--paper-deep); box-shadow: inset 0 1px 2px rgba(90, 42, 0, .35); }
.ld__fill { position: absolute; inset: 0; border-radius: 999px; background: linear-gradient(180deg, #FFD968, var(--sun-deep)); transform-origin: 0 50%; transform: scaleX(var(--p, .04));
  transition: transform .35s cubic-bezier(.16, .8, .3, 1); will-change: transform; }
.ld__count { margin: 8px 0 0; min-height: 1.2em; font: 700 var(--t-tiny)/1.2 var(--font-body); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ld__skip { position: absolute; left: 50%; bottom: clamp(18px, 4vh, 36px); translate: -50% 0; min-height: 44px; padding: 8px 22px; border: 0; border-radius: 999px;
  background: #FFFDF8; color: var(--ink); font: 800 16px/1 var(--font-display); box-shadow: var(--sh-paper); cursor: pointer; }
.ld__skip:hover { box-shadow: var(--sh-paper-lift); }
.ld__skip:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.ld__sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* in: Suri rises over the hill, the glow opens */
.ld.is-in .ld__suri { animation: ld-rise 1.5s cubic-bezier(.2, 1.15, .3, 1) .15s forwards; }
.ld.is-in .ld__glow { animation: ld-glow 1.8s cubic-bezier(.16, .8, .3, 1) .1s forwards, ld-breathe 3.2s ease-in-out 1.9s infinite alternate; }
.ld.is-in .ld__card { animation: ld-card .7s cubic-bezier(.16, .8, .3, 1) .35s backwards; }
@keyframes ld-rise { from { transform: translateY(62%); opacity: 0; } 12% { opacity: 1; } to { transform: translateY(0); opacity: 1; } }
@keyframes ld-glow { to { transform: scale(1); opacity: 1; } }
@keyframes ld-breathe { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes ld-card { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* out: the sky tears upward, the hill drops away */
.ld.is-out { pointer-events: none; }
.ld.is-out .ld__sky { transition: transform .95s cubic-bezier(.7, 0, .25, 1); transform: translateY(-104%); }
.ld.is-out .ld__hill { transition: transform .95s cubic-bezier(.7, 0, .25, 1) .04s; transform: translateY(104%); }

@media (max-width: 560px) { .ld { --hill: 50vh; } .ld__card { padding: 16px 16px 12px; } }
@media (max-height: 520px) { .ld { --hill: 62vh; } .ld__card { bottom: 64px; } .ld__line { margin-bottom: 8px; } }
@media (prefers-reduced-motion: reduce) {
  .ld__suri { transform: none; opacity: 1; animation: none !important; }
  .ld__glow { transform: none; opacity: 1; animation: none !important; }
  .ld__card { animation: none !important; }
  .ld__fill { transition: none; }
  .ld.is-out { opacity: 0; transition: opacity .25s linear; }
  .ld.is-out .ld__sky, .ld.is-out .ld__hill { transition: none; transform: none; }
}
