/* ========================================================
   AY ONLINE - PERFORMANCE ENGINE & RESPONSIVE STYLES
   ======================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  scroll-behavior: smooth;
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative;
  margin: 0;
  padding: 0;
  background-color: #0A2640;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Container safety to eliminate horizontal scrollbar */
main,
.main {
  overflow-x: hidden !important;
  max-width: 100% !important;
  width: 100% !important;
  position: relative;
}

section,
header,
footer,
.container-fluid {
  max-width: 100% !important;
  overflow-x: clip;
}

/* ========================================================
   GPU-ACCELERATED HERO & ANIMATIONS
   ======================================================== */
.hero-bg-container {
  overflow: hidden !important;
  contain: paint;
  position: relative;
  background: #0A2640;
  transform: translateZ(0); /* Promotes to dedicated GPU layer */
}

/* Digital Rain Canvas */
#cyberRainCanvas,
.cyber-rain-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Drifting Atmospheric Clouds */
.cloud-drifter {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  opacity: 0.35;
  z-index: 0;
  will-change: transform;
  transform: translateZ(0);
}
.cloud-1 {
  width: 550px;
  height: 400px;
  background: radial-gradient(circle, rgba(39, 188, 253, 0.4) 0%, rgba(10, 38, 64, 0) 70%);
  top: -10%;
  left: -10%;
  animation: driftCloud1 22s ease-in-out infinite alternate;
}
.cloud-2 {
  width: 650px;
  height: 450px;
  background: radial-gradient(circle, rgba(94, 220, 212, 0.35) 0%, rgba(10, 38, 64, 0) 70%);
  bottom: -15%;
  right: -10%;
  animation: driftCloud2 28s ease-in-out infinite alternate;
}
.cloud-3 {
  width: 400px;
  height: 350px;
  background: radial-gradient(circle, rgba(0, 210, 122, 0.2) 0%, rgba(10, 38, 64, 0) 70%);
  top: 40%;
  left: 45%;
  animation: driftCloud3 18s ease-in-out infinite alternate;
}

@keyframes driftCloud1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(120px, 60px) scale(1.15); }
  100% { transform: translate(40px, 110px) scale(0.95); }
}
@keyframes driftCloud2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-100px, -50px) scale(1.1); }
  100% { transform: translate(-40px, -90px) scale(0.9); }
}
@keyframes driftCloud3 {
  0% { transform: translate(0, 0) scale(0.9); opacity: 0.2; }
  50% { transform: translate(-60px, 40px) scale(1.2); opacity: 0.4; }
  100% { transform: translate(50px, -30px) scale(1); opacity: 0.25; }
}

.contact-section-container {
  overflow: hidden !important;
  contain: paint;
  position: relative;
  transform: translateZ(0);
}

/* Ensure interactive hero dashboard stays bounded */
.hero-dashboard-container {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  will-change: transform;
  transform: translateZ(0);
}

.tech-card {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 576px) {
  .cards-bottom-row {
    grid-template-columns: 1fr !important;
  }
  .tech-card {
    padding: 16px 14px !important;
  }
  .hero-dashboard-container {
    max-width: 100% !important;
  }
}

/* Stop AOS animation off-screen translations from widening the viewport */
[data-aos] {
  pointer-events: auto;
}
html.aos-animate,
body[data-aos-easing] {
  overflow-x: hidden !important;
}

/* ========================================================
   INSTANT CLICK & TOUCH PERFORMANCE
   ======================================================== */
/* Remove 300ms mobile touch delay and gray highlight */
a, button, input, select, textarea, .btn, .nav-link, .svc-card, .blog-card, .partner-logo-capsule {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Ultra-fast tactile feedback on clicks */
.btn:active,
button:active,
a.btn:active {
  transform: scale(0.97) !important;
  transition: transform 0.05s ease-out !important;
}

.nav-link:active {
  opacity: 0.75;
  transition: opacity 0.05s ease-out !important;
}

.svc-card:active,
.blog-card:active {
  transform: scale(0.99) !important;
  transition: transform 0.08s ease-out !important;
}

/* Fast image rendering and layout stabilization */
img {
  content-visibility: auto;
}

/* ========================================================
   360° ROTATING SERVICES PIECHART ECOSYSTEM
   ======================================================== */
.services-pie-section {
  position: relative;
  overflow: hidden;
  max-width: 100%;
}

.pie-showcase-card {
  background: radial-gradient(circle at 50% 50%, rgba(14, 38, 64, 0.95) 0%, #061524 100%);
  border: 1px solid rgba(94, 220, 212, 0.25);
  border-radius: 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  padding: 45px 30px;
  position: relative;
  overflow: hidden;
  contain: paint;
}

.pie-ambient-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 220, 212, 0.2) 0%, rgba(102, 16, 242, 0.15) 50%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  animation: pulseGlow 6s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.95; }
}

.pie-wheel-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.pie-svg-container {
  width: 100%;
  max-width: 500px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.5));
}

/* 360 Degree Continuous Rotation */
.pie-slices-spinner {
  transform-origin: 260px 260px;
  animation: spinPie360 14s linear infinite;
  will-change: transform;
}

/* Moving Cursor beside Pie Chart */
.pie-floating-cursor {
  position: absolute;
  top: 48%;
  right: -12px;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: cursorOrbitPatrol 6.5s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes cursorOrbitPatrol {
  0% { transform: translate(0px, -120px) rotate(-10deg); }
  25% { transform: translate(28px, -45px) rotate(6deg); }
  50% { transform: translate(12px, 35px) rotate(-4deg); }
  75% { transform: translate(-14px, 100px) rotate(-14deg); }
  100% { transform: translate(-30px, 145px) rotate(-8deg); }
}

.cursor-ripple {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(94, 220, 212, 0.45);
  animation: cursorRippleWave 1.8s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  pointer-events: none;
}

@keyframes cursorRippleWave {
  0% { transform: scale(0.6); opacity: 0.95; }
  100% { transform: scale(2.6); opacity: 0; }
}

.cursor-pointer-icon {
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
  position: relative;
  z-index: 2;
}

.cursor-tag-badge {
  background: rgba(10, 38, 64, 0.94);
  border: 1px solid rgba(94, 220, 212, 0.6);
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 700;
  color: #5EDCD4;
  letter-spacing: 0.6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 12px rgba(94, 220, 212, 0.35);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.cursor-live-dot {
  width: 7px;
  height: 7px;
  background-color: #5EDCD4;
  border-radius: 50%;
  box-shadow: 0 0 8px #5EDCD4;
  animation: liveDotBlink 1.4s ease-in-out infinite;
}

@keyframes liveDotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

@media (max-width: 768px) {
  .pie-floating-cursor {
    right: 8px;
  }
}

@keyframes spinPie360 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Slices interactive hover */
.pie-slice {
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease, opacity 0.3s ease;
  transform-origin: 260px 260px;
}

.pie-slice:hover {
  filter: brightness(1.22) drop-shadow(0 0 12px rgba(255, 255, 255, 0.6));
  transform: scale(1.03);
}

.pie-slice.highlighted {
  filter: brightness(1.3) drop-shadow(0 0 16px rgba(94, 220, 212, 0.9));
  transform: scale(1.04);
}

/* Center Core Hub */
.pie-center-hub {
  pointer-events: none;
}

/* Companion Service Cards (Legend) */
.service-pill-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.service-pill-item:hover,
.service-pill-item.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--pill-color, #5EDCD4);
  transform: translateX(6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 16px var(--pill-glow, rgba(94, 220, 212, 0.25));
}

.service-pill-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #ffffff;
  background: var(--pill-color, #0d6efd);
  box-shadow: 0 4px 12px var(--pill-glow, rgba(13, 110, 253, 0.3));
  flex-shrink: 0;
}

.service-pill-title {
  font-weight: 700;
  font-size: 1.02rem;
  color: #ffffff;
  margin-bottom: 2px;
}

.service-pill-desc {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0;
}

.pie-ctrl-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #5EDCD4;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pie-ctrl-btn:hover {
  background: rgba(94, 220, 212, 0.2);
  border-color: #5EDCD4;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(94, 220, 212, 0.4);
}

/* Service Legend Card Responsive Styling */
.service-legend-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.service-legend-card:hover,
.service-legend-card.is-active {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--card-color, #5EDCD4);
  transform: translateX(6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 16px var(--card-glow, rgba(94, 220, 212, 0.3));
}

.service-legend-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #ffffff;
  background: var(--card-color, #0d6efd);
  box-shadow: 0 4px 12px var(--card-glow, rgba(13, 110, 253, 0.35));
  flex-shrink: 0;
}

.service-legend-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: #ffffff;
  margin-bottom: 0;
  line-height: 1.28;
}

.service-legend-desc {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0;
  line-height: 1.38;
  word-break: normal;
  overflow-wrap: break-word;
}

.service-legend-badge {
  font-size: 0.72rem;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 576px) {
  .pie-showcase-card {
    padding: 24px 12px !important;
    border-radius: 20px;
  }
  .service-legend-card {
    padding: 12px 12px;
    gap: 12px;
    align-items: flex-start;
  }
  .service-legend-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    margin-top: 2px;
  }
  .service-legend-title {
    font-size: 0.92rem;
  }
  .service-legend-desc {
    font-size: 0.75rem;
    margin-top: 4px;
  }
  .service-legend-badge {
    font-size: 0.66rem !important;
    padding: 3px 8px !important;
  }
}
