/* ============================================================
   Signature effect — paper grain + cursor light + text-shadow
   Loaded by oneill.html, privacy.html, sense-check/index.html.
   Effect is completely still at rest; reacts only to cursor.
   ============================================================ */

/* --- Stacking: ensure content roots sit above the fixed layers --- */
#root,
.page,
.privacy {
  position: relative;
  z-index: 2;
}

/* --- Paper grain — always on (incl. touch + reduced motion) --- */
.signature-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* --- Cursor light — opacity 0 by default; enabled on hover-capable devices --- */
.signature-light {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  mix-blend-mode: multiply;
  background: radial-gradient(
    circle 600px at var(--mx, 50%) var(--my, 50%),
    rgba(255, 235, 205, 0.55),
    transparent 70%
  );
}

/* --- Enable light + text-shadow drift on hover-capable devices --- */
@media (hover: hover) and (pointer: fine) {
  .signature-light { opacity: 1; }

  .hero__title,
  .section__title {
    text-shadow:
      calc(var(--mxn, 0) * -5px)
      calc(var(--myn, 0) * -5px)
      18px
      rgba(10, 15, 18, 0.10);
  }
}

/* --- Reduced motion: freeze light at viewport centre, no text-shadow --- */
@media (prefers-reduced-motion: reduce) {
  .signature-light {
    background: radial-gradient(
      circle 600px at 50% 50%,
      rgba(255, 235, 205, 0.55),
      transparent 70%
    );
  }
  .hero__title,
  .section__title {
    text-shadow: none;
  }
}

/* --- TweaksPanel override: hide entire signature effect --- */
body.no-signature-effect .signature-grain,
body.no-signature-effect .signature-light {
  display: none;
}

body.no-signature-effect .hero__title,
body.no-signature-effect .section__title {
  text-shadow: none;
}