/* Splash page (/): full screen, always dark (day and night), no sidebar. See public/js/front.js. */
html:has(.body-front), html .body-front, html.dark .body-front { background: #04070d; }
.body-front { margin: 0; min-height: 100vh; overflow: hidden; color: #f2f2f2; }
.front { position: fixed; inset: 0; overflow: hidden; touch-action: none; }

.front-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.front-canvas { display: block; will-change: transform; }

/* The J floats above the tilting circles: still, white, soft drop shadow. It opens /about. */
.front-logo {
  position: absolute; left: 50%; top: 50%; z-index: 2; display: block; line-height: 0;
  color: #f2f2f2; border-radius: 50%;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .55)) drop-shadow(0 3px 4px rgba(0, 0, 0, .45));
}
.front-logo svg { width: 100%; height: 100%; fill: currentColor; overflow: visible; }
.front-logo:hover, .front-logo:focus { color: #f2f2f2; text-decoration: none; } /* not the site's green link hover */
html.front-intro .front-logo, html.front-intro .front-enter { pointer-events: none; } /* during the zoom it fills the screen */
.front-logo:focus-visible { outline: 2px solid #8fd0ff; outline-offset: 6px; }

/* "Enter →": a quiet link at the bottom centre, shown once the diagram has settled. */
.front-enter {
  position: absolute; left: 50%; bottom: 40px; z-index: 3; transform: translateX(-50%);
  font-family: Inter, sans-serif; font-weight: 500; font-size: 14px; line-height: 20px;
  letter-spacing: .15em !important; /* exception to the site-wide letter-spacing reset, like the labels */
  text-transform: uppercase; color: #f2f2f2; text-decoration: none; padding: 8px 12px;
  opacity: 0; transition: opacity .6s ease;
}
.front-enter { border-radius: 999px; padding: 10px 20px; transition: opacity .6s ease, background-color .2s ease, color .2s ease; }
/* Hover: fills into a round white button with dark text (never the site's green link hover). */
.front-enter:hover, .front-enter:focus-visible { background-color: #f2f2f2; color: #04070d; text-decoration: none; }
.front-enter:focus-visible { outline: 2px solid #8fd0ff; outline-offset: 4px; }
.front.front-ready .front-enter { opacity: 1; }
@media (max-width: 767px) { .front-enter { bottom: 32px; } }

/* White dot cursor (mouse and pen only; touch has no cursor). */
.front-dot {
  position: fixed; left: 0; top: 0; width: 42px; height: 42px; margin: -21px 0 0 -21px; z-index: 10;
  border-radius: 50%; background: #fff; pointer-events: none; opacity: 0; transition: opacity .15s ease;
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  .body-front { cursor: none; }
  .body-front a { cursor: pointer; } /* the normal hand over the J and Enter (the dot hides there, front.js) */
}
@media not ((hover: hover) and (pointer: fine)) { .front-dot { display: none; } }

/* First-visit intro: a dark cover until front.js starts the zoom (its first frame is all dark);
   failsafe: lifts after 10s if scripts fail. */
.front-intro-layer { display: none; }
html.front-intro .front-intro-layer {
  display: block; position: fixed; inset: 0; z-index: 5; background: #04070d;
  animation: front-failsafe 0s linear 10s forwards;
}
.front-zooming .front-logo { filter: none; } /* the drop shadow is invisible that close, and costly */
@keyframes front-failsafe { to { visibility: hidden; } }

/* Leaving the splash: it slides up out of view and the site page follows from below (and back down
   on return). See the view transition rules in extra.css. */
html:has(.body-front) { view-transition-name: front; }

/* Centre J: holographic foil by default (the sidebar logo's foil, masked to the J; Symbol-tight.svg has
   this SVG's exact viewBox), plain white on hover. White during the intro zoom; the foil fades in as it
   settles. front.js moves the rays: with the mouse anywhere on the page, or drifting slowly on touch screens. */
.front-holo {
  display: block; position: absolute; inset: 0; pointer-events: none; opacity: 1; transition: opacity .25s ease;
  -webkit-mask: url(/assets/img/Symbol-tight.svg) center / 100% 100% no-repeat;
  mask: url(/assets/img/Symbol-tight.svg) center / 100% 100% no-repeat;
  background:
    url(/assets/img/holo-scratches.svg) 0 0 / 90px 90px,
    radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 22%),
    repeating-conic-gradient(from var(--ha, 0deg) at var(--hx, 50%) var(--hy, 50%),
      #a9a396 0deg, #7f796c 14deg, #ff5a5f 30deg, #ffb347 44deg, #fff27a 56deg, #6ef0a0 70deg,
      #4fc3ff 86deg, #8a6bff 102deg, #ff6bd6 116deg, #c4bfb3 134deg, #8d8779 158deg, #a9a396 180deg);
}
.front-logo svg { opacity: 0; transition: opacity .25s ease; }
html.front-intro .front-holo { opacity: 0; }
html.front-intro .front-logo svg { opacity: 1; }
.front.front-ready .front-holo { transition: opacity .6s ease; }
@media (hover: hover) {
  .front-logo:hover .front-holo, .front-logo:focus-visible .front-holo { opacity: 0; transition-duration: .25s; }
  .front-logo:hover svg, .front-logo:focus-visible svg { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .front-holo, .front-logo svg { transition: none; } }
