/* ==========================================================================
   REACT BITS: StarBorder & GlareHover Effects — Light Corporate Edition
   2M Consulting & 2M Group
   Tema Claro Corporativo Premium (McKinsey, PwC, Deloitte, Stripe)
   ========================================================================== */

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

@keyframes star-border-rotate {
  0% {
    --border-angle: 0deg;
  }
  100% {
    --border-angle: 360deg;
  }
}

.star-border-effect {
  position: relative !important;
  isolation: isolate;
  background-color: #ffffff;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Moldura perimetral precisa (1.5px de espessura com mask) */
.star-border-effect::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--border-angle, 0deg),
    transparent 0deg,
    transparent 70deg,
    var(--star-color, #D97706) 100deg,
    var(--star-color-bright, #FBBF24) 120deg,
    var(--star-color, #D97706) 140deg,
    transparent 180deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none !important;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 5;
}

.star-border-effect::after {
  display: none !important;
}

/* ATIVAÇÃO EXCLUSIVA NO :HOVER DE CADA CARD */
.star-border-effect:hover::before {
  opacity: 1;
  animation: star-border-rotate var(--star-speed, 3.5s) linear infinite;
}

.star-border-effect:hover {
  box-shadow: 0 10px 25px -5px rgba(217, 119, 6, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  border-color: rgba(217, 119, 6, 0.4) !important;
}

.star-border-emerald,
.star-border-amber {
  --star-color: #D97706;
  --star-color-bright: #FBBF24;
}

.star-border-emerald:hover,
.star-border-amber:hover {
  box-shadow: 0 10px 25px -5px rgba(217, 119, 6, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  border-color: rgba(217, 119, 6, 0.5) !important;
}

/* --------------------------------------------------------------------------
   2. GLARE HOVER EFFECT (Reflexo Especular Suave no Hover)
   -------------------------------------------------------------------------- */
.glare-hover-effect {
  position: relative !important;
  overflow: hidden !important;
}

.glare-hover-effect .glare-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none !important;
  z-index: 10;
  background: linear-gradient(
    var(--gh-angle, -30deg),
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 60%
  );
  background-size: 250% 250%;
  background-position: 140% 140%;
  background-repeat: no-repeat;
  transition: background-position 800ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 300ms ease;
  opacity: 0;
}

.glare-hover-effect:hover .glare-overlay {
  background-position: -40% -40%;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   3. SHAPEGRID CANVAS (React Bits 2D Canvas Background)
   -------------------------------------------------------------------------- */
.shapegrid-canvas {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* --------------------------------------------------------------------------
   4. STATIC SHAPEGRID BACKGROUND (Light Corporate Grid)
   -------------------------------------------------------------------------- */
.static-shape-grid {
  position: relative !important;
  overflow: hidden;
}

.static-shape-grid-layer {
  position: absolute;
  inset: 0;
  pointer-events: none !important;
  z-index: 0;
  overflow: hidden;
}

.static-shape-grid-pattern {
  position: absolute;
  inset: 0;
  background-size: 40px 40px;
  background-position: center center;
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, #000 35%, rgba(0, 0, 0, 0.25) 75%, transparent 100%);
  mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, #000 35%, rgba(0, 0, 0, 0.25) 75%, transparent 100%);
  pointer-events: none;
}

.static-shape-grid-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 85% 75% at 50% 50%, transparent 40%, rgba(248, 250, 252, 0.6) 80%, #F8FAFC 100%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.8) 0%, transparent 15%, transparent 85%, rgba(248, 250, 252, 0.9) 100%);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   5. REACT BITS: SCROLLSTACK (Serviços / Pilares)
   -------------------------------------------------------------------------- */
#programa.static-shape-grid,
#servicos.static-shape-grid,
#pilares.static-shape-grid,
.scroll-stack-section.static-shape-grid {
  overflow: visible !important;
  overflow-x: clip !important;
  overflow-y: visible !important;
}

.scroll-stack-container {
  position: relative;
  width: 100%;
}

@media (min-width: 1024px) {
  .scroll-stack-card {
    --stack-top-base: 20vh;
    --stack-step: 8px;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: calc(var(--stack-top-base, 20vh) + var(--stack-index, 0) * var(--stack-step, 8px)) !important;
    z-index: calc(10 + var(--stack-index, 0)) !important;
    transform-origin: top center;
    will-change: transform, filter, box-shadow;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    background-color: #ffffff;
    box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
    transition: transform 0.15s cubic-bezier(0.25, 1, 0.5, 1),
                filter 0.15s ease-out,
                box-shadow 0.2s ease-out;
    min-height: 360px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }

  .scroll-stack-card.is-stacked {
    box-shadow: 0 -8px 25px -5px rgba(15, 23, 42, 0.06), 0 15px 30px -10px rgba(15, 23, 42, 0.1) !important;
  }
}

@media (max-width: 1023px) {
  .scroll-stack-container {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }

  .scroll-stack-card {
    position: relative !important;
    -webkit-position: relative !important;
    top: auto !important;
    min-height: auto !important;
    height: auto !important;
    display: block !important;
    transform: none !important;
    -webkit-transform: none !important;
    box-shadow: none !important;
    margin-bottom: 1rem !important;
  }

  .scroll-stack-card:last-child {
    margin-bottom: 0 !important;
  }

  .scroll-stack-end {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

.scroll-stack-end {
  width: 100%;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   6. MOBILE MENU DRAWER — FUNDO 100% SÓLIDO E OPACO (#101522)
   -------------------------------------------------------------------------- */
#mobile-menu {
  background-color: #101522 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.95) !important;
}

