/* The nav emblem emits light once on hover: the block beside header.css that
 * mark-light.js mounts around .brand-mark. Vendored from the mark-3d/fable2
 * mock (mark-3d-fable2 d143443, step 2) and cut to the nav: no tilt, no
 * shadow, no lit edge, because the emblem is already a rendered object and
 * idle must stay the asset exactly. Every light layer except the beam and the
 * halo is clipped to the emblem's own alpha, so the metal catches the light
 * and the air around it stays untouched; the beam and the halo are the light
 * that leaves the lantern. All geometry is in percent of the emblem's box, so
 * the 36 px emblem under 560 needs nothing of its own.
 *
 * Two colours, and only here: the warm of the lantern's glass and the cool of
 * the light passing over the metal. Every stop below derives from them, so a
 * palette scheme swaps the light by swapping two tokens. */
:root {
  --mark-light-warm: #FFE2AA;
  --mark-light-cool: #FFFFFF;
  --mark-light-ease: var(--resurs-ease, ease-in-out);
}

.mark-light {
  --mark-light-lantern-x: 49.4%;
  --mark-light-lantern-y: 29.8%;
  position: relative;
  display: block;
  flex: none;
}

.mark-light > * {
  pointer-events: none;
}
.mark-light > .brand-mark {
  position: relative;
}
.mark-light-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
}

/* the emblem's own alpha as a clip for the light on the metal */
.mark-light-masked {
  -webkit-mask-image: var(--mark-light-mask);
  mask-image: var(--mark-light-mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* the sweep: a specular band on an image three widths wide. background-position
   running -4% -> 61% slides the image left under the element, so the band,
   centred at 38% of the image, enters at the right edge and leaves the left
   edge at the end: the whole mark, right to left, in one pass. */
.mark-light-sweep {
  background-image: linear-gradient(
    104deg,
    transparent 33.5%,
    color-mix(in srgb, var(--mark-light-cool) 50%, transparent) 35.5%,
    color-mix(in srgb, var(--mark-light-cool) 95%, transparent) 37.2%,
    color-mix(in srgb, var(--mark-light-cool) 95%, transparent) 38.8%,
    color-mix(in srgb, var(--mark-light-cool) 50%, transparent) 40.5%,
    transparent 42.5%
  );
  background-size: 300% 100%;
  background-position: -4% 0;
  mix-blend-mode: screen;
}

/* the rim: a narrow, hotter core riding the same band, additive so it still
   pops on the metal's own bright highlights where screen alone saturates */
.mark-light-rim {
  background-image: linear-gradient(
    104deg,
    transparent 36.5%,
    color-mix(in srgb, var(--mark-light-warm) 32%, transparent) 37.4%,
    color-mix(in srgb, var(--mark-light-warm) 60%, transparent) 38%,
    color-mix(in srgb, var(--mark-light-warm) 32%, transparent) 38.6%,
    transparent 39.5%
  );
  background-size: 300% 100%;
  background-position: -4% 0;
  mix-blend-mode: plus-lighter;
}

/* the lantern's glass warming: a warm glow at the lantern room, on the metal only */
.mark-light-glow {
  background: radial-gradient(
    ellipse 14% 12% at var(--mark-light-lantern-x) var(--mark-light-lantern-y),
    var(--mark-light-warm) 0%,
    color-mix(in srgb, var(--mark-light-warm) 85%, transparent) 35%,
    color-mix(in srgb, var(--mark-light-warm) 35%, transparent) 65%,
    transparent 100%
  );
  mix-blend-mode: screen;
}

/* the halo: the same light reaching the air right beside the glass, unclipped
   and tight, so at 44 px the lantern reads as lit and not merely as brighter */
.mark-light-halo {
  background: radial-gradient(
    ellipse 13% 12% at var(--mark-light-lantern-x) var(--mark-light-lantern-y),
    color-mix(in srgb, var(--mark-light-warm) 55%, transparent) 0%,
    color-mix(in srgb, var(--mark-light-warm) 22%, transparent) 50%,
    transparent 100%
  );
  filter: blur(0.6px);
  mix-blend-mode: screen;
}

/* the beam: a cone leaving the lantern to the right, into the air, unclipped.
   It dies in the gap before the typed word rather than crossing it. */
.mark-light-beam {
  left: var(--mark-light-lantern-x);
  top: calc(var(--mark-light-lantern-y) - 6%);
  width: 62%;
  height: 12%;
  inset-inline-end: auto;
  bottom: auto;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--mark-light-warm) 95%, transparent) 0%,
    color-mix(in srgb, var(--mark-light-warm) 55%, transparent) 30%,
    transparent 100%
  );
  clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 58%);
  filter: blur(0.3px);
  mix-blend-mode: screen;
  transform-origin: 0 50%;
  transform: rotate(-4deg);
}
