/* The text glows (Aaron, 2 Dec 2026): soft light behind the glyphs, in the text's own ink colour.
   Loads after site.css. Two parts per block:
   - a resting glow: a static text-shadow on the text itself, painted once. With scripts off and under
     reduced motion this is all there is.
   - a breathing layer: ::after carries a copy of the text (from data-glow, set by glow.js) in transparent ink
     with the same shadow, behind the text. Only its opacity changes: the 8s breath (CSS, held to the clock
     by glow.js as logo.js holds the logo's) and the kick on a lead note (Web Animations).
   The layer's opacity is light added to the resting glow, in the logo glow's proportions: the logo rests at
   0.45, breathes to 0.60 and kicks to 0.95, so the layer runs 0 to 1/3 on the breath and kicks to 1.
   Radii are in em so the light scales with the type.
   Its content has empty alt text (content: … / ""), so it is not in the accessibility tree; it is not
   selectable or hit-testable, and being absolutely positioned it moves nothing. */

.glow{
  position: relative;
  text-shadow: var(--glow-shadow);
}
/* Tagline: small type, so a clear but close glow. */
.glow--clear{ --glow-shadow: 0 0 .5em color-mix(in srgb, currentColor 75%, transparent); }
/* Lead, the form's title and labels, the sent state. */
.glow--soft{ --glow-shadow: 0 0 .5em color-mix(in srgb, currentColor 50%, transparent); }
/* Small help lines: a faint resting glow and no breathing layer. */
.glow--faint{ --glow-shadow: 0 0 .5em color-mix(in srgb, currentColor 18%, transparent); }

.glow[data-glow]::after{
  content: attr(data-glow) / "";
  position: absolute; inset: 0; z-index: -1;
  color: transparent;
  text-shadow: var(--glow-shadow);
  white-space: pre-line;
  pointer-events: none;
  -webkit-user-select: none; user-select: none;
  opacity: 0;
  will-change: opacity;
  animation: glow-breath 8s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}
/* A bulleted pixel label starts its text after the 8px bullet and the 8px gap. */
.pl-label:not(.pl-label--plain).glow[data-glow]::after{ left: calc(var(--space-2) * 2); }

/* The band's own glow (bundle.css: blur 12px at 0.6) breathes and kicks with the logo, in the same proportions:
   0.6 at rest, 0.8 at the top of the breath, 1 on a kick. Only once glow.js holds it to the clock (.glow-live on
   the column): with scripts off the band rests at bundle.css's 0.6. */
.glow-live .site-band::after{
  will-change: opacity;
  animation: band-breath 8s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

/* The breath, 0.5 - 0.5 cos(2 pi t / 8s), with the same sine ease as logo-breath: low at 0, high at 4s. */
@keyframes glow-breath{
  0%, 100%{ opacity: 0; }
  50%{ opacity: .3333; }
}
@keyframes band-breath{
  0%, 100%{ opacity: .6; }
  50%{ opacity: .8; }
}


/* ---------- The form gives off light (Aaron, 2 Dec 2026: "same for the form") ----------
   Each lit part has a resting glow, a static box-shadow painted once, and a breathing layer: an element with
   the same light, stronger, behind the part, whose opacity alone changes (form-breath, held to the clock and
   kicked by glow.js with the text). Colours are the ones the components give their states:
   - a field at rest glows in its own border colour (ivory, as line-strong), so a resting glow never looks
     like focus; with focus it is the brand's lit edge, shadow-neon in accent; with an error it is alert.
   - the primary button glows in its ivory fill; on hover bundle.css gives it shadow-neon, as before.
   The glow is outside each control: the field's fill is opaque, so nothing lights behind typed text. */
.site-field{ position: relative; }
.site-field{
  --field-rest: 0 0 12px color-mix(in srgb, var(--ivory) 14%, transparent);
  --field-lit: 0 0 24px color-mix(in srgb, var(--ivory) 45%, transparent);
}
.site-field:focus-within{
  --field-rest: var(--shadow-neon);
  --field-lit: 0 0 24px color-mix(in srgb, var(--accent) 60%, transparent);
}
.site-field.pl-field--error{
  /* Kept low enough that the alert error line under the field still clears 4.5:1 in its light. */
  --field-rest: 0 0 24px color-mix(in srgb, var(--alert) 15%, transparent);
  --field-lit: 0 0 24px color-mix(in srgb, var(--alert) 30%, transparent);
}
/* The glow sits on the control's grid cell (row 2 of .pl-field: label, control, help; both ends named, since an
   absolutely placed grid item's auto end is the container's edge). Its light comes from a box inset 12px top
   and bottom: it spreads full strength to the sides, but only faintly over the field's top and bottom edges, so
   the label above and the help line or the next label below stay at 4.5:1 or better at the brightest moment.
   The box itself carries the resting glow (static); its ::after carries the breathing light. */
.site-field-glow{
  position: absolute; grid-area: 2 / 1 / 3 / 2; inset: 0; z-index: -1;
  pointer-events: none;
}
.site-field-glow::before,
.site-field-glow::after{
  content: ""; position: absolute; inset: 12px 0;
}
.site-field-glow::before{ box-shadow: var(--field-rest); }
.site-field-glow::after{ box-shadow: var(--field-lit); }
.site-send{ box-shadow: 0 0 16px color-mix(in srgb, var(--surface-inverse) 22%, transparent); }
.site-send::before{
  content: ""; position: absolute; inset: calc(-1 * var(--cell)); z-index: -1;
  box-shadow: 0 0 24px color-mix(in srgb, var(--surface-inverse) 45%, transparent);
}
.site-send[disabled]::before{ display: none; }
/* The sound prompt glows as SEND does, and breathes and kicks with the form (glow.js finds it outside the column). */
.site-sound-prompt{ box-shadow: 0 0 16px color-mix(in srgb, var(--surface-inverse) 22%, transparent); }
.site-sound-prompt::before{
  content: ""; position: absolute; inset: calc(-1 * var(--cell)); z-index: -1;
  box-shadow: 0 0 24px color-mix(in srgb, var(--surface-inverse) 45%, transparent);
}
.site-field-glow::after, .site-send::before, .site-sound-prompt::before{ opacity: 0; pointer-events: none; }
.glow-live .site-field-glow::after,
.glow-live .site-send::before,
.glow-live .site-sound-prompt::before{
  will-change: opacity;
  animation: form-breath 8s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}
/* Stronger than the text's breath so it reads at a glance: 0 to 0.6, and a kick adds 0.8 (to 1). */
@keyframes form-breath{
  0%, 100%{ opacity: 0; }
  50%{ opacity: .6; }
}

/* Reduced motion: the resting glow only, held still. */
@media (prefers-reduced-motion: reduce){
  .glow[data-glow]::after{ display: none; animation: none; will-change: auto; }
  .glow-live .site-band::after{ animation: none; will-change: auto; }
  .glow-live .site-field-glow::after,
  .glow-live .site-send::before,
  .glow-live .site-sound-prompt::before{ animation: none; will-change: auto; }
}
