/* Fog over the parts of the garden not reached yet (12 Nov 2026, garden-fog.js). Soft painted clouds, not a smear:
   each cloud is a small picture painted in code, swaying by transform only. The part's look is a class on it:
   fog-half (the next part: the path and the stops show through), fog-full (further on: covered, a glow where the gate
   is) and fog-clear (the clouds roll back and drift apart, then the layer goes). Nothing here takes a click. */

.jg-fogged { --fog-top: #edf2f8; --fog-deep: #d2dcea; --fog-veil: rgba(234, 240, 247, 0.5); --fog-veil-deep: rgba(226, 233, 243, 0.86);
  --fog-top-dusk: #4f5a7b; --fog-deep-dusk: #353d58; --fog-veil-dusk: rgba(64, 74, 104, 0.5); --fog-veil-deep-dusk: rgba(52, 60, 88, 0.86); }

.jg-fog { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; contain: strict; transition: opacity 2.4s ease-in-out; }

/* the cover under the clouds of a fully fogged part, and the thin veil of a half fogged one; each with its evening
   look laid over it, faded in with the garden's own evening light */
.jg-fog-dense, .jg-fog-veil { position: absolute; inset: 0; opacity: 0; transition: opacity 1.8s ease-in-out; }
/* the cover thins out at its top edge, so it rises out of the half fog above it with no line */
.jg-fog-dense { -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), #000 12%); mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), #000 12%); }
.jg-fog-dense { background:
    radial-gradient(42% 30% at 28% 26%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%),
    radial-gradient(38% 26% at 74% 64%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, var(--fog-top), var(--fog-deep)); }
.jg-fog-veil { background: linear-gradient(180deg, rgba(234, 240, 247, 0) 0%, var(--fog-veil) 26%, var(--fog-veil-deep) 100%); }
.jg-fog-dense::after, .jg-fog-veil::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 2.4s ease-in-out; }
.jg-fog-dense::after { background:
    radial-gradient(40% 28% at 70% 30%, rgba(170, 182, 220, 0.25), rgba(170, 182, 220, 0) 70%),
    linear-gradient(180deg, var(--fog-top-dusk), var(--fog-deep-dusk)); }
.jg-fog-veil::after { background: linear-gradient(180deg, rgba(64, 74, 104, 0) 0%, var(--fog-veil-dusk) 26%, var(--fog-veil-deep-dusk) 100%); }
.jg-trail.dusk .jg-fog-dense::after, .jg-trail.dusk .jg-fog-veil::after { opacity: 1; }
.fog-full .jg-fog-dense { opacity: 0.94; }
.fog-half .jg-fog-veil { opacity: 1; }

/* a cloud: placed by its center; it rolls back by --dx/--dy when its part clears, a little after its neighbors */
.jg-cloud { position: absolute; aspect-ratio: 512 / 300; transform: translate(-50%, -50%); opacity: var(--a, 0.9);
  transition: transform 2s cubic-bezier(0.45, 0, 0.2, 1) var(--late, 0ms), opacity 1.5s ease-in calc(var(--late, 0ms) + 0.35s); }
.fog-half .jg-cloud.k-full, .fog-clear .jg-cloud, .jg-haze.open .jg-cloud {
  opacity: 0; transform: translate(calc(-50% + var(--dx, 0%)), calc(-50% + var(--dy, 0%))) scale(1.25); }
/* the clouds drift in three layers, each slowly side to side at its own pace */
.jg-drift { position: absolute; inset: 0; animation: jgFogDrift0 34s ease-in-out -6s infinite alternate; }
.jg-drift.d1 { animation-name: jgFogDrift1; animation-duration: 27s; animation-delay: -15s; }
.jg-drift.d2 { animation-name: jgFogDrift2; animation-duration: 41s; animation-delay: -24s; }
@keyframes jgFogDrift0 { from { transform: translateX(-1.4%); } to { transform: translateX(1.4%); } }
@keyframes jgFogDrift1 { from { transform: translateX(2%); } to { transform: translateX(-2%); } }
@keyframes jgFogDrift2 { from { transform: translateX(-2.6%); } to { transform: translateX(2.6%); } }
/* a cloud's picture; the evening picture fades in over the day one */
.jg-puff { position: absolute; inset: 0; }
.jg-puff::before, .jg-puff::after { content: ""; position: absolute; inset: 0; background: var(--sprite) center / 100% 100% no-repeat; }
.jg-puff::after { background-image: var(--sprite-dusk); opacity: 0; transition: opacity 2.4s ease-in-out; }
.jg-puff.jg-mirror::before, .jg-puff.jg-mirror::after { transform: scaleX(-1); }
.jg-trail.dusk .jg-puff::after { opacity: 1; }
.jg-trail.clock .jg-puff::after, .jg-trail.clock .jg-fog-dense::after, .jg-trail.clock .jg-fog-veil::after { transition-duration: 20s; }
.jg-puff.s0 { --sprite: var(--jg-cloud-0); --sprite-dusk: var(--jg-cloud-0-dusk); }
.jg-puff.s1 { --sprite: var(--jg-cloud-1); --sprite-dusk: var(--jg-cloud-1-dusk); }
.jg-puff.s2 { --sprite: var(--jg-cloud-2); --sprite-dusk: var(--jg-cloud-2-dusk); }

/* the gate, far off: a warm glow through the clouds where the round gate stands */
.jg-fog-glow { position: absolute; left: var(--gate-x, 50%); top: var(--gate-y, 86%); width: calc(var(--gate-w, 34%) * 1.15); aspect-ratio: 1;
  border-radius: 50%; translate: -50% -50%; opacity: 0; transition: opacity 1.6s ease-in-out;
  background: radial-gradient(circle, rgba(255, 242, 196, 0.95) 0%, rgba(255, 222, 140, 0.5) 28%, rgba(255, 210, 120, 0) 66%);
  animation: jgFogGlow 7s ease-in-out infinite alternate; }
.fog-full .jg-fog-glow { opacity: 0.8; }
.fog-half .jg-fog-glow { opacity: 0.5; }
@keyframes jgFogGlow { from { transform: scale(0.9); } to { transform: scale(1.08); } }

/* the next part's sign stays readable over its clouds. A stop under fog stays under it (13 Nov, Jeff: "when you hover
   over the clouds you see the tiles and the lessons.. its kinda pointless"): pointing at it or reaching it by the
   keyboard never lifts it, its tile shows only its back, and its name, coins, number, marks and pennant give way to a
   plain "? ? ?" plaque (garden-fog.js veil: no tooltip, "A lesson still in the fog" to a screen reader) */
.jg.fog-half > .jg-sign { z-index: 5; }
/* the Practice Hall (winter), Core strategy and Advanced studies (spring) are open to everyone from the start, but since
   18 Nov (Jeff: "hide the buildings in fog") they stay hidden in the clouds of a part not reached yet, out of reach of
   a tap or the keyboard too; the rings by the entrance are the way in from day one (garden.js portal) */
.jg:is(.fog-half, .fog-full) > :is(.jg-practice, .jg-strat, .jg-adv) { visibility: hidden; }
.jg .jg-stop.fogged, .jg .jg-stop.fogged:is(:hover, :focus-within) { z-index: auto; }
.jg .jg-stop.fogged .lm-face, .jg .jg-stop.fogged .jg-n, .jg .jg-stop.fogged .jg-flag, .jg .jg-stop.fogged .jg-plus,
.jg .jg-stop.fogged .jg-label > *, .jg .jg-stop.fogged .jg-quizpic, .jg .jg-stop.fogged .jg-gradpic { visibility: hidden; }
.jg .jg-stop.fogged .lm-flip .lm-in, .jg .jg-stop.fogged .lm-flip.up .lm-in { transform: none; }
.jg .jg-stop.fogged .lm-back { visibility: visible; opacity: 0.55; filter: grayscale(0.6); }
.jg .jg-stop.fogged .jg-label { position: relative; }
.jg .jg-stop.fogged .jg-label::after { content: "? ? ?"; position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 0.85rem/1 var(--g-font-body, inherit); letter-spacing: 0.12em; color: #5b6478; }
.jg .jg-stop.fogged .lm-link:is(:hover, :focus-visible) { transform: none; }

/* past the gate: a glimpse of light through the round opening and a haze below the wall, until graduation */
.jg-haze { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.jg-haze-glow { position: absolute; left: var(--gate-x, 50%); top: var(--gate-y, 86%); width: calc(var(--gate-w, 34%) * 0.5); aspect-ratio: 1;
  border-radius: 50%; translate: -50% -50%; transition: opacity 2.4s ease-in-out;
  background: radial-gradient(circle, #fffbe6 0%, rgba(255, 238, 178, 0.92) 34%, rgba(255, 222, 150, 0) 72%);
  animation: jgFogGlow 6s ease-in-out infinite alternate; }
.jg-haze-band { position: absolute; left: 0; right: 0; top: var(--wall-y, 90%); bottom: 0; transition: opacity 2s ease-in-out;
  background: linear-gradient(180deg, rgba(240, 244, 250, 0), rgba(240, 244, 250, 0.82) 40%, rgba(236, 241, 248, 0.95)); }
.jg-trail.dusk .jg-haze-band { background: linear-gradient(180deg, rgba(64, 74, 104, 0), rgba(64, 74, 104, 0.8) 40%, rgba(52, 60, 88, 0.92)); }
.jg-haze.open .jg-haze-band { opacity: 0; }
.jg-haze.open .jg-haze-glow { opacity: 0; }

/* the covered signposts where the side paths leave: a cloth tied over each board, "? ? ?" on it */
.jg-fork-cover { position: absolute; z-index: 3; width: 8.4%; aspect-ratio: 75 / 40; transform: translate(-50%, -50%); padding: 0; margin: 0;
  border: 0; background: none; cursor: pointer; transition: transform 0.2s ease; }
.jg.tall .jg-fork-cover { width: 20%; }
.jg-fork-cloth { position: relative; display: grid; place-items: center; width: 100%; height: 100%;
  border-radius: 4px 4px 12px 12px / 4px 4px 16px 16px; color: #f6e7c8; letter-spacing: 0.12em; white-space: nowrap;
  font: 700 clamp(10px, 1.15vw, 16px)/1 var(--g-font-display, inherit);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 2px, rgba(0, 0, 0, 0) 2px 5px),
    linear-gradient(180deg, #8a3f2c, #5e2a1e);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45), inset 0 -5px 0 rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.12); }
.jg-fork-cloth::before { content: ""; position: absolute; left: 8%; right: 8%; top: 18%; height: 3px; border-radius: 2px; background: #c9a25a;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.35); }
.jg-fork-cover:hover, .jg-fork-cover:focus-visible { transform: translate(-50%, -50%) scale(1.06); }
.jg-fork-cover:focus-visible { outline: 3px solid #ffd76a; outline-offset: 3px; border-radius: 6px; }
.jg-fork-say { position: absolute; z-index: 6; margin: 0; padding: 5px 12px; border-radius: 10px; white-space: nowrap; pointer-events: none;
  transform: translate(-50%, calc(-100% - 26px)); background: #f3e6c4; color: #2a1d0c; font: 700 0.95rem/1.2 var(--g-font-body, inherit);
  box-shadow: 0 3px 0 rgba(60, 40, 12, 0.35), 0 6px 10px rgba(0, 0, 0, 0.35); opacity: 0; transition: opacity 0.25s ease; }
.jg-fork-say.on { opacity: 1; }

/* a look set at once (the page opening, a resize): no rolling, no fading */
.jg-fog.settle, .jg-fog.settle *, .jg-haze.settle, .jg-haze.settle * { transition: none !important; }
/* off screen (garden.js pauses the part) or the tab hidden: every cloud holds still */
.jg-fog-idle .jg-drift, .jg-fog-idle .jg-fog-glow, .jg-fog-idle .jg-haze-glow { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .jg-drift, .jg-fog-glow, .jg-haze-glow { animation: none; }
  .jg-fog, .jg-fog *, .jg-haze, .jg-haze *, .jg-fork-cover, .jg-fork-say { transition: none; }
}

/* an open side path's signpost (16 Nov, Our table): the cloth is off, the board's name shows, a link to its lessons */
.jg-fork-open { display: block; text-decoration: none; }
.jg-fork-board { letter-spacing: 0.02em; color: #2a1d0c; font-size: clamp(9px, 1.05vw, 15px);
  background: linear-gradient(180deg, #f3e6c4, #e2cf9e); border: 2px solid #8a7a58; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4); }
.jg-fork-board::before { display: none; }
