/* islands.js: each linked layer lifted into its own .ga-layer over the drawing, its clear hit box (.ga-link), and what
   pointing at one does: a grey veil (.ga-dim, --abstract-dim, --abstract-dim-fill) over everything but that layer, which
   grows round its own centre (--abstract-pop). Timing is the site's own. */
[data-abstract="islands"] { position: relative; isolation: isolate; }
[data-abstract="islands"] > svg { overflow: visible; }
[data-abstract="islands"] > .ga-layer {
  position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  pointer-events: none; z-index: 1;                /* the layer is figure-sized: only its hit box is a target */
  transition: transform var(--dur-base) var(--ease-out), z-index 0s linear var(--dur-base);
  /* at rest a clickable part breathes, so it reads as a target. The breath is `scale`, the hover grow
     is `transform` -- two properties that multiply, so growing picks the breath up wherever it is. */
  animation: ga-breathe var(--abstract-idle-dur) ease-in-out infinite;
}
[data-abstract="islands"] .ga-link { fill: transparent; pointer-events: all; cursor: pointer; outline: none; }
[data-abstract="islands"] > .ga-dim {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  /* the veil fades in with the grow but lifts at once when the pointer leaves: the part may take its time
     shrinking back, the rest of the drawing must not stay grey while it does */
  background: var(--abstract-dim-fill); opacity: 0; transition: opacity 0s;
}
[data-abstract="islands"].ga-on > .ga-dim { opacity: var(--abstract-dim); transition: opacity var(--dur-base) var(--ease-out); }
[data-abstract="islands"] > .ga-layer.is-on { z-index: 3; transform: scale(var(--abstract-pop)); transition: transform var(--dur-slow) var(--abstract-pop-ease), z-index 0s; }
@keyframes ga-breathe { 50% { scale: var(--abstract-idle); } }
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) [data-abstract="islands"] > :is(.ga-dim, .ga-layer) { transition: none; }
  :root:not([data-motion="full"]) [data-abstract="islands"] > .ga-layer { animation: none; }
}
:root[data-motion="reduced"] [data-abstract="islands"] > :is(.ga-dim, .ga-layer) { transition: none; }
:root[data-motion="reduced"] [data-abstract="islands"] > .ga-layer { animation: none; }
