/* Gates to Games: site-wide touches (scroll progress, edge blur, liquid edges, loader, reveal). Loaded on every page via the top strip. */

/* liquid edges (fx.js): a film on both sides that sloshes with the scroll, a meniscus at the top and bottom */
.gtg-liquid { position: fixed; z-index: 950; pointer-events: none; }
.gtg-liquid.l, .gtg-liquid.t { left: 0; top: 0; }
.gtg-liquid.r { right: 0; top: 0; }
.gtg-liquid.b { left: 0; bottom: 0; }
.gtg-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 1000; pointer-events: none; }
.gtg-progress i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #f0b44c, #e07a3a 60%, #c9553d); box-shadow: 0 0 8px rgba(240, 150, 70, .55); border-radius: 0 2px 2px 0; }

/* progressive blur along the top edge of the window: five layers, each blurring a little more, each masked to a narrower band */
.gtg-edge { position: fixed; inset: 0 0 auto 0; height: 64px; z-index: 900; pointer-events: none; opacity: 0; transition: opacity .3s; }
.gtg-edge.on { opacity: 1; }
.gtg-edge > i { position: absolute; inset: 0; }
.gtg-edge > i:nth-child(1) { backdrop-filter: blur(.5px); -webkit-backdrop-filter: blur(.5px); mask: linear-gradient(to top, transparent 0%, #000 25%, #000 50%, transparent 75%); -webkit-mask: linear-gradient(to top, transparent 0%, #000 25%, #000 50%, transparent 75%); }
.gtg-edge > i:nth-child(2) { backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); mask: linear-gradient(to top, transparent 25%, #000 50%, #000 75%, transparent 100%); -webkit-mask: linear-gradient(to top, transparent 25%, #000 50%, #000 75%, transparent 100%); }
.gtg-edge > i:nth-child(3) { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); mask: linear-gradient(to top, transparent 50%, #000 75%, #000 100%); -webkit-mask: linear-gradient(to top, transparent 50%, #000 75%, #000 100%); }
.gtg-edge > i:nth-child(4) { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); mask: linear-gradient(to top, transparent 75%, #000 100%); -webkit-mask: linear-gradient(to top, transparent 75%, #000 100%); }
.gtg-edge > i:nth-child(5) { background: linear-gradient(to bottom, var(--bg, #f4f1ea) 0%, transparent 100%); opacity: .55; }

/* the chip loader: pins light in turn around a die */
.gtg-loader { --c: #f0b44c; --dim: rgba(140, 150, 160, .28); width: 56px; height: 56px; display: block; }
.gtg-loader rect.die { fill: none; stroke: var(--dim); stroke-width: 2; }
.gtg-loader rect.core { fill: var(--c); animation: gtg-core 1.2s ease-in-out infinite; transform-origin: 28px 28px; }
.gtg-loader .pin { stroke: var(--dim); stroke-width: 2.4; stroke-linecap: round; animation: gtg-pin 1.2s linear infinite; }
@keyframes gtg-pin { 0%, 100% { stroke: var(--dim); } 8% { stroke: var(--c); } 30% { stroke: var(--dim); } }
@keyframes gtg-core { 0%, 100% { opacity: .55; transform: scale(.82); } 50% { opacity: 1; transform: scale(1); } }

.gtg-boot { position: fixed; inset: 0; z-index: 2000; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: var(--bg, #f4f1ea); transition: opacity .45s ease, visibility .45s; }
.gtg-boot span { font: 600 12px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3, #7a838b); }
.gtg-boot.done { opacity: 0; visibility: hidden; }
html.gtg-seen .gtg-boot { display: none; }

/* reveal on scroll (only once the script has marked the page, so nothing hides without it) */
html.gtg-fx [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
html.gtg-fx [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .gtg-boot { display: none; }
  html.gtg-fx [data-reveal] { opacity: 1; transform: none; transition: none; }
  .gtg-loader .pin, .gtg-loader rect.core { animation: none; }
}
