/* Hovering or focusing a half of the logotype opens the game host's dream cloud above it, alive: mark-dream.js draws it and keeps it
   billowing. Words in Kuronuri (OFL, lihbr: assets/fonts/kuronuri-OFL.txt). Sizes count the game's pixels (--p) and divide out the
   mark's 3x zoom on wide screens. */
@font-face { font-family: 'Kuronuri'; src: url('./assets/fonts/kuronuri.woff2') format('woff2'); font-display: swap; }
.wordmark a { position: relative; --p: calc(2px / var(--z, var(--ts, 1))); }
/* the dots reach down into the room above the lowercase letters, the cloud clears the capitals */
.dream { position: absolute; left: calc(50% - 10 * var(--p)); bottom: calc(100% - .28em); width: calc(var(--cw, 64) * var(--p)); height: calc(37 * var(--p));
  pointer-events: none; z-index: 5; color: rgb(88, 88, 88); --paper: rgb(248, 248, 248); --breath: 3.6s; }
.wordmark a ~ a .dream { --breath: 4.3s; }
/* under the mark only while the hill game runs, or when the window is too short above it (under 1080 wide the mark sits 28px from the top) */
.page:has(.on-hill) .dream { bottom: auto; top: calc(100% + 2 * var(--p)); transform: scaleY(-1); }
@media (max-width: 1079px) { .dream { bottom: auto; top: calc(100% + 2 * var(--p)); transform: scaleY(-1); } }
.page:has(.on-hill) .dream b > span { transform: scaleY(-1); top: calc(-1 * var(--p)); }
@media (max-width: 1079px) { .dream b > span { transform: scaleY(-1); top: calc(-1 * var(--p)); } }

/* the dots, smallest by the word: left, top, size in game pixels; --n = order in, --o = order out */
.dream i { position: absolute; box-sizing: border-box; border: var(--p) solid currentColor; border-radius: 50%; background: var(--paper);
  left: calc(var(--x) * var(--p)); top: calc(var(--y) * var(--p)); width: calc(var(--d) * var(--p)); height: calc(var(--d) * var(--p));
  opacity: 0; transform: scale(0); transition: opacity 120ms ease-out, transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1); transition-delay: calc(var(--o) * 60ms); }
.dream i:nth-child(1) { --x: 6; --y: 34; --d: 3; --n: 0; --o: 4; }
.dream i:nth-child(2) { --x: 9; --y: 30; --d: 5; --n: 1; --o: 3; }
.dream i:nth-child(3) { --x: 13; --y: 25; --d: 7; --n: 2; --o: 2; }
/* the cloud condenses in and evaporates out in the script; here it only shows and hides */
.dream b { position: absolute; left: 0; top: 0; width: 100%; height: calc(24 * var(--p)); display: flex; align-items: center; justify-content: center;
  font: 400 calc(6.5 * var(--p))/1 'Kuronuri', Georgia, serif; white-space: nowrap; opacity: 0; transition: opacity 200ms ease-out 120ms; }
.dream canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.dream b > span { position: relative; top: var(--p); } /* Kuronuri sits high in its line */
.dream b > span > span { display: inline-block; white-space: pre; opacity: 0; transform: translateY(var(--p)) scale(.8);
  transition: opacity 90ms ease-out, transform 90ms ease-out; transform-origin: 50% calc(-5 * var(--p)); } /* hung from a string, mark-dream.js swings them */
/* in: dots one by one, the cloud gathers, then the words appear letter by letter; out: the words go first, then the cloud, then the dots */
.wordmark a:is(:hover, :focus-visible) .dream i { opacity: 1; transform: none; transition-delay: calc(var(--n) * 70ms); }
.wordmark a:is(:hover, :focus-visible) .dream b { opacity: 1; transition: opacity 120ms ease-out 150ms; }
.wordmark a:is(:hover, :focus-visible) .dream b > span > span { opacity: 1; transform: none;
  transition: opacity 160ms ease-out, transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1); transition-delay: calc(380ms + var(--i) * 30ms); }
/* while open, the dots bob, each half at its own pace */
.wordmark a:is(:hover, :focus-visible) .dream i { animation: dream-bob calc(var(--breath) * .8) ease-in-out calc(300ms + var(--n) * 260ms) infinite; }
@keyframes dream-bob { 50% { translate: 0 calc(-.7 * var(--p)); } }
@media (prefers-color-scheme: dark) { .dream { color: rgb(180, 180, 180); --paper: rgb(20, 20, 20); } }
@media (prefers-reduced-motion: reduce) { .dream :is(i, b, b > span > span) { transition: opacity 120ms ease-out !important; transform: none !important; rotate: none !important; animation: none !important; } }
