/* The page as one day at Lone Pine: the sky behind every section, from sunrise over the Inyos at the hero to sunset
   behind Whitney at the close.
   - One fixed room holds the sky (sky.js fills it). Each time of day is its own still gradient; as the page scrolls,
     sky.js crossfades two neighbours by opacity and keeps the rest out of the page, so nothing big repaints while it
     moves. The sun, the clouds, the stars and the dawn's mountains are their own layers, moved by transform and faded
     by opacity.
   - The hero opens on the Inyo Mountains across the Owens Valley from Lone Pine (assets/sky/inyo.svg, traced from
     elevation data), the sun clearing the ridge where it really does this time of year, its light fanning up behind
     the words and the valley floor bare in the morning haze. As the page scrolls the range drops away below the
     window, the way the ground does when you look up, and the sun climbs into the day.
   - The day's clouds change with it: the Sierra wave's lens clouds lit gold from below at dawn, small puffs in the
     morning, heaped cumulus through the middle of the day, gold-lit puffs at golden hour and pink streaks at sunset.
   - Words sit straight on the sky, so every daytime gradient stays light enough for the page's ink. After sunset a
     violet and coral twilight comes between the day and the dusk, so the sky never goes grey as it darkens.
   - The close is the Sierra Nevada's east face from Lone Pine just after sunset (assets/sky/sierra.svg): Langley, Lone
     Pine Peak, Whitney with its needles, Russell and Williamson, traced from elevation data, over the Alabama Hills.
     The sun waits low at the window's edge until the mountains come up, then sets in the notch beside Whitney as the
     page reaches its end, and the stars come out behind it.
   - Reduced motion and ?edit: the colours still follow the page and the Inyos fade as the hero leaves, but nothing
     moves: the sun stays on the ridge, the clouds hold their places and the stars hold still. */

/* the overscroll beyond either end: dawn above the top, the valley floor below the footer */
body { background: #b6c6ef; }
.sky-low body { background: #100d32; }

.room { position: fixed; top: 0; left: 0; z-index: -1; width: 100%; height: 100vh; height: 100lvh; overflow: hidden; pointer-events: none;
  background: var(--sky-dawn); --ridge: 86vh; }
:root {
  --sky-dawn:
    radial-gradient(70% 55% at 20% 100%, rgba(255, 214, 150, .7) 0%, rgba(255, 214, 150, 0) 70%),
    linear-gradient(180deg, #b6c6ef 0%, #c9cdf0 26%, #ecd2e6 52%, #ffd6c0 76%, #ffc888 100%);
}
.sky { position: absolute; inset: 0; will-change: opacity; }
.sky[hidden] { display: none; }
/* dawn: clear blue overhead, warming through rose and apricot to gold along the ridge; sky.js sets --ridge to where
   the sun comes up */
.sky--dawn { background: linear-gradient(180deg, #b6c6ef 0, #c4ccf1 calc(var(--ridge) * .28), #dcd1ee calc(var(--ridge) * .5), #f3d4e1 calc(var(--ridge) * .66),
  #ffd6c2 calc(var(--ridge) * .8), #ffd2a2 calc(var(--ridge) * .92), #ffc888 var(--ridge), #ffc888 100%); }
.sky--morning { background:
    radial-gradient(60% 45% at 22% 100%, rgba(255, 232, 170, .55) 0%, rgba(255, 232, 170, 0) 70%),
    linear-gradient(180deg, #b4d8f6 0%, #cde5f8 34%, #e8f2f8 66%, #fff0d9 100%); }
.sky--noon { background:
    radial-gradient(80% 50% at 50% 0%, rgba(255, 255, 255, .35) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #a6d4f6 0%, #bfe2f8 32%, #dbf0fb 66%, #f2f9fe 100%); }
.sky--after { background:
    radial-gradient(70% 50% at 78% 20%, rgba(255, 250, 225, .35) 0%, rgba(255, 250, 225, 0) 70%),
    linear-gradient(180deg, #abd5f2 0%, #c6e4f5 34%, #e0f0f1 66%, #f3f6e6 100%); }
.sky--golden { background:
    radial-gradient(70% 50% at 82% 100%, rgba(255, 196, 110, .55) 0%, rgba(255, 196, 110, 0) 70%),
    linear-gradient(180deg, #c3cdf0 0%, #d9d7f0 28%, #f2ddde 56%, #ffe0b8 82%, #ffd296 100%); }
.sky--sunset { background:
    radial-gradient(80% 55% at 66% 100%, rgba(255, 170, 110, .55) 0%, rgba(255, 170, 110, 0) 70%),
    linear-gradient(180deg, #cfc8f0 0%, #dfc5e8 28%, #f4c6cf 56%, #ffcfae 80%, #ffbf8c 100%); }
.sky--twilight { background:
    radial-gradient(90% 60% at 62% 100%, rgba(255, 168, 112, .6) 0%, rgba(255, 168, 112, 0) 70%),
    linear-gradient(180deg, #7066b4 0%, #8d72b8 26%, #c283ad 52%, #f29a8f 76%, #ffb27c 100%); }
.sky--dusk { background: linear-gradient(180deg, #110e40 0%, #1a1754 24%, #2a2472 46%, #45338a 64%, #66428e 80%, #8c4f8e 92%, #b0608a 100%); }

/* the sun: a disc in its own light; warm when it's low, red as it sets. sky.js moves it and sizes its light. */
.sky__sun { display: none; }
.sky-moves .sky__sun, .is-dawn .sky__sun { display: block; }
.sky__sun[hidden] { display: none; }
.sky__sun { --r: clamp(26px, 3.1vw, 46px); position: absolute; left: 0; top: 0; width: calc(var(--r) * 7); height: calc(var(--r) * 7);
  margin: calc(var(--r) * -3.5) 0 0 calc(var(--r) * -3.5); will-change: transform; }
.sky__sun i { position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle closest-side, #fffdf2 0 26%, #fff2c6 28.4%, rgba(255, 233, 170, .5) 30.5%, rgba(255, 222, 160, .26) 44%, rgba(255, 214, 150, .1) 68%, rgba(255, 210, 150, 0) 100%); }
.sky__sun-warm { opacity: 0; will-change: opacity; }
.sky__sun i.sky__sun-warm {
  background: radial-gradient(circle closest-side, #fffef8 0 25%, #fff6da 27.5%, rgba(255, 234, 176, .9) 29.5%, rgba(255, 220, 150, .62) 34%, rgba(255, 204, 136, .38) 46%, rgba(255, 188, 136, .17) 68%, rgba(255, 180, 140, 0) 100%); }
.sky__sun-red { opacity: 0; will-change: opacity; }
.sky__sun i.sky__sun-red {
  background: radial-gradient(circle closest-side, #ffe2b4 0 16%, #ffb276 25%, #ff925e 28.4%, rgba(255, 120, 90, .62) 30.5%, rgba(250, 105, 105, .34) 48%, rgba(240, 100, 120, .13) 72%, rgba(240, 100, 120, 0) 100%); }

/* ---------- the dawn: the Inyos from Lone Pine, the sun's light along the ridge ---------- */
.sky__land, .sky__glow { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
/* the sun and the range come in together once the drawing has loaded */
.room:not(.is-dawn) :is(.sky__land, .sky__glow, .sky__sun) { visibility: hidden; }
.is-dawn :is(.sky__land, .sky__glow, .sky__sun) { animation: sky-in 1.2s ease backwards; }
@keyframes sky-in { from { opacity: 0; } }
.sky__land { width: 100%; height: 100%; overflow: hidden; }
.sky__land img { position: absolute; display: block; max-width: none; user-select: none; }
/* the valley floor goes on below the drawing, behind the hero's phones */
.sky__land::after { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--land-foot, 100%) - 2px); bottom: 0; background: #9886bd; }
.sky__glow { width: 1px; height: 1px; }
.sky__glow::before, .sky__glow::after { content: ""; position: absolute; border-radius: 50%; }
.sky__glow::before { left: calc(var(--g) * -1.2); top: calc(var(--g) * -.36); width: calc(var(--g) * 2.4); height: calc(var(--g) * .72);
  background: radial-gradient(closest-side, rgba(255, 238, 184, 1) 0%, rgba(255, 228, 164, .9) 10%, rgba(255, 212, 146, .62) 24%, rgba(255, 194, 148, .3) 45%, rgba(255, 186, 160, .1) 70%, rgba(255, 186, 160, 0) 100%); }
/* the rays: light through the gaps in the ridge, fanning up from behind it */
.sky__glow::after { left: calc(var(--g) * -.8); top: calc(var(--g) * -.8); width: calc(var(--g) * 1.6); height: calc(var(--g) * 1.6);
  background: conic-gradient(from 0deg,
    rgba(255, 244, 214, 0) 0deg, rgba(255, 244, 214, .14) 3deg, rgba(255, 244, 214, 0) 6deg, rgba(255, 244, 214, 0) 14deg, rgba(255, 244, 214, .1) 17deg, rgba(255, 244, 214, 0) 19deg,
    rgba(255, 244, 214, 0) 27deg, rgba(255, 244, 214, .16) 30deg, rgba(255, 244, 214, 0) 34deg, rgba(255, 244, 214, 0) 42deg, rgba(255, 244, 214, .1) 44deg, rgba(255, 244, 214, 0) 47deg,
    rgba(255, 244, 214, 0) 54deg, rgba(255, 244, 214, .13) 57deg, rgba(255, 244, 214, 0) 61deg, rgba(255, 244, 214, 0) 69deg, rgba(255, 244, 214, .09) 71deg, rgba(255, 244, 214, 0) 74deg,
    rgba(255, 244, 214, 0) 80deg, rgba(255, 244, 214, .12) 83deg, rgba(255, 244, 214, 0) 87deg, rgba(255, 244, 214, 0) 273deg, rgba(255, 244, 214, .1) 276deg, rgba(255, 244, 214, 0) 279deg,
    rgba(255, 244, 214, 0) 286deg, rgba(255, 244, 214, .14) 289deg, rgba(255, 244, 214, 0) 293deg, rgba(255, 244, 214, 0) 300deg, rgba(255, 244, 214, .1) 302deg, rgba(255, 244, 214, 0) 305deg,
    rgba(255, 244, 214, 0) 313deg, rgba(255, 244, 214, .16) 317deg, rgba(255, 244, 214, 0) 320deg, rgba(255, 244, 214, 0) 328deg, rgba(255, 244, 214, .11) 331deg, rgba(255, 244, 214, 0) 333deg,
    rgba(255, 244, 214, 0) 341deg, rgba(255, 244, 214, .14) 344deg, rgba(255, 244, 214, 0) 348deg, rgba(255, 244, 214, 0) 360deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 6%, rgba(0, 0, 0, .55) 38%, rgba(0, 0, 0, 0) 100%);
  mask-image: radial-gradient(closest-side, #000 6%, rgba(0, 0, 0, .55) 38%, rgba(0, 0, 0, 0) 100%); }

/* ---------- clouds: each its own small layer, passing slower than the page; which ones show follows the time of day ---------- */
.sky__clouds { position: absolute; inset: 0; }
.sky__cloud { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
.sky__cloud[hidden] { display: none; }
/* morning: small fair-weather puffs */
.sky__cloud--puff { width: 400px; height: 150px;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, .7) 45%, rgba(255, 255, 255, 0)) 22% 66% / 36% 64% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, .98), rgba(255, 255, 255, .75) 45%, rgba(255, 255, 255, 0)) 46% 34% / 44% 84% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, .7) 45%, rgba(255, 255, 255, 0)) 70% 54% / 38% 70% no-repeat,
    radial-gradient(closest-side, rgba(255, 252, 240, .9), rgba(255, 252, 240, 0)) 88% 74% / 26% 44% no-repeat,
    radial-gradient(closest-side, rgba(244, 236, 226, .75), rgba(244, 236, 226, 0)) 50% 92% / 92% 30% no-repeat; }
.sky__cloud--puff-b { width: 340px; height: 130px;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, .7) 45%, rgba(255, 255, 255, 0)) 18% 70% / 32% 56% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, .97), rgba(255, 255, 255, .72) 45%, rgba(255, 255, 255, 0)) 40% 42% / 36% 76% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, .98), rgba(255, 255, 255, .75) 45%, rgba(255, 255, 255, 0)) 64% 30% / 40% 86% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, .92), rgba(255, 255, 255, 0)) 86% 64% / 30% 60% no-repeat,
    radial-gradient(closest-side, rgba(240, 236, 232, .7), rgba(240, 236, 232, 0)) 50% 92% / 96% 28% no-repeat; }
/* midday: heaped cumulus, bright crowns over flat grey-blue bases */
.sky__cloud--heap { width: 560px; height: 260px;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, 1), rgba(255, 255, 255, .85) 50%, rgba(255, 255, 255, 0)) 46% 18% / 34% 52% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, 1), rgba(255, 255, 255, .8) 50%, rgba(255, 255, 255, 0)) 30% 40% / 34% 54% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, .98), rgba(255, 255, 255, .8) 50%, rgba(255, 255, 255, 0)) 64% 34% / 36% 58% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, 0)) 14% 66% / 28% 42% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, 0)) 84% 62% / 30% 46% no-repeat,
    radial-gradient(closest-side, rgba(250, 252, 255, .96), rgba(250, 252, 255, .75) 50%, rgba(250, 252, 255, 0)) 50% 62% / 74% 48% no-repeat,
    radial-gradient(closest-side, rgba(203, 216, 236, .9), rgba(203, 216, 236, .55) 55%, rgba(203, 216, 236, 0)) 50% 84% / 86% 26% no-repeat; }
.sky__cloud--heap-b { width: 480px; height: 220px;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, 1), rgba(255, 255, 255, .85) 50%, rgba(255, 255, 255, 0)) 58% 20% / 38% 56% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, .98), rgba(255, 255, 255, .8) 50%, rgba(255, 255, 255, 0)) 36% 44% / 36% 56% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, 0)) 78% 52% / 30% 48% no-repeat,
    radial-gradient(closest-side, rgba(250, 252, 255, .95), rgba(250, 252, 255, .75) 50%, rgba(250, 252, 255, 0)) 50% 64% / 76% 46% no-repeat,
    radial-gradient(closest-side, rgba(206, 218, 238, .9), rgba(206, 218, 238, .55) 55%, rgba(206, 218, 238, 0)) 50% 86% / 88% 24% no-repeat; }
/* dawn: the Sierra wave's lens clouds over the valley, rose on top and lit gold from below (drawn by sierra.py) */
.sky__cloud--streak { width: 640px; height: 80px; background: url(/assets/sky/dawn-lens.svg) center / 100% 100% no-repeat; }
.sky__cloud--streak-b { width: 720px; height: 56px; background: url(/assets/sky/dawn-lens-b.svg) center / 100% 100% no-repeat; }
/* golden hour: puffs with warm, lit bellies */
.sky__cloud--gold { width: 400px; height: 150px;
  background:
    radial-gradient(closest-side, rgba(255, 252, 244, .95), rgba(255, 250, 238, .7) 45%, rgba(255, 250, 238, 0)) 26% 58% / 38% 64% no-repeat,
    radial-gradient(closest-side, rgba(255, 253, 246, .97), rgba(255, 250, 238, .72) 45%, rgba(255, 250, 238, 0)) 50% 32% / 42% 80% no-repeat,
    radial-gradient(closest-side, rgba(255, 250, 240, .95), rgba(255, 246, 230, .7) 45%, rgba(255, 246, 230, 0)) 74% 52% / 36% 66% no-repeat,
    radial-gradient(closest-side, rgba(255, 214, 150, .9), rgba(255, 200, 140, .5) 50%, rgba(255, 200, 140, 0)) 50% 86% / 88% 34% no-repeat; }
.sky__cloud--gold-thin { width: 600px; height: 64px;
  background:
    radial-gradient(closest-side, rgba(255, 236, 196, .9), rgba(255, 224, 176, .5) 50%, rgba(255, 224, 176, 0)) 38% 56% / 64% 60% no-repeat,
    radial-gradient(closest-side, rgba(255, 244, 222, .85), rgba(255, 244, 222, 0)) 70% 46% / 50% 56% no-repeat; }
/* sunset: streaks gone pink and coral, with violet undersides */
.sky__cloud--rose { width: 660px; height: 80px;
  background:
    radial-gradient(closest-side, rgba(255, 190, 160, .95), rgba(255, 176, 156, .55) 50%, rgba(255, 176, 156, 0)) 40% 40% / 66% 52% no-repeat,
    radial-gradient(closest-side, rgba(236, 160, 190, .85), rgba(236, 160, 190, .45) 50%, rgba(236, 160, 190, 0)) 54% 70% / 74% 44% no-repeat,
    radial-gradient(closest-side, rgba(255, 206, 170, .8), rgba(255, 206, 170, 0)) 80% 44% / 40% 50% no-repeat,
    radial-gradient(closest-side, rgba(255, 200, 176, .7), rgba(255, 200, 176, 0)) 12% 56% / 26% 40% no-repeat; }
.sky__cloud--rose-thin { width: 720px; height: 46px;
  background:
    radial-gradient(closest-side, rgba(255, 188, 168, .85), rgba(255, 188, 168, .4) 50%, rgba(255, 188, 168, 0)) 36% 50% / 60% 70% no-repeat,
    radial-gradient(closest-side, rgba(240, 170, 196, .75), rgba(240, 170, 196, 0)) 72% 54% / 50% 60% no-repeat; }

.sky__stars { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; will-change: opacity; }
.sky__stars[hidden] { display: none; }

/* ---------- the close: the Sierra at sunset ---------- */
.close { --sierra-h: clamp(300px, 30vw, 700px); container-type: inline-size;
  /* the drawing's scale, as its slice fit works it out, so the glow can sit where the sun went down */
  --s: max(100cqw / 4000, var(--sierra-h) / 1029); }
.close__sierra { position: absolute; z-index: -1; left: 0; bottom: -1px; width: 100%; height: calc(var(--sierra-h) + 1px); max-width: none;
  object-fit: cover; object-position: 50% 100%; pointer-events: none; user-select: none; }
/* the afterglow where the sun just went down, in the notch beside Whitney */
.close::before { content: ""; position: absolute; z-index: -2; inset: 0; pointer-events: none;
  background:
    radial-gradient(max(1700 * var(--s), 80cqw) max(760 * var(--s), 250px) at calc(50% + 483 * var(--s)) calc(100% - 637 * var(--s)),
      rgba(255, 230, 168, .95) 0%, rgba(255, 196, 132, .72) 12%, rgba(252, 150, 128, .42) 34%, rgba(226, 116, 150, .16) 60%, rgba(220, 120, 160, 0) 100%),
    linear-gradient(180deg, rgba(240, 120, 140, 0) 0%, rgba(240, 120, 140, 0) calc(100% - 1029 * var(--s) - 140px), rgba(246, 128, 132, .22) calc(100% - 560 * var(--s)), rgba(252, 160, 120, .4) 100%); }
/* without the moving sky, the close brings its own dusk */
html:not(.sky-on) .close { background: linear-gradient(180deg, rgba(27, 24, 85, 0) 0%, #1b1855 22%, #2b2573 52%, #5a3a8a 82%, #8e4d8e 100%); }
/* The close's sentences lie on the page's paper, as every sentence on the sky does: the closing line above the form on a sheet
   as wide as the form, and the line under it on a scrap, balanced so its last word never sits alone. At dusk the paper
   takes a little of the evening, so it reads without glaring. */
.close .sheet { background: #ece7ee; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 1px 2px rgba(10, 8, 40, .2), 0 8px 22px -6px rgba(10, 8, 40, .45); }
.close__line { width: min(560px, 100%); margin: 2px 0 -8px; padding-block: 14px; font-family: var(--sell); font-weight: 600; font-size: clamp(21px, 1.9vw, 26px); line-height: 1.3; color: var(--pc-ink); text-wrap: balance; }
.close .join__fine { margin: 26px 0 0; padding: 9px 14px; color: var(--pc-body); text-wrap: balance; }
@media (max-width: 560px) {
  .close__line { width: auto; justify-self: stretch; }
  .close .join__fine { margin-inline: auto; font-size: 14px; }
}

