/* hx-wall: the draggable game wall, as a fixed layer BEHIND the real homepage.
   z-index -1 puts it above the black canvas but below .veil and everything else. */
.hx-wall {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  contain: layout paint size; background: #000;
  animation: hx-in 1.6s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes hx-in { from { opacity: 0; } to { opacity: 1; } }
.hx-fx {
  position: absolute; inset: 0; transform-origin: 0 0; will-change: transform, opacity;
}
.hx-persp { position: absolute; inset: 0; perspective: 1500px; perspective-origin: 50% 46%; }
.hx-persp.flat { perspective: none; }
.hx-plane {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0;
  transform-style: preserve-3d; will-change: transform;
}
.hx-persp.flat .hx-plane { transform-style: flat; }
/* `translate` is separate from the `transform` hx-wall.js writes every wrap, so
   only the hover lift animates, never a tile jumping to the other side. */
.hx-tile { position: absolute; left: 0; top: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; translate: 0 0 0; transition: translate .35s cubic-bezier(.22,1,.36,1); }
/* --dim (0..1, set per tile by hx-wall.js) darkens the tile by fading the image
   itself into black. It used to be a separate black layer stacked on the image,
   but two rounded edges on top of each other never antialias identically, so a
   thin lit outline of the image leaked around the dark layer. The background
   stays opaque (fading to black) so the floor grid never shows through a tile. */
.hx-tile .in { position: absolute; inset: 0; border-radius: 14px; background: rgb(calc(16 * (1 - var(--dim, 0))) calc(16 * (1 - var(--dim, 0))) calc(20 * (1 - var(--dim, 0)))); overflow: hidden; }
/* same trick as --hx-a below: the image fade runs through a registered number so
   it never gets a temporary layer of its own that blinks when handed back */
@property --hx-o { syntax: '<number>'; inherits: false; initial-value: 0; }
.hx-tile img { width: 100%; height: 100%; object-fit: cover; display: block; --hx-o: 0; opacity: var(--hx-o); transition: --hx-o .7s cubic-bezier(.22, 1, .36, 1); }
.hx-tile img.ok { --hx-o: calc(.9 * (1 - var(--dim, 0))); }
/* static darkening behind the wordmark and cube so they stay the hero */
.hx-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 64% 54% at 50% 52%, rgba(0,0,0,.8), rgba(0,0,0,.3) 74%, transparent 100%),
    linear-gradient(180deg, rgba(0,0,0,.5), transparent 24%, transparent 74%, rgba(0,0,0,.7) 100%);
}
html.hx-grab body { cursor: grab; }
html.hx-grab body a, html.hx-grab body button { cursor: pointer; }
html.hx-drag, html.hx-drag body { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
@media (prefers-reduced-motion: reduce) { .hx-wall { animation: none; } }

/* hovered tile in the hero (spot mode): lifts, brightens, names the game.
   The lift has to move the TILE toward the viewer: tiles sit at depths 0/22/44px
   in the 3D plane, and a translateZ on .in is flattened into its own tile, so a
   neighbour sitting nearer still drew over the hovered one. 90px clears them all. */
/* will-change pins the hot tile to one GPU layer for the whole hover. Without it
   Chrome re-rasterised the lifted tile when the .35s lift ended, and the caption
   and gradient blinked off for a frame. */
.hx-tile.hx-hot { translate: 0 0 90px; will-change: translate, transform; }
/* --hx-a (0..1) fades the caption and its gradient in. It is a registered
   number transitioned on .in, so the fade repaints inside the tile's own layer.
   Fading them with opacity gave each its own layer for .3s, and folding those
   back into the tile when the fade ended blinked the whole caption strip. */
@property --hx-a { syntax: '<number>'; inherits: true; initial-value: 0; }
.hx-tile .in { --hx-a: 0; transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s, --hx-a .3s; }
.hx-tile.hx-hot .in { --hx-a: 1; }
.hx-tile.hx-hot .in { box-shadow: 0 24px 60px -18px rgba(0,0,0,.95), 0 0 0 1px rgba(255,255,255,.35); }
.hx-tile.hx-hot { --dim: 0 !important; }
.hx-tile.hx-hot img.ok { --hx-o: 1; }
.hx-name {
  position: absolute; left: 12px; right: 12px; display: flex; flex-direction: column; gap: 3px;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  z-index: 2; color: rgb(255 255 255 / var(--hx-a)); text-shadow: 0 1px 8px rgb(0 0 0 / calc(.9 * var(--hx-a)));
  bottom: calc(4px + 6px * var(--hx-a)); pointer-events: none;
}
.hx-name b { font-family: 'Archivo', system-ui, sans-serif; font-variation-settings: 'wdth' 115; font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.hx-name span { color: rgb(61 220 132 / var(--hx-a)); }
.hx-tile .in::after { content: ''; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgb(0 0 0 / calc(.75 * var(--hx-a)))); pointer-events: none; }
html.hx-point body { cursor: pointer; }
