/* ═══════════════════════════════════════════════════
   NOISE + AMBIENCE
   ═══════════════════════════════════════════════════ */
.noise{
  pointer-events:none;position:fixed;inset:0;z-index:9990;
  opacity:.06;mix-blend-mode:overlay;
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency=".85" numOctaves="3" stitchTiles="stitch"/></filter><rect width="200" height="200" filter="url(%23n)" opacity=".55"/></svg>');
  animation:noiseDrift .8s steps(3) infinite;
}
@keyframes noiseDrift{0%{transform:translate(0)}100%{transform:translate(-8px,6px)}}

.ambient-orb{
  position:fixed;border-radius:50%;pointer-events:none;
  filter:blur(120px);opacity:.18;z-index:-1;
  animation:orbDrift 12s ease-in-out infinite alternate;
}
@keyframes orbDrift{
  0%{transform:translate(0,0) scale(1)}
  33%{transform:translate(40px,-30px) scale(1.1)}
  66%{transform:translate(-30px,20px) scale(.95)}
  100%{transform:translate(20px,-10px) scale(1.05)}
}
html[data-theme="light"] .noise{
  opacity:.03;
  mix-blend-mode:multiply;
}
html[data-theme="light"] .ambient-orb{
  opacity:.14;
  filter:blur(130px) saturate(118%);
}

/* ═══════════════════════════════════════════════════
   CURSOR FX (CODEX-LIKE)
   ═══════════════════════════════════════════════════ */
.cursor-fx-layer{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:9996;
  opacity:0;
  transition:opacity .18s ease;
  contain:layout style paint;
  isolation:isolate;
  mix-blend-mode:normal;
}
.cursor-fx-layer.is-active{opacity:1}

.cursor-fx-burst{
  position:fixed;
  left:0;
  top:0;
  width:10px;
  height:10px;
  margin:-5px 0 0 -5px;
  border-radius:999px;
  pointer-events:none;
  will-change:transform,opacity;
}
.cursor-fx-burst.trail{
  width:auto;
  height:auto;
  margin:0;
  transform:translate(-50%,-50%);
  font-family:"SFMono-Regular","Menlo","Consolas","Liberation Mono",monospace;
  font-size:var(--fs,12px);
  font-weight:500;
  letter-spacing:.16em;
  line-height:1;
  color:rgba(234,248,255,var(--a,.56));
  text-shadow:0 0 10px rgba(150,210,255,.34);
  white-space:pre;
  animation:cursorTrailFlow var(--dur,.82s) linear forwards;
}
.cursor-fx-burst.glyph{
  width:auto;
  height:auto;
  margin:0;
  transform:translate(-50%,-50%);
  font-family:"SFMono-Regular","Menlo","Consolas","Liberation Mono",monospace;
  font-size:var(--fs,12px);
  font-weight:600;
  line-height:1;
  color:rgba(233,246,255,var(--a,.96));
  text-shadow:0 0 14px rgba(136,205,255,.58);
  animation:cursorGlyphBurst var(--dur,.82s) cubic-bezier(.14,.8,.24,1) forwards;
}
.cursor-fx-burst.glyph-line{
  font-size:var(--fs,11px);
  font-weight:500;
  letter-spacing:.18em;
}
.cursor-fx-burst.wheel{
  border:1px solid rgba(164,210,255,.72);
  background:radial-gradient(circle,rgba(123,198,255,.28) 0%,rgba(123,198,255,0) 70%);
  animation:cursorWheelPulse .46s cubic-bezier(.2,.8,.3,1) forwards;
}
.cursor-fx-burst.wheel::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:2px;
  height:12px;
  margin-left:-1px;
  border-radius:2px;
  background:rgba(218,239,255,.75);
  transform:translate(-50%,-50%);
}
.cursor-fx-burst.wheel.down::after{animation:cursorWheelDown .4s ease forwards}
.cursor-fx-burst.wheel.up::after{animation:cursorWheelUp .4s ease forwards}
html[data-theme="light"] .cursor-fx-burst.trail{
  color:rgba(54,101,183,var(--a,.5));
  text-shadow:0 0 8px rgba(102,160,240,.18);
}
html[data-theme="light"] .cursor-fx-burst.glyph{
  color:rgba(33,78,158,var(--a,.88));
  text-shadow:0 0 10px rgba(85,145,232,.22);
}
html[data-theme="light"] .cursor-fx-burst.wheel{
  border-color:rgba(86,143,230,.45);
  background:radial-gradient(circle,rgba(103,177,255,.16) 0%,rgba(103,177,255,0) 70%);
}
html[data-theme="light"] .cursor-fx-burst.wheel::after{
  background:rgba(62,111,196,.5);
}

@keyframes cursorTrailFlow{
  0%{
    transform:translate(-50%,-50%) translate3d(var(--sx,0),var(--sy,0),0) scale(.96);
    opacity:0;
  }
  9%{
    opacity:1;
  }
  100%{
    transform:translate(-50%,-50%) translate3d(var(--dx,0),var(--dy,0),0) scale(1.05);
    opacity:0;
  }
}
@keyframes cursorGlyphBurst{
  0%{
    transform:translate(-50%,-50%) translate3d(var(--sx,0),var(--sy,0),0) scale(var(--s0,.34)) rotate(var(--r0,0deg));
    opacity:0;
  }
  10%{
    opacity:1;
  }
  100%{
    transform:translate(-50%,-50%) translate3d(var(--dx,0),var(--dy,0),0) scale(var(--s1,1.24)) rotate(var(--rot,0deg));
    opacity:0;
  }
}
@keyframes cursorWheelPulse{
  0%{transform:scale(.55);opacity:.8}
  100%{transform:scale(3.6);opacity:0}
}
@keyframes cursorWheelDown{
  0%{transform:translate(-50%,-44%) scaleY(.9);opacity:.9}
  100%{transform:translate(-50%,72%) scaleY(1.25);opacity:0}
}
@keyframes cursorWheelUp{
  0%{transform:translate(-50%,-56%) scaleY(.9);opacity:.9}
  100%{transform:translate(-50%,-180%) scaleY(1.25);opacity:0}
}

@media(hover:none),(pointer:coarse),(prefers-reduced-motion:reduce){
  .cursor-fx-layer{display:none!important}
}

/* ═══════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════ */
@media(prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
  .reveal,.reveal-left,.reveal-right,.reveal-scale{opacity:1;transform:none;filter:none}
  .split-text .word .char-wrap{transform:none;opacity:1}
}
