/* Each coloured surface owns its light, clipped at its edges and painted behind its content. */
[data-light] {
  position: relative;
  isolation: isolate;
}
.surface-light {
  --light-trace: #ffceab;
  --light-core: 255, 245, 211;
  --light-middle: 255, 184, 122;
  --light-rim: 255, 147, 181;
  --light-wash-strength: .88;
  --light-trace-strength: .55;
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  contain: strict;
  border-radius: inherit;
  pointer-events: none;
  user-select: none;
}
[data-light="soft"] > .surface-light {
  --light-trace: #ae5e83;
  --light-core: 255, 254, 236;
  --light-middle: 255, 194, 151;
  --light-rim: 223, 161, 211;
  --light-wash-strength: .94;
  --light-trace-strength: .43;
}
.surface-light::before,
.surface-light::after {
  position: absolute;
  left: 72%;
  top: 38%;
  display: block;
  content: "";
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 170ms linear;
}
.surface-light::before {
  width: min(52rem, 125vmax);
  height: min(52rem, 125vmax);
  opacity: .25;
  background: radial-gradient(ellipse closest-side,
    rgba(var(--light-core), .94) 0%,
    rgba(var(--light-core), .66) 2%,
    rgba(var(--light-middle), .47) 10%,
    rgba(var(--light-middle), .26) 31%,
    rgba(var(--light-rim), .14) 53%,
    rgba(var(--light-rim), 0) 100%);
}
.surface-light::after {
  /* The repeat tile stays aligned to the board as its aperture moves. */
  --trace-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='white' stroke-width='1'%3E%3Cpath stroke-opacity='.48' d='M0 .5H96M.5 0V96M48 .5V96M0 48.5H96'/%3E%3Cpath d='M0 23.5h13l8 8h16m13 37h13l7-7h26M73 0v13l8 8v8'/%3E%3C/g%3E%3Cg fill='white'%3E%3Ccircle cx='37' cy='31.5' r='1.7'/%3E%3Ccircle cx='50' cy='68.5' r='1.7'/%3E%3Ccircle cx='81' cy='29' r='1.7'/%3E%3C/g%3E%3C/svg%3E");
  width: min(32rem, 94vmax);
  height: min(32rem, 94vmax);
  opacity: .09;
  background: var(--light-trace);
  mask-image: radial-gradient(ellipse closest-side, #000 12%, rgba(0,0,0,.76) 37%, transparent 94%), var(--trace-tile);
  mask-size: 100% 100%, 96px 96px;
  mask-position: center, calc(50% - var(--light-x, 0px)) calc(50% - var(--light-y, 0px));
  mask-repeat: no-repeat, repeat;
  mask-composite: intersect;
}
.surface-light[data-track]::before,
.surface-light[data-track]::after {
  left: 0;
  top: 0;
  transform: translate3d(calc(var(--light-x) - 50%), calc(var(--light-y) - 50%), 0);
}
.surface-light[data-lit]::before { opacity: var(--light-wash-strength); }
.surface-light[data-lit]::after { opacity: var(--light-trace-strength); }
@supports not (mask-composite: intersect) {
  .surface-light::after { display: none; }
}
@media (prefers-reduced-motion: reduce), (hover: none) and (pointer: coarse) {
  .surface-light::before, .surface-light::after { transition: none; }
}
@media (forced-colors: active) {
  .surface-light { display: none; }
}
.contact-copy > .surface-light {
  --light-wash-strength: .19;
  --light-trace-strength: .17;
}
