/* ═══════════════════════════════════════════════════════════════
   ARCANA — Interactive Effects Styles
   OriginKit-inspired effects for vanilla HTML/CSS/JS
   ═══════════════════════════════════════════════════════════════ */

/* === ASCII Rain Canvas (now Sigil Rain) ===
   Full-bleed over the hero section (moved out of the 1120px .wrap so the
   100vw canvas origins at viewport-left and the sigil centers correctly). */
.ascii-rain-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}
#ascii-rain {
  width: 100%;
  height: 100vh;
  display: block;
}

/* === Cursor Glow === */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cursor-glow.active {
  opacity: 1;
}
.site-light .cursor-glow {
  background: radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%);
}

/* === Scramble Text === */
.hero-headline[data-scramble] {
  display: inline-block;
  min-height: 1em;
}

/* === Electric Border (pseudo-element outside parent via padding) === */
[data-electric] {
  position: relative;
  z-index: 1;
}
[data-electric].electric-active {
  box-shadow: 0 0 0 2px var(--color-primary), 0 0 20px rgba(99,102,241,0.3);
  transition: box-shadow 0.3s ease;
}

/* === 3D Card Reveal / Tilt Cards — removed (no matching elements) === */

/* === Stat Pulse — removed (no matching elements) === */

/* === Typewriter Cursor === */
.tw-cursor {
  color: var(--color-primary);
  animation: twBlink 0.8s step-end infinite;
  margin-left: 1px;
  font-weight: 400;
}
.tw-cursor.blink {
  animation: twBlink 1s step-end infinite;
}
@keyframes twBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* === Magnetic Button Hover === */
[data-magnetic] {
  transition: transform 400ms cubic-bezier(0.34,1.56,0.64,1);
  will-change: transform;
}

/* === Electric Border Gradient Animation === */
@keyframes borderGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(99,102,241,0.2); }
  50% { box-shadow: 0 0 16px 2px rgba(99,102,241,0.25), 0 0 0 1px rgba(99,102,241,0.4); }
}
.btn.primary.electric-active {
  animation: borderGlow 1.5s ease-in-out infinite;
}

/* === Hero Section Enhancement — .hero rule removed (no page loads effects.css with a bare .hero class; home page uses .hero-section) === */

/* === Pill Glow on Hover === */
.pill[data-magnetic] {
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.pill[data-magnetic]:hover {
  box-shadow: 0 0 8px rgba(99,102,241,0.1);
}

/* === Stats Stagger — removed (no matching elements) === */

/* === Step Number Flip — removed (no matching elements) === */

/* === Nav Link Hover Glow === */
nav a:not(.signin):not(.status):hover {
  background: rgba(255,255,255,.04);
  border-radius: 6px;
}

/* === Film Grain Overlay === */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  animation: grainShift 0.5s steps(4) infinite;
  will-change: transform;
}
@keyframes grainShift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(1px, -1px); }
  75% { transform: translate(-1px, 2px); }
}

/* === CRT Scanlines === */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.03;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.035) 2px,
    rgba(255, 255, 255, 0.035) 4px
  );
}

/* === Cinematic Frame (vignette + chromatic hint) === */
.cinematic-frame {
  position: relative;
}
.cinematic-frame::before,
.cinematic-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 2;
}
.cinematic-frame::before {
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.cinematic-frame::after {
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.6) 100%);
}
.cinematic-frame video,
.cinematic-frame img {
  position: relative;
  z-index: 1;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  [data-magnetic] { transform: none !important; }
  .cursor-glow { display: none; }
  .ascii-rain-wrap { display: none; }
  [data-electric].electric-active { box-shadow: none; transition: none; }
  .btn.primary.electric-active { animation: none; }
  .pill[data-magnetic] { transition: none; }
  .pill[data-magnetic]:hover { box-shadow: none; }
  .grain-overlay, .scanlines { animation: none; opacity: 0.04; }
}

/* === Light Mode Overrides === */
.site-light .cursor-glow {
  background: radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%);
}
.site-light .ascii-rain-wrap {
  opacity: 0.3;
}
.site-light .scanlines {
  opacity: 0.02;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.02) 2px,
    rgba(0, 0, 0, 0.02) 4px
  );
}
