/* ============================================================================
   quietly raising · HOME, THE GLOBE v3 (2026-11-21)  — pairs with home/globe.js and home/boot.js
   Everything here is dormant unless <html class="globe"> (boot.js adds it when WebGL 2 works and the device is not low-power).
   Without it, Home is exactly the one-screen painted hills (home.css): that is the fallback layer.
   Stack inside .map, back to front:
     .sky (painted sky plate + two drifting cloud layers) · .globe-cv (the Earth, painted live by globe.js) · .map__col (title, zoom buttons, card, footer)
     · .orbit (the three places and the child's flowers, riding on the globe).
   The old v1 (scripted dive) is backed up in .tmp/globe-v1-backup/.
   ========================================================================== */

.sky, .globe-cv, .orbit, .gui, .leave, .gsay { display: none; }

/* ── the sky: a painted blue sky plate, and two cloud layers that drift at different speeds (and shift a little as the world turns) ── */
html.globe, html.globe body, html.globe body.home { background: #070a1c; }
html.globe .map { background: #070a1c; touch-action: none; -webkit-user-select: none; user-select: none; outline: none; }
html.globe .map:focus-visible { outline: 3px solid var(--butter); outline-offset: -7px; }
html.globe .sky { display: block; position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; container-type: size; --sx: 0px; --sy: 0px; }
.sk { position: absolute; inset: -6%; will-change: transform; }
/* 2026-11-21 (Fei): dark Milky Way behind the light blue and green Earth, not blue sky. The cloud-sky layers stay in the file but are hidden. */
.sk-far { background: url("art/space-wide.jpg") center / cover no-repeat; transform: translate3d(calc(var(--sx) * .35), calc(var(--sy) * .35), 0); }
@media (max-aspect-ratio: 1/1) { .sk-far { background-image: url("art/space-tall.jpg"); } }
.sk-mid, .sk-near { display: none; }
.sk-mid, .sk-near { inset: 0 -7%; overflow: hidden; mix-blend-mode: screen; }
.sk-mid { top: -3%; height: 106%; opacity: .5; transform: translate3d(calc(var(--sx) * .8), calc(var(--sy) * .8), 0); }
.sk-near { top: 4%; height: 100%; opacity: .34; transform: translate3d(calc(var(--sx) * 1.5), calc(var(--sy) * 1.5), 0); }
.sk i { position: absolute; left: 0; top: 0; height: 100%; width: calc(var(--iw) * 3); background-repeat: repeat-x; background-size: var(--iw) 100%; --iw: 150cqh; }
.sk-mid i { background-image: url("art/sky-mid.jpg"); --iw: 165cqh; }
.sk-near i { background-image: url("art/sky-near.jpg"); --iw: 130cqh; }
html:not(.globe-still) .sk-mid i { animation: skdrift 150s linear infinite; }
html:not(.globe-still) .sk-near i { animation: skdrift 90s linear infinite; }
@keyframes skdrift { from { transform: translate3d(calc(var(--iw) * -1), 0, 0); } to { transform: translate3d(0, 0, 0); } }

.globe-cv { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .8s ease; }
html.globe .globe-cv { display: block; }
html.globe.globe-ready .globe-cv { opacity: 1; }
html.globe.globe-still .globe-cv { transition: none; }

/* the hills are only the fallback: out of the way in globe mode (they stay in the page so the one-screen Home works if WebGL fails) */
html.globe .map__bg, html.globe .live { display: none; }
html.globe .zone { visibility: hidden; pointer-events: none; }
html.globe .map__col { position: relative; z-index: 3; pointer-events: none; }
html.globe .go, html.globe .base, html.globe .gui, html.globe .map__title { pointer-events: auto; }
html.globe .map__title { pointer-events: none; }

/* the title: cream on the deep blue sky */
html.globe .map__title { color: #FFFDF6; text-shadow: 0 2px 14px rgba(14, 50, 110, .65), 0 1px 0 rgba(14, 50, 110, .35); transition: opacity .5s ease; }
html.globe .map.is-close .map__title { opacity: 0; }

/* ── places: painted markers that stand on the ground ─────────────────────── */
html.globe .orbit { display: block; position: absolute; inset: 0; z-index: 2; pointer-events: none; }   /* under the title, buttons, card and footer, over the globe */
.blooms { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.blooms li { position: absolute; left: 0; top: 0; width: 0; height: 0; visibility: hidden; }
.place { position: absolute; left: 0; top: 0; width: 72px; height: 72px; display: block; visibility: hidden; opacity: 0; pointer-events: auto; text-decoration: none; border-radius: 50%;
  -webkit-tap-highlight-color: transparent; will-change: transform; }
.place::before { content: ""; position: absolute; inset: -16%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 248, 215, .55), rgba(255, 248, 215, .16) 66%, rgba(255, 248, 215, 0)); pointer-events: none; }
.place__sq { position: absolute; inset: 0; display: block; pointer-events: none; }
.place__pic { position: absolute; left: 50%; top: 50%; width: 118%; height: auto; max-width: none; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 5px 7px rgba(12, 40, 90, .5)); transition: transform .4s var(--ease-out); }
.place:hover .place__pic, .place:focus-visible .place__pic { transform: translate(-50%, -52%) scale(1.06); }
.place .tag { z-index: 2; position: absolute; left: 50%; top: 100%; margin-top: -2px; transform: translateX(-50%) rotate(-2deg); font-size: 21px; padding: 4px 14px 6px; }
.place .tag { transition: opacity .35s ease; }
.map.tags-off .place .tag { opacity: 0; }
.place--play .tag { transform: translateX(-50%) rotate(2deg); }
.place:focus-visible { outline: 3px solid var(--butter); outline-offset: 5px; }
html:not(.globe-still) .place__pic { animation: pinbob 5.2s ease-in-out infinite alternate; }
html:not(.globe-still) .place--play .place__pic { animation-duration: 6.1s; animation-delay: -2s; }
html:not(.globe-still) .place--apps .place__pic { animation-duration: 5.7s; animation-delay: -3s; }
@keyframes pinbob { from { margin-top: -3px; } to { margin-top: 3px; } }
/* parked right above one: a soft glow and a ring that breathes out. It never opens by itself: a tap or click does. */
.place.is-near::before { inset: -30%; background: radial-gradient(closest-side, rgba(255, 248, 215, .85), rgba(255, 248, 215, .32) 62%, rgba(255, 248, 215, 0)); }
.place.is-near::after { content: ""; position: absolute; inset: -4%; border-radius: 50%; pointer-events: none; border: 5px solid rgba(255, 246, 208, .8); }
html:not(.globe-still) .place.is-near::before { animation: pglow 2.4s ease-in-out infinite; }
html:not(.globe-still) .place.is-near::after { animation: pring 2.4s ease-out infinite; }
@keyframes pglow { 0%, 100% { transform: scale(.94); opacity: .8; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes pring { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }

/* the child's flowers: tiny painted flowers on Victoria, a bigger one every time you come closer */
.gb { position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; will-change: transform; }
.gb img { position: absolute; left: 0; bottom: 0; height: var(--fs, 10px); width: auto; max-width: none; transform: translateX(-50%); pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(255, 246, 205, .95)) drop-shadow(0 2px 2px rgba(10, 40, 20, .45)); }
.gb::before { content: ""; position: absolute; left: -22px; top: calc(var(--fs, 10px) * -1 - 10px); width: 44px; height: calc(var(--fs, 10px) + 20px); max-height: none; min-height: 44px; }
.gb:focus-visible { outline: 3px solid var(--butter); outline-offset: 2px; border-radius: 8px; }

html.globe .gsay { display: block; position: absolute; z-index: 6; margin: 0; width: max-content; max-width: min(300px, 86%); box-sizing: border-box; padding: 6px 13px 8px; text-align: center; text-wrap: balance;
  font: 400 clamp(15px, 4.4vw, 21px)/1.15 var(--display); letter-spacing: .015em; color: #FFFDF6; background: rgba(16, 52, 100, .86);
  border-radius: 15px 18px 14px 17px / 17px 14px 18px 15px; box-shadow: 0 8px 18px -10px rgba(5, 20, 60, .7); pointer-events: none; }
html.globe .gsay[hidden] { display: none; }
html:not(.globe-still) .gsay.is-on { animation: sayin .35s var(--ease-out) both; }

/* ── zoom buttons and the one hint ────────────────────────────────────────── */
html.globe .gui { display: flex; flex: none; flex-direction: column; align-items: center; gap: 2px; padding: 0 12px 4px; position: relative; z-index: 7; }
.gui__row { display: flex; gap: 14px; }
.zbtn { pointer-events: auto; display: inline-grid; place-items: center; width: 52px; height: 52px; padding: 0 0 3px; font: 400 36px/1 var(--display); color: #1F3320; background: #F6F0E1; border: 0; border-radius: 50%;
  box-shadow: 0 12px 24px -12px rgba(8, 30, 80, .8), inset 0 0 0 2px rgba(31, 51, 32, .16); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .25s var(--ease-out), background .25s; }
.zbtn:hover { transform: translateY(-2px); background: #FFFDF6; }
.zbtn:active { transform: translateY(0) scale(.97); }
.zbtn:focus-visible { outline: 3px solid var(--butter); outline-offset: 3px; }
.ghint { margin: 0 0 2px; text-align: center; font: 400 21px/1.1 var(--display); letter-spacing: .02em; color: #FFFDF6; text-shadow: 0 1px 8px rgba(4, 8, 30, .9), 0 0 3px rgba(4, 8, 30, .8); transition: opacity 1s ease; }
html.globe-used .ghint { opacity: 0; }

/* the card, the footer: get out of the way when you are close to the ground */
html.globe .go { transition: opacity .4s ease, transform .3s var(--ease-out), background .3s, visibility 0s linear 0s; }
html.globe .map.is-close .go { opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility 0s linear .4s; }

/* the plain colour the screen fades to on the way into a room */
html.globe .leave { display: block; position: fixed; inset: 0; z-index: 100; background: #2F4A2A; opacity: 0; pointer-events: none; transition: opacity .4s ease; }
html.globe .leave.is-on { opacity: 1; pointer-events: auto; }
html.globe.globe-still .leave { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .sk i, .place__pic, .place::before, .place::after { animation: none !important; }
  .globe-cv { transition: none; }
}

/* ── phones (narrow) keep the zoom buttons in the flow between the globe and the card ── */
/* ── computers: the title sits on the left, the buttons bottom left, the card bottom right ── */
@media (min-width: 900px) {
  html.globe .map__title { text-align: left; padding-left: 38px; font-size: clamp(46px, 4.6vw, 70px); }
  html.globe .gui { position: absolute; left: 30px; bottom: 74px; align-items: flex-start; padding: 0; }
  html.globe .ghint { text-align: left; }
}
@media (min-width: 900px) and (max-width: 1099px) { html.globe .gui { bottom: 92px; } }
@media (max-height: 520px) { .zbtn { width: 46px; height: 46px; font-size: 32px; } .ghint { font-size: 17px; } }
@media (max-width: 899px) { html.globe .place .tag { font-size: 18px; padding: 3px 11px 5px; } }
