/* =========================================================
   EFFECTS.CSS
   Shared across index.html, projects.html, blogs.html:
   - custom cursor (dot + trailing ring)
   - ambient firefly background
   - contact "Submit" button restyle
   All rules are namespaced/scoped so nothing here overrides
   existing site styles.
   ========================================================= */

/* ---------- Custom cursor ----------
   A colored version of the normal arrow pointer, done in pure CSS
   (SVG data-URI) so it works on every page with zero JS dependency —
   no class needs to be added by a script for this to render. */
html {
  cursor:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='22'%20height='22'%20viewBox='0%200%2022%2022'%3E%3Cpath%20d='M2%201%20L2%2017.5%20L6.2%2013.6%20L9%2019.6%20L12%2018.2%20L9.2%2012.2%20L15.5%2012%20Z'%20fill='%233fc7ff'%20stroke='%2305070c'%20stroke-width='1.3'%20stroke-linejoin='round'/%3E%3C/svg%3E")
    2 1, auto;
}

a, button, .btn, .nav-link, .nav-toggle, .nav-actions, .filter-chip, .side-nav-btn,
.scroll-top, .page-btn, .share-btn, .sort-btn, .menu-toggle, .whatsapp-float,
[role="button"], [onclick], label, select, summary,
input[type="checkbox"], input[type="radio"], input[type="submit"] {
  cursor:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='22'%20height='22'%20viewBox='0%200%2022%2022'%3E%3Cpath%20d='M2%201%20L2%2017.5%20L6.2%2013.6%20L9%2019.6%20L12%2018.2%20L9.2%2012.2%20L15.5%2012%20Z'%20fill='%236c7bff'%20stroke='%2305070c'%20stroke-width='1.3'%20stroke-linejoin='round'/%3E%3C/svg%3E")
    2 1, pointer;
}

/* Never override the native cursor on touch/coarse-pointer devices */
@media (hover: none), (pointer: coarse) {
  html,
  a, button, .btn, .nav-link, .nav-toggle, .nav-actions, .filter-chip, .side-nav-btn,
  .scroll-top, .page-btn, .share-btn, .sort-btn, .menu-toggle, .whatsapp-float,
  [role="button"], [onclick], label, select, summary,
  input[type="checkbox"], input[type="radio"], input[type="submit"] {
    cursor: auto !important;
  }
}

/* ---------- Ambient fireflies ---------- */
.firefly-layer {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.firefly {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 0.3vw;
  height: 0.3vw;
  min-width: 3px;
  min-height: 3px;
  margin: -0.15vw 0 0 9.8vw;
  z-index: 3;
  pointer-events: none;
  animation-timing-function: ease;
  animation-direction: alternate;
  animation-iteration-count: infinite;
}

.firefly::before,
.firefly::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform-origin: -10vw;
}

.firefly::before {
  background: var(--accent-2, #6c7bff);
  opacity: .25;
  animation: firefly-orbit ease alternate infinite;
  animation-duration: var(--rotation-speed, 18s);
}

.firefly::after {
  background: var(--accent, #3fc7ff);
  opacity: 0;
  box-shadow: 0 0 0vw 0vw var(--accent-glow, rgba(63, 199, 255, .6));
  animation:
    firefly-orbit ease alternate infinite,
    firefly-flash ease infinite;
  animation-duration: var(--rotation-speed, 18s), var(--flash-duration, 8000ms);
  animation-delay: 0ms, var(--flash-delay, 2000ms);
}

@keyframes firefly-orbit {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes firefly-flash {
  0%, 30%, 100% {
    opacity: 0;
    box-shadow: 0 0 0vw 0vw var(--accent-glow, rgba(63, 199, 255, .6));
  }
  5% {
    opacity: .5;
    box-shadow: 0 0 1.1vw 0.25vw var(--accent-glow, rgba(63, 199, 255, .6));
  }
}

@media (prefers-reduced-motion: reduce) {
  .firefly-layer { display: none; }
}

@media (max-width: 560px) {
  .firefly { width: 0.45vw; height: 0.45vw; min-width: 3px; min-height: 3px; }
}

/* ---------- Contact "Submit" button ---------- */
.btn-primary.btn-block {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: 15px;
  border: 2px solid var(--accent, #3fc7ff);
  background: transparent;
  color: var(--accent, #3fc7ff);
  font-weight: 600;
  overflow: hidden;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease, transform .15s ease;
}

.btn-primary.btn-block .btn-check-icon {
  display: inline-flex;
  align-items: center;
  transition: transform .2s ease;
}

.btn-primary.btn-block:hover {
  background: var(--accent-soft, rgba(63, 199, 255, .1));
  box-shadow: 0 10px 28px -10px var(--accent-glow, rgba(63, 199, 255, .5));
}

.btn-primary.btn-block:hover .btn-check-icon {
  transform: translateX(2px) scale(1.08);
}

.btn-primary.btn-block:active {
  transform: scale(.97);
}