/* Glass fracture layer.
   Sits exactly over the dashboard panel. Only opacity and transform are
   animated, so the browser composites on the GPU. */

.fracture {
  --crack: 0;
  position: absolute;
  left: 39.71%;
  top: 11.52%;
  width: 57.29%;
  height: 81.74%;
  z-index: 3;
  opacity: 0;
  pointer-events: none;

  /* Real depth. Pieces rotate on all three axes and travel toward or away
     from the viewer, so the scene needs a camera. */
  perspective: 1100px;
  perspective-origin: 38% 44%; /* the nucleus */
  transform-style: preserve-3d;
}

/* ---- Shards -------------------------------------------------------- */
/* Each is sized to its own bounding box rather than the whole panel —
   that is what keeps the compositor layers small enough to afford this
   many pieces. */

.shard {
  position: absolute;
  overflow: hidden;
  will-change: transform, opacity;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* The cloned panel, pushed back into place inside its shard so the
   interface lines up across every piece. */
/* No `inset` here — the per-shard left/top/width/height are set inline and
   an !important shorthand would override them, collapsing every piece to
   the same corner of the panel. */
.shard__pane {
  position: absolute !important;

  /* Frozen stand-in for the live backdrop blur, applied while every piece
     is still perfectly aligned so the swap is invisible. */
  background: linear-gradient(
    148deg,
    rgba(38, 32, 26, 0.95) 0%,
    rgba(16, 13, 11, 0.97) 52%,
    rgba(21, 17, 14, 0.95) 100%
  ) !important;
}

/* New edges catch light as the pane opens up. */
.shard::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    118deg,
    rgba(246, 226, 184, 0.55) 0%,
    rgba(246, 226, 184, 0.06) 42%,
    rgba(246, 226, 184, 0) 70%
  );
  opacity: calc(var(--crack) * 0.6);
  mix-blend-mode: screen;
  pointer-events: none;
}

/* ---- Debris --------------------------------------------------------- */
/* Content-free slivers. They only appear once the shards are already
   dissolving, where nothing is legible anyway. */

.deb {
  position: absolute;
  display: block;
  opacity: 0;
  will-change: transform, opacity;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  background: linear-gradient(
    130deg,
    rgba(255, 246, 226, 0.92) 0%,
    rgba(230, 200, 143, 0.5) 45%,
    rgba(160, 130, 90, 0.3) 100%
  );
  box-shadow: 0 0 6px rgba(230, 200, 143, 0.4);
}

/* ---- Cracks ---------------------------------------------------------- */
/* No overflow:visible — the rays run past the panel bounds by design, and
   the SVG viewport is what trims them to the pane. */

.cracks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cracks path {
  fill: none;
  stroke: rgba(246, 226, 184, 0.72);
  stroke-width: 0.16;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  filter: drop-shadow(0 0 2px rgba(230, 200, 143, 0.6));
}

@media (prefers-reduced-motion: reduce) {
  .fracture {
    display: none;
  }
}
