/* =====================================================================
   HOLO — the slots for js/holo.js (10/19)
   A slot is an empty box in the page; the sculpture is drawn by one
   shared canvas laid over the document (.holo-layer), so the box itself
   only carries a soft pool of light, which is also the whole look when
   WebGL2 is missing (.holo-off), reduced data, or the script never ran.
   Loaded after glow.css on every page that has a [data-holo] slot.
   ===================================================================== */
.holo {
  --tone: var(--color-accent);
  position: relative; display: block; width: 100%;
  aspect-ratio: var(--holo-ar, 1.25); min-height: 160px;
  pointer-events: auto; cursor: default;
  -webkit-tap-highlight-color: transparent;
}
/* the pool the sculpture stands in (under the canvas, so the light sits on
   something): faint while live, the whole figure when the layer is off */
.holo::before {
  content: ""; position: absolute; inset: 8% 6%; pointer-events: none; border-radius: 50%;
  background:
    radial-gradient(closest-side, color-mix(in oklch, var(--holo-pool) 16%, transparent), transparent 72%),
    radial-gradient(40% 18% at 50% 92%, color-mix(in oklch, var(--holo-pool) 22%, transparent), transparent 70%);
  opacity: .55; transition: opacity 1.2s var(--ease-out);
}
.holo.holo-live::before { opacity: .35; }
/* without the layer: the pool becomes a slow ring of light, still decoration */
.holo.holo-off::before { opacity: .9; }
.holo.holo-off::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: min(56%, 220px); aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; pointer-events: none;
  background: conic-gradient(from var(--lf-a, 0deg), transparent 0 60%, color-mix(in oklch, var(--tone) 80%, transparent) 78%, transparent 92%);
  -webkit-mask: radial-gradient(closest-side, transparent 88%, #000 90%, #000 96%, transparent 98%);
          mask: radial-gradient(closest-side, transparent 88%, #000 90%, #000 96%, transparent 98%);
  animation: holoTurn 9s linear infinite;
}
@keyframes holoTurn { to { --lf-a: 360deg; } }

.holo[data-tone="violet"]  { --tone: oklch(72% .17 300); }
.holo[data-tone="magenta"] { --tone: var(--color-ignition); }
.holo[data-tone="ember"]   { --tone: var(--color-ember); }
.holo[data-tone="ok"]      { --tone: var(--color-ok); }

/* the one shared canvas: in the document (so it scrolls WITH the slots),
   moved each frame to the scroll position it was drawn for; above body
   content, under the nav (120) and every overlay */
.holo-layer { position: absolute; left: 0; top: 0; width: 100%; height: 0; overflow: visible; pointer-events: none; z-index: 8; }
.holo-canvas { position: absolute; left: 0; top: 0; display: block; pointer-events: none; will-change: transform; }


/* placement helpers: a slot beside a section head, or floated at its side */
.holo-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: var(--space-xl); align-items: center; }
/* a slot with a caption under it sits in a .holo-fig wrapper and is sized the same */
.holo-split > .holo, .holo-split > .holo-fig { max-width: 460px; justify-self: center; width: 100%; }
.holo-fig > .holo { max-width: none; }
/* 10/19 pass 1: tablets keep the slot beside the words (stacked, a small
   form floated alone in a mostly empty band); only phones stack it */
@media (min-width: 561px) and (max-width: 880px) {
  /* the form's column never drops under 200px (at 561-650 it was 160-180px wide) */
  .holo-split { grid-template-columns: minmax(0, 1.25fr) minmax(200px, .75fr); gap: var(--space-lg); }
  .holo-split > .holo, .holo-split > .holo-fig { max-width: 300px; }
  .holo-split > .holo, .holo-split > .holo-fig > .holo { --holo-ar: 1.2; }
}
@media (max-width: 560px) {
  .holo-split { grid-template-columns: 1fr; gap: var(--space-md); }
  .holo-split > .holo, .holo-split > .holo-fig { max-width: 340px; }
  .holo-split > .holo, .holo-split > .holo-fig > .holo { --holo-ar: 1.5; max-height: 220px; }
}

/* 10/19 pass 2: two sizes, one per role, so the same job looks the same on
   every page. HEAD: beside a section's H2 (the .holo-split default is this
   size). INLINE: a small form in a card or beside a single line. */
.holo.holo-head { max-width: 420px; --holo-ar: 1.45; }
.holo.holo-inline { max-width: 280px; --holo-ar: 1.3; min-height: 120px; }
@media (min-width: 561px) and (max-width: 880px) { .holo.holo-head { max-width: 300px; --holo-ar: 1.2; } }
/* one phone rule for the whole site: a slot that would only push its section
   down on a phone opts out with .holo-wide (it is never built while hidden) */
@media (max-width: 560px) {
  .holo.holo-wide { display: none; }
  /* stacked under its words on a phone, a head slot takes the split's phone size
     (holo-head above has the same specificity and came later, so it won) */
  .holo-split > .holo.holo-head, .holo-split > .holo-fig > .holo.holo-head { max-width: 340px; --holo-ar: 1.5; }
}

/* the pool under the form follows a morph to the second shape's tone */
.holo.holo-morphed[data-holo-morph-tone="cyan"]    { --tone: var(--color-accent); }
.holo.holo-morphed[data-holo-morph-tone="violet"]  { --tone: oklch(72% .17 300); }
.holo.holo-morphed[data-holo-morph-tone="magenta"] { --tone: var(--color-ignition); }
.holo.holo-morphed[data-holo-morph-tone="ember"]   { --tone: var(--color-ember); }
.holo.holo-morphed[data-holo-morph-tone="ok"]      { --tone: var(--color-ok); }
/* the pool fades between the two colours (a gradient cannot be animated; a
   registered colour inside it can) */
@property --holo-pool { syntax: "<color>"; inherits: true; initial-value: transparent; }
.holo { --holo-pool: var(--tone); transition: --holo-pool 1.2s var(--ease-out); }

@media (prefers-reduced-motion: reduce) { .holo.holo-off::after { animation: none; } }
@media (forced-colors: active) { .holo, .holo-layer { display: none; } }
@media print { .holo-layer { display: none; } }

