/* Custom styles - complemento a Tailwind */

/* Particles Canvas */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Navbar backdrop */
.navbar-blur {
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

/* Fix Chrome compositing bug: overflow:hidden + border-radius + transition
   causa mancata pittura dell'immagine finché non scatta un repaint */
.screenshot-grid img {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Scrollbar hide for screenshots */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Custom select arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a1a1a6' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

/* Screen reader only (visually hidden, accessible to crawlers/AT) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Honeypot */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

/* ============================================
   Animated Gradient Border on Cards
   ============================================ */
.glow-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: saturate(120%) blur(16px);
  backdrop-filter: saturate(120%) blur(16px);
}

.glow-card::before {
  content: "";
  position: absolute;
  pointer-events: none;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from var(--glow-angle, 0deg),
      transparent 30%,
      var(--glow-color, rgba(41, 151, 255, 0.6)) 50%,
      transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: rotateGlow 4s linear infinite;
}

.glow-card:hover::before {
  opacity: 1;
}

@keyframes rotateGlow {
  from {
    --glow-angle: 0deg;
  }

  to {
    --glow-angle: 360deg;
  }
}

@property --glow-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* Card glow shadow + glass hover */
.glow-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow:
    0 0 25px 0px var(--glow-color, rgba(41, 151, 255, 0.3)),
    0 0 50px -5px var(--glow-color, rgba(41, 151, 255, 0.2)),
    0 0 80px -10px var(--glow-color, rgba(41, 151, 255, 0.1));
}

/* ============================================
   Icon Pulse Glow
   ============================================ */
.icon-glow {
  animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {

  0%,
  100% {
    box-shadow: 0 0 20px -5px var(--glow-color, rgba(41, 151, 255, 0.3));
  }

  50% {
    box-shadow: 0 0 35px -2px var(--glow-color, rgba(41, 151, 255, 0.5));
  }
}

/* ============================================
   Animated Gradient Text for Hero
   ============================================ */
.gradient-text-animated {
  background: linear-gradient(90deg,
      #f5f5f7 0%,
      #2997ff 25%,
      #6c5ce7 50%,
      #00d2b4 75%,
      #f5f5f7 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 8s ease-in-out infinite;
  line-height: 1.3;
  padding-bottom: 0.05em;
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* ============================================
   Filter Pills
   ============================================ */
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(245, 245, 247, 0.5);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease;
  white-space: nowrap;
}

.filter-pill:hover {
  color: rgba(245, 245, 247, 0.85);
}

.filter-pill.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(245, 245, 247, 0.5);
}

.filter-pill.active .filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Light mode pills */
[data-theme="light"] .filter-pill {
  color: rgba(29, 29, 31, 0.45);
}

[data-theme="light"] .filter-pill:hover {
  color: rgba(29, 29, 31, 0.75);
}

[data-theme="light"] .filter-pill.active {
  color: #fff;
  background: #1d1d1f;
}

[data-theme="light"] .filter-count {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(29, 29, 31, 0.5);
}

[data-theme="light"] .filter-pill.active .filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ============================================
   Category Badges on cards
   ============================================ */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  margin-top: 0.25rem;
  white-space: nowrap;
}

.cat-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.cat-macos   { background: rgba(99, 102, 241, 0.15); color: rgba(165, 163, 255, 0.9); }
.cat-ios     { background: rgba(6, 182, 212, 0.15);  color: rgba(103, 218, 243, 0.9); }
.cat-android { background: rgba(34, 197, 94, 0.15);  color: rgba(74, 222, 128, 0.9); }
.cat-web     { background: rgba(59, 130, 246, 0.15); color: rgba(119, 175, 255, 0.9); }
.cat-strumenti { background: rgba(139, 92, 246, 0.15); color: rgba(183, 152, 255, 0.9); }

[data-theme="light"] .cat-macos   { background: rgba(99, 102, 241, 0.10); color: rgba(67, 56, 202, 0.85); }
[data-theme="light"] .cat-ios     { background: rgba(6, 182, 212, 0.10);  color: rgba(14, 116, 144, 0.85); }
[data-theme="light"] .cat-android { background: rgba(34, 197, 94, 0.10);  color: rgba(21, 128, 61, 0.85); }
[data-theme="light"] .cat-web     { background: rgba(59, 130, 246, 0.10); color: rgba(29, 78, 216, 0.85); }
[data-theme="light"] .cat-strumenti { background: rgba(139, 92, 246, 0.10); color: rgba(109, 40, 217, 0.85); }

/* ============================================
   "PRESTO" badge
   ============================================ */
.badge-presto {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: rgba(34, 197, 94, 0.20);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.30);
}

[data-theme="light"] .badge-presto {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.25);
}

/* ============================================
   Compact app card grid (index)
   ============================================ */
.apps-grid-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

#apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  #apps-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  #apps-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Card layout */
.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.2rem;
}

.app-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.app-card-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 12px;
  padding: 1px;
  transition: transform 0.3s ease;
}

.app-card:hover .app-card-icon {
  transform: scale(1.1);
}

.app-card-icon > div {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
}

.app-card-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-card-icon svg {
  display: block;
}

.app-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.app-card-desc {
  font-size: 0.75rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  flex: 1;
}

.app-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  margin-top: auto;
}

.app-card-link {
  transition: color 0.2s ease;
}

.app-card:hover .app-card-link {
  color: rgba(245, 245, 247, 0.9);
}

[data-theme="light"] .app-card:hover .app-card-link {
  color: #1d1d1f;
}

/* Filter bar layout */
.filter-bar {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.25rem 0;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

@media (min-width: 640px) {
  .filter-bar {
    justify-content: center;
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 0.5rem;
  }
}

/* Mobile: icon-only pills (hide label, keep icon + count) */
@media (max-width: 639px) {
  .pill-label {
    display: none;
  }
  .filter-pill {
    padding: 0.5rem 0.55rem;
    gap: 0.25rem;
  }
  .filter-pill[data-filter="all"] {
    padding: 0.5rem 0.75rem;
  }
  .filter-pill svg.pill-icon {
    width: 20px;
    height: 20px;
    margin-right: 0;
  }
  .filter-count {
    font-size: 0.6rem;
    min-width: 1.1rem;
    height: 1.1rem;
  }
}

.filter-pill svg.pill-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
}

/* Mobile card tweaks */
@media (max-width: 639px) {
  .apps-grid-wrap {
    padding: 0 1rem;
  }
  #apps-grid {
    gap: 0.75rem;
  }
  .app-card {
    padding: 0.9rem 1rem;
  }
}

/* Card filter hide */
.app-card.filter-hidden {
  display: none;
}

/* ============================================
   Feature card subtle hover lift
   ============================================ */
.feature-hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: saturate(120%) blur(16px);
  backdrop-filter: saturate(120%) blur(16px);
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.feature-hover:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Footer copyright shimmer
   ============================================ */
.footer-shimmer {
  background: linear-gradient(90deg,
      #a1a1a6 0%,
      #2997ff 25%,
      #6c5ce7 50%,
      #00d2b4 75%,
      #a1a1a6 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {

  0%,
  100% {
    background-position: 100% 50%;
  }

  50% {
    background-position: 0% 50%;
  }
}

/* Safe area for notch devices */
@supports (padding-top: env(safe-area-inset-top)) {
  .safe-top {
    padding-top: env(safe-area-inset-top);
  }

  .safe-bottom {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Standalone PWA: push content below navbar + safe area */
@media (display-mode: standalone) {
  @supports (padding-top: env(safe-area-inset-top)) {
    body {
      padding-top: env(safe-area-inset-top);
    }
  }
}

/* ============================================
   Theme icons visibility
   ============================================ */
[data-theme="dark"] .theme-icon-light {
  display: none;
}

[data-theme="light"] .theme-icon-dark {
  display: none;
}

/* ============================================
   Smooth theme transitions
   ============================================ */
body,
nav,
#mobile-menu,
.glow-card,
.filter-pill,
.cat-badge,
.badge-presto,
footer,
.gradient-text-animated,
.footer-shimmer {
  transition-property: background-color, border-color, color, box-shadow;
  transition-duration: 0.35s;
  transition-timing-function: ease;
}

/* ============================================
   Light Mode — canvas blend
   ============================================ */
[data-theme="light"] #particles-canvas {
  mix-blend-mode: multiply;
}

/* ============================================
   Light Mode — structure
   ============================================ */
[data-theme="light"] body {
  background-color: #f0f0f5 !important;
  color: #1d1d1f !important;
}

[data-theme="light"] nav {
  background-color: rgba(240, 240, 245, 0.80) !important;
  border-bottom-color: rgba(0, 0, 0, 0.10) !important;
}

[data-theme="light"] #mobile-menu {
  background-color: rgba(245, 245, 247, 0.98) !important;
  border-bottom-color: rgba(0, 0, 0, 0.10) !important;
}

[data-theme="light"] footer {
  border-top-color: rgba(0, 0, 0, 0.10) !important;
}

/* ============================================
   Light Mode — typography
   ============================================ */
[data-theme="light"] .text-noir-50,
[data-theme="light"] a.text-noir-50 {
  color: #1d1d1f !important;
}

[data-theme="light"] .text-noir-100,
[data-theme="light"] a.text-noir-100 {
  color: #3d3d3f !important;
}

[data-theme="light"] .text-noir-200 {
  color: #6e6e73 !important;
}

[data-theme="light"] .hover\:text-noir-50:hover,
[data-theme="light"] .hover\:text-white:hover {
  color: #000000 !important;
}

/* ============================================
   Light Mode — borders
   ============================================ */
[data-theme="light"] .border-noir-400 {
  border-color: rgba(0, 0, 0, 0.10) !important;
}

/* ============================================
   Light Mode — cards
   ============================================ */
[data-theme="light"] .glow-card {
  background: rgba(255, 255, 255, 0.65) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .glow-card:hover {
  background: rgba(255, 255, 255, 0.90) !important;
  border-color: rgba(0, 0, 0, 0.13) !important;
  /* Ripristina il glow colorato hover (batte la regola base con !important) */
  box-shadow:
    0 0 30px 2px var(--glow-color, rgba(41, 151, 255, 0.35)),
    0 0 60px -5px var(--glow-color, rgba(41, 151, 255, 0.20)),
    0 0 90px -10px var(--glow-color, rgba(41, 151, 255, 0.12)) !important;
}

/* Bordo conic-gradient: aumenta saturazione e scurisce
   per renderlo visibile su sfondo chiaro */
[data-theme="light"] .glow-card:hover::before {
  filter: saturate(5) brightness(0.55);
}

/* ============================================
   Light Mode — hero gradient (swap white → dark)
   ============================================ */
[data-theme="light"] .gradient-text-animated {
  background: linear-gradient(90deg,
      #1d1d1f 0%,
      #2997ff 25%,
      #6c5ce7 50%,
      #00d2b4 75%,
      #1d1d1f 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================
   Light Mode — footer shimmer (swap white → gray)
   ============================================ */
[data-theme="light"] .footer-shimmer {
  background: linear-gradient(90deg,
      #6e6e73 0%,
      #2997ff 25%,
      #6c5ce7 50%,
      #00d2b4 75%,
      #6e6e73 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================
   Light Mode — theme toggle button
   ============================================ */
[data-theme="light"] #theme-toggle {
  color: #3d3d3f;
}

[data-theme="light"] #theme-toggle:hover {
  background-color: rgba(0, 0, 0, 0.06) !important;
  color: #1d1d1f;
}

/* ============================================
   Light Mode — secondary buttons (bg-noir-500 ghost style)
   ============================================ */
[data-theme="light"] .bg-noir-500 {
  background-color: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .hover\:bg-noir-500\/80:hover {
  background-color: rgba(0, 0, 0, 0.10) !important;
}

[data-theme="light"] .hover\:border-noir-300:hover {
  border-color: rgba(0, 0, 0, 0.20) !important;
}

/* ============================================
   Light Mode — hamburger icon lines
   ============================================ */
[data-theme="light"] #menu-toggle div {
  background-color: #1d1d1f !important;
}

/* ============================================
   Back-to-top button
   ============================================ */
#back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.5rem;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(245, 245, 247, 0.80);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.30s ease, transform 0.30s ease,
    background-color 0.25s ease, color 0.25s ease;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#back-to-top:hover {
  background: rgba(255, 255, 255, 0.20);
  color: #f5f5f7;
  transform: translateY(-2px) scale(1.05);
}

#back-to-top:active {
  transform: translateY(0) scale(0.95);
}

/* Light mode */
[data-theme="light"] #back-to-top {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.10);
  color: rgba(29, 29, 31, 0.70);
}

[data-theme="light"] #back-to-top:hover {
  background: rgba(0, 0, 0, 0.12);
  color: #1d1d1f;
}


/* ============================================
   Scroll-triggered entrance animations
   ============================================ */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
}

/* Transition fires ONLY during the animate-in.
   Once .is-visible is set, :not(.is-visible) no longer matches,
   so the element's own transition-all duration-300 handles hover. */
[data-animate]:not(.is-visible) {
  transition: opacity 0.60s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.60s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-animate][data-delay="1"] {
  transition-delay: 0.08s;
}

[data-animate][data-delay="2"] {
  transition-delay: 0.16s;
}

[data-animate][data-delay="3"] {
  transition-delay: 0.24s;
}

[data-animate][data-delay="4"] {
  transition-delay: 0.32s;
}

[data-animate][data-delay="5"] {
  transition-delay: 0.40s;
}

/* Auto-animated elements added via JS */
.scroll-anim {
  opacity: 0;
  transform: translateY(20px);
}

.scroll-anim:not(.is-visible) {
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-anim.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {

  [data-animate],
  .scroll-anim {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}


/* ============================================
   Light Mode — screenshot placeholder containers
   ============================================ */
[data-theme="light"] .bg-noir-500\/40 {
  background-color: rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .border-white\/10 {
  border-color: rgba(0, 0, 0, 0.10) !important;
}

/* ============================================
   Custom Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  border: 3px solid #000;
  /* Creates padding around the thumb */
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Light mode scrollbar */
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border: 3px solid #fff;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* ============================================
   Mobile menu slide-down animation
   ============================================ */
#mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-bottom-width: 0 !important;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease;
}

#mobile-menu.is-open {
  max-height: 400px;
  padding-top: 1.25rem !important;
  /* py-5 equiv. */
  padding-bottom: 1.25rem !important;
  border-bottom-width: 1px !important;
  opacity: 1;
  pointer-events: auto;
  z-index: 49;
  overscroll-behavior: contain;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

[data-theme="light"] #mobile-menu {
  background: rgba(248, 248, 248, 0.97) !important;
}

/* ============================================
   Focus ring (keyboard accessibility)
   ============================================ */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.70);
  outline-offset: 3px;
  border-radius: 6px;
}

[data-theme="light"] :focus-visible {
  outline-color: rgba(29, 29, 31, 0.50);
}

/* ============================================
   Plasma Download Button
   ============================================ */
@property --plasma-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.btn-plasma {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: transparent;
  border: none;
  padding: 0;
}

/* Rotating plasma gradient background */
.btn-plasma::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: conic-gradient(from var(--plasma-angle),
      #009246,
      #33aa66,
      #ffffff,
      #ff6e7a,
      #CE2B37,
      #ff6e7a,
      #ffffff,
      #33aa66,
      #009246);
  animation: plasmaRotate 3s linear infinite;
  z-index: -2;
}

/* Inner background layer (masks the outer ring to keep the button readable) */
.btn-plasma::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(135deg, #007a38 0%, #005c2a 100%);
  z-index: -1;
}

/* Floating blob for extra plasma turbulence */
.btn-plasma .plasma-blob {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 60% 50% at var(--bx, 30%) var(--by, 40%),
      rgba(255, 255, 255, 0.35) 0%,
      transparent 70%);
  animation: plasmaBlob 4s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

/* Outer glow pulse */
.btn-plasma {
  box-shadow:
    0 0 18px 2px rgba(0, 146, 70, 0.65),
    0 0 40px 4px rgba(206, 43, 55, 0.30),
    0 0 70px 8px rgba(255, 255, 255, 0.10);
  animation: plasmaGlow 3s ease-in-out infinite;
}

.btn-plasma:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 0 24px 4px rgba(0, 146, 70, 0.85),
    0 0 55px 8px rgba(206, 43, 55, 0.50),
    0 0 90px 14px rgba(255, 255, 255, 0.15);
}

@keyframes plasmaRotate {
  to {
    --plasma-angle: 360deg;
  }
}

@keyframes plasmaBlob {
  0% {
    --bx: 20%;
    --by: 30%;
  }

  25% {
    --bx: 70%;
    --by: 20%;
  }

  50% {
    --bx: 80%;
    --by: 70%;
  }

  75% {
    --bx: 30%;
    --by: 80%;
  }

  100% {
    --bx: 20%;
    --by: 30%;
  }
}

@keyframes plasmaGlow {

  0%,
  100% {
    box-shadow:
      0 0 18px 2px rgba(0, 146, 70, 0.65),
      0 0 40px 4px rgba(206, 43, 55, 0.25),
      0 0 70px 8px rgba(255, 255, 255, 0.08);
  }

  50% {
    box-shadow:
      0 0 26px 6px rgba(206, 43, 55, 0.65),
      0 0 55px 10px rgba(0, 146, 70, 0.30),
      0 0 90px 16px rgba(255, 255, 255, 0.10);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-plasma::before {
    animation: none;
  }

  .btn-plasma .plasma-blob {
    animation: none;
  }

  .btn-plasma {
    animation: none;
  }
}

/* Light mode: increase contrast of the inner bg */
[data-theme="light"] .btn-plasma::after {
  background: linear-gradient(135deg, #006633 0%, #004d26 100%);
}

/* ============================================
   Page transition
   ============================================ */
@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  body {
    animation: pageFadeIn 0.35s ease-out both;
  }
}

body.page-exit {
  animation: none !important;
  opacity: 0 !important;
  transform: translateY(-8px) !important;
  transition: opacity 0.22s ease, transform 0.22s ease !important;
}

/* ============================================
   PulseX — green accent utilities
   (missing from pre-built Tailwind)
   ============================================ */
.text-green-500 { color: #22c55e; }
.text-green-400 { color: #4ade80; }
.hover\:text-green-400:hover { color: #4ade80; }
.bg-green-600 { background-color: #16a34a; }
.hover\:bg-green-700:hover { background-color: #15803d; }
.focus\:border-green-500:focus { border-color: #22c55e; }
.accent-green-500 { accent-color: #22c55e; }

/* Green button: keep white text in both themes */
.bg-green-600 .text-white,
.bg-green-600.text-white { color: #fff !important; }

/* Light mode overrides for green accent */
[data-theme="light"] .text-green-500 { color: #16a34a; }
[data-theme="light"] .hover\:text-green-400:hover { color: #15803d; }

/* Form inputs light mode (PulseX support page) */
[data-theme="light"] .bg-white\/5 {
  background-color: rgba(0, 0, 0, 0.03) !important;
}
[data-theme="light"] .border-white\/10 {
  border-color: rgba(0, 0, 0, 0.12) !important;
}
[data-theme="light"] .placeholder\:text-noir-200::placeholder {
  color: #6e6e73 !important;
}