/* =====================================================================
   REACTIVE LAYER — styles for the reactive vocabulary
   Theme by overriding the variables in :root on the page.
   Pairs with reactive-engine.js (and optionally reactive-audio.js).
   ===================================================================== */
:root {
  --reactive-accent: #6fae3f;     /* goblin moss by default — retheme per world */
  --reactive-accent-2: #ffce5c;   /* gold / payoff warmth */
  --reactive-ink: #0a1108;
}

/* ---- CURSOR: eyes ---------------------------------------------------
   No styling required for tracking (the engine moves the pupils), but
   give pupils a smooth ease so they glide instead of snap. */
[data-eyes] .pupil { transition: none; } /* engine drives per-frame; keep snappy */

/* ---- SCROLL: reveal-on-enter -------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s ease, transform .9s ease;
  will-change: opacity, transform;
}
[data-reveal].reactive-in { opacity: 1; transform: none; }
/* reveal flavours: data-reveal="left|right|zoom" */
[data-reveal="left"]  { transform: translateX(-50px); }
[data-reveal="right"] { transform: translateX(50px); }
[data-reveal="zoom"]  { transform: scale(.9); }
[data-reveal="left"].reactive-in,
[data-reveal="right"].reactive-in,
[data-reveal="zoom"].reactive-in { transform: none; }

/* ---- SCROLL: depth meter (optional UI) ---------------------------- */
.reactive-depth {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 180px; background: rgba(255,255,255,.08);
  border-radius: 6px; overflow: hidden; z-index: 30; pointer-events: none;
}
.reactive-depth::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%;
  height: calc(var(--depth, 0) * 100%);
  background: linear-gradient(180deg, var(--reactive-accent), var(--reactive-accent-2));
}

/* ---- CLICK: torches (scroll-wake light) --------------------------- */
.reactive-torch { position: relative; width: 14px; height: 70px; background: #3a2a16; border-radius: 4px; }
.reactive-torch .flame {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%) scale(0);
  width: 22px; height: 34px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #fff3b0, #ffae2e 45%, #ff5a1e 80%);
  filter: blur(.4px); transition: transform .5s ease;
}
.reactive-torch.lit .flame { transform: translateX(-50%) scale(1); animation: reactive-flick .12s infinite alternate; }
@keyframes reactive-flick { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-52%) scale(1.08, 1.12); } }

/* ---- CLICK: the flying clone tossed toward a target --------------- */
.reactive-flying {
  position: fixed; z-index: 8; pointer-events: none; will-change: transform, opacity;
  background: #1c1712; border: 1px solid #7a5a2a; border-radius: 10px;
  padding: 12px 14px; color: #e6dcc8; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

/* ---- POLITE MOTION: calm everything when the user asks ------------ */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .reactive-torch .flame { animation: none; }
}
