/* ============================================================================
   Tensor Neon Reveal — Torch-Focus Theme Switcher + Persistent Top Neon Line
   ---------------------------------------------------------------------------
   1. Before switching theme: zero line or glow is visible at the top.
   2. On switch to Dark Mode: an immediate, crisp WHITE torch-focus spotlight
      flashes and expands outward from top-center across the screen into vivid
      Electric Violet while the dark theme reveals underneath.
   3. On switch to Light Mode: an immediate pure WHITE + luminous Signal/Ice
      Blue torch spotlight spreads cleanly across the light canvas.
   4. After transition finishes: the top neon line AND its subtle overhead glow
      remain lit and stationary right along the top edge (#notely-neon-topline),
      without disappearing or blocking clicks.
   ========================================================================== */

.notely-neon-reveal {
  position: fixed;
  inset: 0;
  z-index: 2147483640;
  pointer-events: none;
  overflow: hidden;
}

.notely-neon-curtain {
  position: absolute;
  inset: 0;
  will-change: opacity;
}

.notely-neon-reveal[data-target="dark"] .notely-neon-curtain {
  background: radial-gradient(ellipse 92% 66% at 50% 0%, rgba(168, 85, 247, 0.24), #03040a 70%);
}

.notely-neon-reveal[data-target="light"] .notely-neon-curtain {
  background: radial-gradient(ellipse 92% 66% at 50% 0%, rgba(96, 165, 250, 0.22), #f8fafc 72%);
}

/* White Torch-Focus Radial Spotlight blooming outward as transition starts */
.notely-neon-torch {
  position: absolute;
  top: -18vh;
  left: 50%;
  width: 170vmax;
  height: 145vmax;
  transform: translateX(-50%) scale(0.05);
  transform-origin: 50% 12%;
  border-radius: 50%;
  opacity: 0;
  filter: blur(22px);
  will-change: transform, opacity;
}

.notely-neon-reveal[data-target="dark"] .notely-neon-torch {
  background: radial-gradient(
    circle at 50% 14%,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.94) 11%,
    rgba(255, 255, 255, 0.72) 22%,
    rgba(233, 213, 255, 0.56) 36%,
    rgba(168, 85, 247, 0.38) 54%,
    rgba(124, 58, 237, 0.14) 70%,
    transparent 84%
  );
}

.notely-neon-reveal[data-target="light"] .notely-neon-torch {
  background: radial-gradient(
    circle at 50% 14%,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.95) 14%,
    rgba(224, 242, 254, 0.82) 26%,
    rgba(147, 197, 253, 0.52) 42%,
    rgba(59, 130, 246, 0.26) 60%,
    transparent 82%
  );
}

/* Expanding Overhead Volumetric Spotlight Cone (Torch Focus Beam) */
.notely-neon-cone {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(99vw, 1480px);
  height: min(76vh, 660px);
  transform: translateX(-50%) scaleX(0.08) scaleY(0.24);
  transform-origin: 50% 0%;
  clip-path: polygon(16% 0%, 84% 0%, 100% 100%, 0% 100%);
  opacity: 0;
  filter: blur(24px);
  will-change: transform, opacity;
}

.notely-neon-reveal[data-target="dark"] .notely-neon-cone {
  background:
    radial-gradient(ellipse 58% 42% at 50% 0%, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.58) 22%, rgba(216, 180, 254, 0.62) 44%, rgba(147, 51, 234, 0.36) 68%, transparent 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(168, 85, 247, 0.54) 32%, rgba(109, 40, 217, 0.16) 68%, transparent 100%);
}

.notely-neon-reveal[data-target="light"] .notely-neon-cone {
  background:
    radial-gradient(ellipse 58% 42% at 50% 0%, rgba(255, 255, 255, 0.98) 0%, rgba(224, 242, 254, 0.78) 26%, rgba(125, 211, 252, 0.52) 48%, rgba(59, 130, 246, 0.28) 70%, transparent 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(96, 165, 250, 0.44) 36%, rgba(37, 99, 235, 0.14) 70%, transparent 100%);
}

/* Lit Neon Tube expanding outward from center to full width */
.notely-neon-tube {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(98vw, 1440px);
  height: 3.5px;
  border-radius: 999px;
  transform: translateX(-50%) scaleX(0.03);
  transform-origin: center center;
  opacity: 0;
  will-change: transform, opacity;
}

.notely-neon-reveal[data-target="dark"] .notely-neon-tube,
.notely-neon-topline[data-theme="dark"] {
  background: linear-gradient(
    90deg,
    transparent 0%,
    #7c3aed 6%,
    #c084fc 22%,
    #ffffff 50%,
    #e9d5ff 78%,
    #7c3aed 94%,
    transparent 100%
  );
  box-shadow:
    0 0 12px 2px rgba(255, 255, 255, 0.98),
    0 2px 28px 6px rgba(216, 180, 254, 0.85),
    0 6px 64px 16px rgba(139, 92, 246, 0.72);
}

.notely-neon-reveal[data-target="light"] .notely-neon-tube,
.notely-neon-topline[data-theme="light"] {
  background: linear-gradient(
    90deg,
    transparent 0%,
    #2563eb 6%,
    #60a5fa 22%,
    #ffffff 50%,
    #93c5fd 78%,
    #2563eb 94%,
    transparent 100%
  );
  box-shadow:
    0 0 12px 2px rgba(255, 255, 255, 0.98),
    0 2px 26px 5px rgba(96, 165, 250, 0.78),
    0 6px 52px 12px rgba(37, 99, 235, 0.48);
}

/* Persistent lit neon tube + soft top aura anchored after animation stops */
.notely-neon-topline {
  position: fixed;
  top: 0;
  left: 50%;
  width: min(98vw, 1440px);
  height: 3px;
  border-radius: 999px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2147483641;
  opacity: 0;
  transition: opacity 260ms ease;
}

.notely-neon-topline::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 96%;
  height: 118px;
  clip-path: polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%);
  filter: blur(22px);
  pointer-events: none;
}

.notely-neon-topline[data-theme="dark"]::after {
  background: radial-gradient(
    ellipse 64% 85% at 50% 0%,
    rgba(255, 255, 255, 0.32) 0%,
    rgba(192, 132, 252, 0.34) 30%,
    rgba(124, 58, 237, 0.16) 62%,
    transparent 100%
  );
}

.notely-neon-topline[data-theme="light"]::after {
  background: radial-gradient(
    ellipse 64% 85% at 50% 0%,
    rgba(255, 255, 255, 0.52) 0%,
    rgba(96, 165, 250, 0.24) 34%,
    rgba(37, 99, 235, 0.1) 66%,
    transparent 100%
  );
}

/* ----------------------------------------------------------------------------
   Icon swap. The toggle shows a moon in dark mode and a sun in light mode.
   -------------------------------------------------------------------------- */
.n-theme-btn {
  position: relative;
  overflow: hidden;
}

.n-theme-btn svg {
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 260ms ease;
  transform-origin: 50% 50%;
}

html[data-theme='dark'] .n-theme-btn .n-sun {
  display: grid;
  opacity: 0;
  transform: rotate(90deg) scale(0.4);
}

html[data-theme='dark'] .n-theme-btn .n-moon {
  display: grid;
  opacity: 1;
  transform: rotate(0) scale(1);
}

html[data-theme='light'] .n-theme-btn .n-moon {
  display: grid;
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
}

html[data-theme='light'] .n-theme-btn .n-sun {
  display: grid;
  opacity: 1;
  transform: rotate(0) scale(1);
}

.n-theme-btn .n-sun,
.n-theme-btn .n-moon {
  grid-area: 1 / 1;
}

.n-theme-btn:hover svg {
  transform: scale(1.12);
}

@media (prefers-reduced-motion: reduce) {
  .notely-neon-reveal,
  .notely-neon-topline {
    display: none !important;
  }

  .n-theme-btn svg {
    transition: none !important;
  }

  html[data-theme='dark'] .n-theme-btn .n-sun,
  html[data-theme='light'] .n-theme-btn .n-moon {
    transform: none;
  }
}
