/* ==========================================================================
   YODYSHAHR CORPORATE ECOSYSTEM WEBSITE — CUSTOM STYLESHEET
   Design System: Aura Corporate
   ========================================================================== */

:root {
  --brand-navy: #142c49;
  --brand-navy-dark: #0f2137;
  --brand-slate: #334155;
  --brand-muted: #64748b;
  --brand-teal: #13b4a5;
  --brand-teal-hover: #0fa092;
  --brand-teal-light: #e7f8f6;
  --brand-gold: #f0b75a;
  --brand-blue: #0284c7;
  --brand-sky: #0ea5e9;
  --brand-indigo: #7766d8;
}

/* 1. Base & Smooth Scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

html,
body {
  margin: 0;
  padding: 0;
  overscroll-behavior-x: none;
}

/* Refined Subtle Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f5f8fc;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   2. HERO INTERACTIVE + AUTO-FLOWING TRANSLUCENT GRADIENT TEXT
   - Moves dynamically when user moves mouse over the hero/text
   - Automatically flows like a living wave when mouse is idle
   ========================================================================== */
.hero-gradient-text {
  --grad-x: 0%;
  --grad-y: 50%;
  --spot-x: 82%;
  --spot-y: 55%;
  position: relative;
  display: inline-block;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Dual-layer background:
     Layer 1: Movable translucent spotlight mask that creates the soft fade effect
     Layer 2: Multi-stop vibrant Teal -> Sky -> Blue -> Translucent Mist -> Teal wave */
  background-image:
    radial-gradient(
      circle 175px at var(--spot-x) var(--spot-y),
      rgba(245, 248, 252, 0.86) 0%,
      rgba(224, 242, 254, 0.52) 42%,
      rgba(19, 180, 165, 0) 78%
    ),
    linear-gradient(
      115deg,
      #13b4a5 0%,
      #0ea5e9 22%,
      #0284c7 42%,
      rgba(56, 189, 248, 0.25) 62%,
      #0ea5e9 78%,
      #13b4a5 100%
    );
  background-size: 100% 100%, 260% 260%;
  background-position: 0 0, var(--grad-x) var(--grad-y);
  background-repeat: no-repeat;
  transition: filter 0.3s ease;
  will-change: background-position;
}

/* Pure CSS fallback animation before JS initializes or if JS is disabled */
.hero-gradient-text:not([data-js-interactive="true"]) {
  animation: idleGradientWalk 7s ease-in-out infinite alternate;
}

@keyframes idleGradientWalk {
  0% {
    --grad-x: 0%;
    --spot-x: 85%;
    --spot-y: 65%;
    background-position: 0 0, 0% 50%;
  }
  50% {
    --grad-x: 55%;
    --spot-x: 45%;
    --spot-y: 35%;
    background-position: 0 0, 55% 50%;
  }
  100% {
    --grad-x: 100%;
    --spot-x: 18%;
    --spot-y: 60%;
    background-position: 0 0, 100% 50%;
  }
}

/* Subtle interactive glow when hovering directly on the headline */
.hero-gradient-text.is-tracking {
  filter: drop-shadow(0 6px 20px rgba(19, 180, 165, 0.16));
}

/* ==========================================================================
   3. SVG DIAGRAM MICRO-ANIMATIONS (Connected Y Nodes & Flow Lines)
   ========================================================================== */
.svg-flow-line {
  stroke-dasharray: 6 6;
  animation: dashFlow 16s linear infinite;
}

@keyframes dashFlow {
  from {
    stroke-dashoffset: 120;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.node-pulse-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: nodePulse 3.2s ease-in-out infinite;
}

.node-pulse-ring-delayed {
  transform-box: fill-box;
  transform-origin: center;
  animation: nodePulse 3.2s ease-in-out 1.4s infinite;
}

@keyframes nodePulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.22;
  }
  50% {
    transform: scale(1.22);
    opacity: 0.42;
  }
}

/* ==========================================================================
   4. SCROLL REVEAL ANIMATIONS
   ========================================================================== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ==========================================================================
   5. NAVIGATION ACTIVE LINK INDICATOR
   ========================================================================== */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--brand-teal), var(--brand-sky));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link.is-active {
  color: var(--brand-teal);
  font-weight: 600;
}

/* ==========================================================================
   6. TOP-LAYER MODAL DIALOG ANIMATIONS (Modern Web Guidance Compliant)
   ========================================================================== */
dialog#whatsappModal {
  opacity: 0;
  transform: scale(0.95) translateY(8px);
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.28s;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  transition-behavior: allow-discrete;
}

dialog#whatsappModal::backdrop {
  background-color: rgba(20, 44, 73, 0);
  backdrop-filter: blur(0px);
  transition-property: background-color, backdrop-filter, display, overlay;
  transition-duration: 0.28s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

:is(dialog#whatsappModal[open]):where(:not([data-closing])) {
  opacity: 1;
  transform: scale(1) translateY(0);

  @starting-style {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }

  &::backdrop {
    background-color: rgba(20, 44, 73, 0.6);
    backdrop-filter: blur(4px);

    @starting-style {
      background-color: rgba(20, 44, 73, 0);
      backdrop-filter: blur(0px);
    }
  }
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  dialog#whatsappModal {
    transform: none;
    transition-duration: 0.1s;
  }

  @starting-style {
    dialog#whatsappModal[open] {
      transform: none;
    }
  }

  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .svg-flow-line,
  .node-pulse-ring,
  .node-pulse-ring-delayed {
    animation: none;
  }
}

