/* The lamp's own parts, scoped to its stage.
   mount() adds .piece-lamp to the stage it draws into (1254²),
   and sets --seg when the cord's characters aren't 40px. */

.piece-lamp .lamp {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.piece-lamp .cord {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* clip-paths are set in lamp.js so characters vanish into the shade */
}

.piece-lamp .char {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--seg, 40px);
  height: var(--seg, 40px);
  margin: calc(var(--seg, 40px) / -2) 0 0 calc(var(--seg, 40px) / -2);
  display: grid;
  place-items: center;
  /* Satoshi (the Figma font) has no CJK glyphs, so go straight to system CJK fonts */
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-weight: 500;
  font-size: var(--seg, 40px);
  line-height: var(--seg, 40px);
  font-feature-settings: "lnum" 1, "pnum" 1;
  color: #1b5de1;
  will-change: transform;
}

/* warm light under the shade while the lamp is on (the page shows it in dark mode) */
.piece-lamp .glow {
  position: absolute;
  pointer-events: none;
  background: radial-gradient(closest-side at 50% 37.5%, rgb(254 210 5 / 0.35), rgb(254 210 5 / 0.12) 55%, rgb(254 210 5 / 0));
  opacity: 0;
  transition: opacity 0.5s ease;
}
