/* ============================================================
   POP UP YOUR BRAND — UX Styles
   Electric Citrus | Simplified & reliable
   ============================================================ */


/* ----------------------------------------------------------
   CUSTOM CURSOR (desktop only)
   ---------------------------------------------------------- */
@media (pointer: fine) {
  *, *::before, *::after { cursor: none !important; }

  #cursor-dot {
    position: fixed;
    top: -4px; left: -4px;
    width: 8px; height: 8px;
    background: #d4f53c;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    transition: width 0.15s, height 0.15s, top 0.15s, left 0.15s;
    mix-blend-mode: difference;
  }
  #cursor-dot.clicking {
    width: 4px; height: 4px;
    top: -2px; left: -2px;
    background: #fff;
  }

  #cursor-ring {
    position: fixed;
    top: -20px; left: -20px;
    width: 40px; height: 40px;
    border: 1.5px solid rgba(212, 245, 60, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    will-change: transform;
    display: flex; align-items: center; justify-content: center;
    transition: width 0.3s ease, height 0.3s ease, top 0.3s ease, left 0.3s ease,
                border-radius 0.3s, background 0.2s, border-color 0.2s;
  }
  #cursor-ring.is-hovering {
    width: 56px; height: 56px;
    top: -28px; left: -28px;
    border-color: #d4f53c;
    background: rgba(212, 245, 60, 0.06);
  }
  #cursor-ring.has-label {
    width: 72px; height: 72px;
    top: -36px; left: -36px;
    background: #d4f53c;
    border-color: transparent;
    border-radius: 0;
  }

  #cursor-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9px; font-weight: 700;
    letter-spacing: 0.15em;
    color: #0f1a00;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
  }
}


/* ----------------------------------------------------------
   SCROLL REVEALS — only when JS is ready
   If JS fails, everything is visible (no opacity:0 default)
   ---------------------------------------------------------- */
html.js-ready .puyb-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out, clip-path 0.8s ease-out;
}

html.js-ready .puyb-reveal[data-reveal="slide-left"]  { transform: translateX(-30px); }
html.js-ready .puyb-reveal[data-reveal="slide-right"] { transform: translateX(30px); }

html.js-ready .puyb-reveal[data-reveal="clip-up"] {
  opacity: 1;
  transform: none;
  clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
}

html.js-ready .puyb-reveal[data-reveal="stagger"] {
  opacity: 1;
  transform: none;
}
html.js-ready .puyb-reveal[data-reveal="stagger"] > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Visible state */
.puyb-reveal.puyb-visible {
  opacity: 1 !important;
  transform: none !important;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%) !important;
}
.puyb-reveal[data-reveal="stagger"] > *.puyb-visible {
  opacity: 1 !important;
  transform: none !important;
}


/* ----------------------------------------------------------
   NAVBAR
   ---------------------------------------------------------- */
nav {
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
nav.nav-scrolled {
  border-bottom-color: rgba(212, 245, 60, 0.15) !important;
  box-shadow: 0 0 30px rgba(212, 245, 60, 0.04);
}
nav.nav-hidden { transform: translateY(-100%); }


/* ----------------------------------------------------------
   MAGNETIC BUTTONS
   ---------------------------------------------------------- */
.mag-btn {
  transition: transform 0.35s ease, background 0.2s, color 0.2s;
  position: relative;
  overflow: hidden;
}
.mag-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: skewX(-20deg);
  transition: left 0s;
}
.mag-btn:hover::after {
  left: 150%;
  transition: left 0.5s ease;
}


/* ----------------------------------------------------------
   CITRUS SPARK PARTICLES
   ---------------------------------------------------------- */
.citrus-spark {
  position: fixed;
  width: 4px; height: 4px;
  background: #d4f53c;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  animation: spark-burst 0.5s ease-out forwards;
}
@keyframes spark-burst {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}


/* ----------------------------------------------------------
   NOISE GRAIN OVERLAY
   ---------------------------------------------------------- */
#noise-overlay {
  position: fixed;
  inset: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  image-rendering: pixelated;
}


/* ----------------------------------------------------------
   PROJECT CARD — citrus border draw
   ---------------------------------------------------------- */
.project-card { position: relative; }
.project-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 3px;
  background: #d4f53c;
  transition: width 0.4s ease;
}
.project-card:hover::after { width: 100%; }


/* ----------------------------------------------------------
   SECTION DIVIDER
   ---------------------------------------------------------- */
.puyb-divider {
  width: 0; height: 2px;
  background: linear-gradient(90deg, #d4f53c, transparent);
  transition: width 1s ease;
}
.puyb-divider.puyb-visible { width: 100%; }


/* ----------------------------------------------------------
   SCANLINES (hero overlay)
   ---------------------------------------------------------- */
.scanlines {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 3px,
    rgba(0,0,0,0.06) 3px, rgba(0,0,0,0.06) 4px
  );
}


/* ----------------------------------------------------------
   LOGO GLITCH
   ---------------------------------------------------------- */
.logo-glitch { position: relative; display: inline-block; }
.logo-glitch::before, .logo-glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  opacity: 0;
}
.logo-glitch::before { color: #d4f53c; clip-path: polygon(0 25%, 100% 25%, 100% 45%, 0 45%); }
.logo-glitch::after  { color: #4affd4; clip-path: polygon(0 60%, 100% 60%, 100% 78%, 0 78%); }
.logo-glitch:hover::before, .logo-glitch:hover::after {
  opacity: 1;
  animation: glitch-shift 0.12s steps(2) infinite;
}
@keyframes glitch-shift {
  0%   { transform: translate(-2px, 0); }
  50%  { transform: translate(2px, 0); }
  100% { transform: translate(-1px, 0); }
}


/* ----------------------------------------------------------
   GHOST TEXT DRIFT
   ---------------------------------------------------------- */
.puyb-ghost-text {
  animation: ghost-drift 14s ease-in-out infinite alternate;
}
@keyframes ghost-drift {
  from { transform: translateX(0) rotate(0deg); }
  to   { transform: translateX(-3%) rotate(-0.8deg); }
}


/* ----------------------------------------------------------
   TEXT GLOW
   ---------------------------------------------------------- */
.text-glow { text-shadow: 0 0 20px rgba(212, 245, 60, 0.4); }


/* ----------------------------------------------------------
   IMAGE TRANSITIONS
   ---------------------------------------------------------- */
.img-grayscale {
  transition: filter 0.7s ease, transform 0.7s ease;
}


/* ----------------------------------------------------------
   SMOOTH SCROLL + SELECTION
   ---------------------------------------------------------- */
html { scroll-behavior: smooth; }
::selection { background: #d4f53c; color: #0f1a00; }
