/* Refinements & Micro-Interactions for TapHoaTool */
@layer utilities {
  .glow-orange {
    box-shadow: 0 0 30px -5px rgba(255, 107, 44, 0.25);
  }
  .glow-violet {
    box-shadow: 0 0 30px -5px rgba(139, 92, 246, 0.25);
  }
  .glow-emerald {
    box-shadow: 0 0 20px -3px rgba(52, 211, 153, 0.25);
  }
}

/* Animations */
@keyframes star-movement-bottom {
  0% { transform: translate(-30%, 0); }
  50% { transform: translate(-60%, 0); }
  100% { transform: translate(-30%, 0); }
}

@keyframes star-movement-top {
  0% { transform: translate(0%, 0); }
  50% { transform: translate(-30%, 0); }
  100% { transform: translate(0%, 0); }
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes pulse-subtle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.97); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-float {
  animation: float-slow 6s ease-in-out infinite;
}

.animate-pulse-subtle {
  animation: pulse-subtle 3s ease-in-out infinite;
}

/* Shimmer gradient effect */
.shimmer-text {
  background: linear-gradient(90deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,0.7) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 4s infinite linear;
}

/* Gradient Star Button */
.gradient-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 9999px;
  padding: 1.5px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gradient-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -5px rgba(255, 107, 44, 0.3);
}

.gradient-btn .bar-bottom {
  position: absolute;
  width: 300%;
  height: 50%;
  opacity: 0.75;
  bottom: -10px;
  right: -250%;
  border-radius: 9999px;
  background: radial-gradient(circle, #ff6b2c 10%, transparent 60%);
  animation: star-movement-bottom 4s linear infinite;
  pointer-events: none;
}

.gradient-btn .bar-top {
  position: absolute;
  width: 300%;
  height: 50%;
  opacity: 0.75;
  top: -10px;
  left: -250%;
  border-radius: 9999px;
  background: radial-gradient(circle, #ffb056 10%, transparent 60%);
  animation: star-movement-top 4s linear infinite;
  pointer-events: none;
}

/* Interactive Card Hover */
.glass-card {
  position: relative;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
}

/* Code switch tabs */
.tab-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Accordion Smooth Expand */
.accordion-content {
  display: grid;
  transition: grid-template-rows 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.accordion-content.expanded {
  grid-template-rows: 1fr;
  opacity: 1;
}

.accordion-content.collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
}

.accordion-inner {
  overflow: hidden;
}

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

::-webkit-scrollbar-track {
  background: rgba(6, 6, 8, 0.8);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

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

/* Active Nav Pill */
.nav-link {
  position: relative;
  transition: color 0.2s ease;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #ffb056, #ff6b2c);
}

/* Shared nav: content-sized items; active pill is paint-only so the box never reflows.
   Keep these rules byte-equivalent with the inlined copy in
   scripts/build/build_all_subpages.js (getCommonHead). /software/ does not
   link this file; change both or the navbar will diverge. */
#main-nav .nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  white-space: nowrap;
  background-color: transparent;
  transition: color 0.15s ease, background-color 0.2s ease-in;
}
#main-nav .nav-item.is-active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}
@starting-style {
  #main-nav .nav-item.is-active {
    background-color: transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  #main-nav .nav-item {
    transition: color 0.15s ease;
  }
}

/* Aurora: source uses absolute inset-0. height:100% on a min-h parent paints 0. */
#aurora-bg,
.aurora-fade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  pointer-events: none;
}
#aurora-bg {
  z-index: 0;
  opacity: 0.7;
}
#aurora-bg canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.aurora-fade { z-index: 1; }

/* Pu proximity sidebar (docs API Reference) */
.pu-nav {
  --accent-color: #ff8a4c;
  --text-color: #a1a1aa;
  --marker-color: #ff6b2c;
  --marker-length: 60px;
  --marker-gap: 0px;
  --tick-scale: 0.5;
  --max-shift: 30px;
  --item-gap: 14px;
  --font-size: 0.95rem;
  position: relative;
  display: flex;
  justify-content: flex-start;
  padding-left: calc(var(--marker-length) + var(--marker-gap));
}
.pu-list {
  margin: 0;
  padding: 1rem 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--item-gap);
}
.pu-item {
  position: relative;
  cursor: pointer;
}
.pu-item::after {
  content: '';
  position: absolute;
  left: calc(-1 * var(--marker-length) - var(--marker-gap));
  top: calc(100% + var(--item-gap) / 2);
  height: 1px;
  width: calc(var(--marker-length) * var(--tick-scale));
  opacity: 0.5;
  background-color: var(--marker-color);
  transform: translateY(-50%) scaleX(calc(0.7 + var(--effect, 0) * 0.6));
  transform-origin: left center;
}
.pu-item:last-child::after { content: none; }
.pu-label {
  display: inline-flex;
  align-items: baseline;
  line-height: 1.2;
  font-size: var(--font-size);
  color: color-mix(in srgb, var(--accent-color) calc(var(--effect, 0) * 100%), var(--text-color));
  transform: translateX(calc(var(--effect, 0) * var(--max-shift)));
  will-change: transform, color;
}
.pu-index {
  margin-right: 0.6rem;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 0.85em;
  opacity: calc(0.55 + var(--effect, 0) * 0.45);
}

