@font-face {
  font-family: "Cygnito Mono";
  src: url("assets/cygnito-mono.woff2") format("woff2");
  font-display: swap;
}

/* grid-v2b's stage, plus the glass ball. */
:root {
  --bg: #e3e3e3;
  --ball: 200px;       /* set from ball.js */
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.stage {
  position: fixed;
  inset: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.stage.is-dragging { cursor: grabbing; }

.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 500ms ease;
}
.stage.is-ready canvas { opacity: 1; }

/* ---- The ball ------------------------------------------------------------- */

.ball {
  position: fixed;
  /* Figma: centre 0.663 R in from the left edge and 0.72 R up from the bottom,
     so it hangs ~0.34 R off the left and ~0.28 R off the bottom. */
  left: calc(var(--ball) * -0.168);
  bottom: calc(var(--ball) * -0.14);
  width: var(--ball);
  height: var(--ball);
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  z-index: 10;
}
.ball.is-dragging { cursor: grabbing; }

.ball:focus-visible { outline: 2px solid rgb(0 0 0 / 0.4); outline-offset: 4px; }

/* Glass: frosted fallback first; Chromium also understands the SVG lens and
   replaces it with real refraction (other browsers drop that declaration). */
.ball-glass {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backdrop-filter: blur(1.5px) saturate(1.15);
  -webkit-backdrop-filter: blur(1.5px) saturate(1.15);
}
.ball-glass.has-lens { backdrop-filter: url(#lens); }

.ball-canvas {
  /* The Figma ball is turned 5.63° (its shading and the logo with it). */
  transform: rotate(5.63deg);
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

/* Direction hints: four small chevrons that appear on hover. */
.ball-hint {
  position: absolute;
  width: 8px;
  height: 8px;
  border-top: 1.5px solid rgb(0 0 0 / 0.5);
  border-left: 1.5px solid rgb(0 0 0 / 0.5);
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}
.ball:hover .ball-hint, .ball:focus-visible .ball-hint { opacity: 1; }
.ball.is-dragging .ball-hint { opacity: 0; }
.ball-hint--up    { top: -14px;  left: 50%; transform: translateX(-50%) rotate(45deg); }
.ball-hint--down  { bottom: -14px; left: 50%; transform: translateX(-50%) rotate(225deg); }
.ball-hint--left  { left: -14px; top: 50%; transform: translateY(-50%) rotate(-45deg); }
.ball-hint--right { right: -14px; top: 50%; transform: translateY(-50%) rotate(135deg); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}



/* Sub-page tags curved round the ball (tags.js). */
.ball-tags {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 11;
  overflow: visible;
  text-transform: uppercase;
}
