/* ==========================================================================
   ✨ OFFICIAL ANIMATA COMPONENT LIBRARY (animata.design/components)
   Zero-dependency, 60+ FPS, Hardware-Accelerated Micro-Interactions & Bento Grids
   Compliant with Design.md & AGENTS.md (180ms-240ms, radii <=10px or 9999px)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Universal 2-Layer Header Architecture
   Layer 1: System Information (34px)
   Layer 2: Primary Navigation & Information Details Popovers (64px)
   -------------------------------------------------------------------------- */
.top-navbar-wrapper {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(8, 9, 13, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 200ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.top-navbar-wrapper.is-scrolled {
  background: rgba(8, 9, 13, 0.96);
  border-bottom-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7);
}

/* Layer 1: Information Layer */
.top-info-layer {
  height: 34px;
  background: rgba(15, 20, 32, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.info-layer-inner {
  max-width: min(94vw, 1540px);
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(1rem, 2vw, 1.8rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.info-left-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  overflow: hidden;
  white-space: nowrap;
}

.info-right-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.info-chip a {
  color: #38bdf8;
  text-decoration: none;
  transition: color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.info-chip a:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
  animation: pulse-dot 2s infinite cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.info-ticker-marquee {
  display: inline-flex;
  overflow: hidden;
  max-width: 600px;
  mask-image: linear-gradient(to right, transparent, black 15px, black calc(100% - 15px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 15px, black calc(100% - 15px), transparent);
}

.ticker-text {
  display: inline-block;
  white-space: nowrap;
  animation: marquee-scroll 24s linear infinite;
  color: rgba(255, 255, 255, 0.65);
  will-change: transform;
  transform: translateZ(0);
}

@keyframes marquee-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Layer 2: Main Navigation */
.top-navbar-wrapper .top-navbar {
  position: relative;
  height: 64px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
}

/* Information Details Popovers on Navigation Items */
.nav-item-dropdown {
  position: relative;
}

.nav-info-card {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: 320px;
  background: rgba(14, 18, 30, 0.95);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-smooth, 8px);
  padding: 1.1rem;
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.75), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 200ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
              visibility 200ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1010;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.nav-item-dropdown:hover .nav-info-card,
.nav-item-dropdown:focus-within .nav-info-card {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.info-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.info-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.info-card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
}

.badge-cyan { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-indigo { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-violet { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }

.info-card-desc {
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.68);
  margin: 0;
}

.info-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.info-tag {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm, 4px);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.info-card-footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.2rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.info-action-btn {
  flex: 1;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-md, 6px);
  text-decoration: none;
  cursor: pointer;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
              background-color 200ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
}

.info-action-btn:active {
  transform: scale(0.96);
}

.info-action-btn.primary {
  background: rgba(99, 102, 241, 0.85);
  color: #ffffff;
  border-color: rgba(129, 140, 248, 0.4);
}

.info-action-btn.primary:hover {
  background: rgba(99, 102, 241, 1);
}

.info-action-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
}

.info-action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Nav More Dropdown */
.nav-more-card {
  width: 250px;
}

.nav-sublink {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border-radius: var(--radius-sm, 4px);
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1),
              color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-sublink:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   2. Animata Text Animations
   -------------------------------------------------------------------------- */
.animated-gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #38bdf8 50%, #818cf8 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-text-shift 6s ease infinite alternate;
}

@keyframes gradient-text-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.shimmer-sweep {
  position: relative;
  overflow: hidden;
}

.shimmer-sweep::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: sweep-glide 3.5s infinite;
  pointer-events: none;
  will-change: transform;
}

@keyframes sweep-glide {
  0% { transform: translateX(-150%); }
  40%, 100% { transform: translateX(250%); }
}

.hero-text-hover {
  transition: color 200ms cubic-bezier(0.16, 1, 0.3, 1),
              text-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-text-hover:hover {
  text-shadow: 0 0 24px rgba(56, 189, 248, 0.6);
}

/* --------------------------------------------------------------------------
   3. Animata 3D Tilt Card & Skew Cards
   -------------------------------------------------------------------------- */
.tilt-card {
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.tilt-card-inner {
  transform-style: preserve-3d;
  border-radius: var(--radius-smooth, 8px);
  background: rgba(18, 24, 38, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.75rem;
}

.github-card-shiny {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-smooth, 8px);
  background: rgba(20, 26, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.github-card-shiny:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.2);
}

.announcement-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.95rem;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-size: 0.82rem;
  color: #7dd3fc;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.announcement-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
}

/* --------------------------------------------------------------------------
   4. Animata Bento Grid 3 & 8 Variants
   -------------------------------------------------------------------------- */
.bento-grid-three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
  width: 100%;
}

@media (max-width: 900px) {
  .bento-grid-three {
    grid-template-columns: 1fr;
  }
}

.bento-grid-eight {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
  width: 100%;
}

.bento-span-2 { grid-column: span 2; }
.bento-span-3 { grid-column: span 3; }
.bento-span-4 { grid-column: span 4; }

@media (max-width: 1024px) {
  .bento-grid-eight {
    grid-template-columns: repeat(2, 1fr);
  }
  .bento-span-3, .bento-span-4 {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .bento-grid-eight {
    grid-template-columns: 1fr;
  }
  .bento-span-2, .bento-span-3, .bento-span-4 {
    grid-column: span 1;
  }
}

/* --------------------------------------------------------------------------
   5. Performance Charts & Gauge Widgets
   -------------------------------------------------------------------------- */
.gauge-chart-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(18, 24, 38, 0.7);
  border-radius: var(--radius-smooth, 8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gauge-svg-wrapper {
  position: relative;
  width: 160px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-val-display {
  position: absolute;
  bottom: 5px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.bar-chart-card {
  background: rgba(18, 24, 38, 0.7);
  border-radius: var(--radius-smooth, 8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem;
}

.bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.bar-track {
  height: 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-fill-quantum {
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.bar-fill-standard {
  background: rgba(255, 255, 255, 0.3);
}

.counter-stat-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.counter-number {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}

.counter-unit {
  font-size: 1rem;
  color: #38bdf8;
  font-weight: 600;
}

.counter-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   6. Button Micro-Interactions (animata/button)
   -------------------------------------------------------------------------- */
.animata-btn-slide-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-smooth, 8px);
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 24px -6px rgba(99, 102, 241, 0.5);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1),
              background-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.animata-btn-slide-arrow:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -4px rgba(99, 102, 241, 0.65);
}

.animata-btn-slide-arrow:active {
  transform: scale(0.96);
}

.animata-btn-slide-arrow .btn-arrow-icon {
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.animata-btn-slide-arrow:hover .btn-arrow-icon {
  transform: translateX(4px);
}
