/* Laser edition. One etch pass, then still. */

.etch {
  position: relative;
}

.etch h1 {
  position: relative;
  z-index: 1;
  margin: 0;
}

.etch-hot {
  transition: opacity 0.35s ease;
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  pointer-events: none;
  user-select: none;
  color: transparent;
  opacity: 0;
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  font-size: clamp(2.35rem, 5.4vw, 4.35rem);
  background: radial-gradient(
    110px 0.72em at var(--hx, -30%) var(--hy, 40%),
    #fff 0%,
    #ffd4d4 10%,
    #ff2a2a 24%,
    #e10600 42%,
    transparent 70%
  );
  -webkit-background-clip: text;
  background-clip: text;
}

.etch.is-etching .etch-hot {
  opacity: 1;
}

.etch-beam {
  transition: opacity 0.3s ease;
  position: absolute;
  z-index: 3;
  width: 28px;
  height: 2px;
  margin-left: -28px;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, #8d0000 28%, #e10600 68%, #ff3a3a 100%);
  box-shadow:
    0 0 10px 2px rgba(225, 6, 0, 0.95),
    0 0 22px 6px rgba(180, 0, 0, 0.5);
}

.etch.is-etching .etch-beam {
  opacity: 1;
}

.etch-tip {
  position: absolute;
  right: -4px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: #fff;
  box-shadow:
    0 0 4px 1px #fff,
    0 0 10px 3px #ff2a2a,
    0 0 20px 7px rgba(225, 6, 0, 0.9);
}

.etch-sparks {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.feature {
  perspective: 1100px;
}

.feature .shot {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.16s ease-out;
  will-change: transform;
}

.glint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    108deg,
    transparent 40%,
    rgba(180, 0, 0, 0.2) 46%,
    rgba(255, 40, 40, 0.85) 50%,
    rgba(180, 0, 0, 0.2) 54%,
    transparent 62%
  );
  background-size: 240% 100%;
  background-position: var(--gx, -30%) 50%;
  mix-blend-mode: screen;
  transition: background-position 0.2s ease-out;
}

.scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 28px;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(#ff3a3a, #ff3a3a) center / 100% 1px no-repeat,
    linear-gradient(180deg, transparent 0%, rgba(225, 6, 0, 0.55) 50%, transparent 100%);
  transform: translate3d(0, -28px, 0);
  will-change: transform, opacity;
}

.scan-frame.is-scanning .scanline {
  animation: laser-scan 1.2s cubic-bezier(0.37, 0.04, 0.2, 1) 1;
}

@keyframes laser-scan {
  0% { opacity: 0; transform: translate3d(0, -28px, 0); }
  10% { opacity: 1; }
  86% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(0, var(--scan, 320px), 0); }
}

@media (prefers-reduced-motion: reduce) {
  .etch-hot,
  .etch-beam,
  .etch-sparks,
  .scanline,
  .glint {
    display: none !important;
  }

  .feature .shot {
    transform: none !important;
  }
}
