/* =============================================================================
   JR Solutions — enhance.css
   Camada de melhorias visuais sobre style.css (dinamismo, 3D, glassmorphism)
   ============================================================================= */

/* ---------- VANTA 3D background container ---------- */
.vanta-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .85;
}
.hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.hero > .container,
.hero .hero-glow-red,
.hero .hero-glow-blue {
    position: relative;
    z-index: 2;
}

/* ---------- Hero showcase carousel ---------- */
.hero-showcase .image-frame {
    position: relative;
    overflow: hidden;
}
.hero-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    isolation: isolate;
}
.hero-carousel .slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 1.2s ease, transform 6s ease;
    background-size: cover;
    background-position: center;
}
.hero-carousel .slide.active {
    opacity: 1;
    transform: scale(1);
}
.hero-carousel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(218,24,24,.12), rgba(0,0,0,0) 40%, rgba(37,99,235,.18));
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 2;
}
.hero-carousel-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}
.hero-carousel-dots span {
    width: 24px;
    height: 3px;
    background: rgba(255,255,255,.25);
    border-radius: 2px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.hero-carousel-dots span.active {
    background: linear-gradient(90deg, var(--primary-red), var(--primary-blue));
    box-shadow: 0 0 12px var(--primary-red-glow);
    width: 36px;
}

/* ---------- Tech Marquee ---------- */
.tech-marquee {
    background: linear-gradient(180deg, #0c0f14 0%, var(--bg-dark) 100%);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    padding: 18px 0;
    --marquee-duration: 38s;
}
.tech-marquee::before,
.tech-marquee::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    z-index: 2;
    pointer-events: none;
}
.tech-marquee::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg-dark), rgba(0,0,0,0));
}
.tech-marquee::after {
    right: 0;
    background: linear-gradient(-90deg, var(--bg-dark), rgba(0,0,0,0));
}
.tech-marquee-track {
    display: flex;
    width: max-content;
    gap: 56px;
    animation: marqueeScroll var(--marquee-duration) linear infinite;
}
.tech-marquee-track:hover { animation-play-state: paused; }
.tech-marquee-item {
    color: var(--text-slate);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: .12em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    opacity: .8;
    transition: var(--transition-smooth);
    white-space: nowrap;
}
.tech-marquee-item i {
    color: var(--primary-red);
    font-size: 22px;
    text-shadow: 0 0 12px var(--primary-red-glow);
}
.tech-marquee-item:nth-child(even) i { color: var(--primary-blue); text-shadow: 0 0 12px var(--primary-blue-glow); }
.tech-marquee-item:hover { color: #fff; opacity: 1; }
@keyframes marqueeScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ---------- Stats Counter Section ---------- */
.stats-strip {
    background: radial-gradient(ellipse at center, rgba(37,99,235,.10), rgba(218,24,24,.04) 50%, transparent 80%),
                linear-gradient(180deg, var(--bg-dark), #0a0e15);
    padding: 70px 0;
    border-block: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}
.stats-strip::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(90deg, rgba(37,99,235,.06) 1px, transparent 1px),
        linear-gradient(0deg,  rgba(218,24,24,.06) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
    pointer-events: none;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    text-align: center;
    position: relative;
}
.stat-item {
    background: rgba(17,25,39,.5);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 28px 18px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}
.stat-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 60%, var(--primary-red-glow) 100%);
    opacity: 0;
    transition: var(--transition-smooth);
}
.stat-item:hover {
    transform: translateY(-6px);
    border-color: var(--border-color-hover);
    box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.stat-item:hover::before { opacity: 1; }
.stat-icon {
    font-size: 32px;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}
.stat-number {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 48px;
    color: #fff;
    line-height: 1;
    letter-spacing: -.02em;
    text-shadow: 0 0 24px rgba(37,99,235,.4);
}
.stat-number .suffix {
    color: var(--primary-red);
    font-size: 32px;
    margin-left: 2px;
}
.stat-label {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-slate);
    font-size: 12px;
    letter-spacing: .15em;
    text-transform: uppercase;
    margin-top: 8px;
}
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-number { font-size: 38px; }
}

/* ---------- Glassmorphism dos cards ---------- */
.service-card,
.agent-card,
.vmv-card {
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    transform-style: preserve-3d;
    transition: transform .35s cubic-bezier(.2,.8,.2,1),
                box-shadow .35s ease,
                border-color .35s ease;
    will-change: transform;
}
.service-card::after,
.agent-card::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent, rgba(218,24,24,.4), transparent 50%, rgba(37,99,235,.4));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity .35s ease;
    pointer-events: none;
}
.service-card:hover::after,
.agent-card:hover::after { opacity: 1; }

/* ---------- Agent images: duotone + holographic frame ---------- */
.agent-img-frame {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    isolation: isolate;
}
.agent-img-frame::before {
    /* Holographic scanline */
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg,
            transparent 0,
            transparent 3px,
            rgba(37,99,235,.04) 3px,
            rgba(37,99,235,.04) 4px);
    z-index: 3;
    pointer-events: none;
    mix-blend-mode: overlay;
}
.agent-img-frame::after {
    /* Color grade vermelho/azul para uniformizar com o site */
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 25%, rgba(37,99,235,.30), transparent 55%),
        radial-gradient(circle at 75% 80%, rgba(218,24,24,.25), transparent 60%);
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: color-dodge;
    opacity: .85;
}
.agent-img {
    filter: contrast(1.08) saturate(.92) brightness(.95);
    transition: transform .8s ease, filter .35s ease;
}
.agent-card:hover .agent-img {
    transform: scale(1.04);
    filter: contrast(1.15) saturate(1.05) brightness(1);
}
/* corners cyber */
.agent-img-frame > .corner {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--primary-blue);
    z-index: 4;
    pointer-events: none;
    box-shadow: 0 0 12px var(--primary-blue-glow);
}
.agent-img-frame > .corner.tl { top: 8px;    left: 8px;    border-right: none; border-bottom: none; }
.agent-img-frame > .corner.tr { top: 8px;    right: 8px;   border-left:  none; border-bottom: none; border-color: var(--primary-red); box-shadow: 0 0 12px var(--primary-red-glow); }
.agent-img-frame > .corner.bl { bottom: 8px; left: 8px;    border-right: none; border-top:    none; border-color: var(--primary-red); box-shadow: 0 0 12px var(--primary-red-glow); }
.agent-img-frame > .corner.br { bottom: 8px; right: 8px;   border-left:  none; border-top:    none; }

/* badge "ATIVO" no agente */
.agent-status {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(8,11,17,.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--primary-green);
    color: var(--primary-green);
    padding: 4px 10px;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: .15em;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 6px;
}
.agent-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-green);
    box-shadow: 0 0 8px var(--primary-green);
    animation: pulseDot 1.6s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .4; transform: scale(1.4); }
}

/* ---------- Floating animated grid background (between sections) ---------- */
.section-divider {
    height: 80px;
    background: linear-gradient(180deg, transparent, rgba(218,24,24,.04), transparent);
    position: relative;
    overflow: hidden;
}
.section-divider svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ---------- AOS overrides (sutil) ---------- */
[data-aos] { will-change: transform, opacity; }

/* ---------- Hero text reveal ---------- */
.hero h1 {
    background: linear-gradient(135deg, #fff 0%, #e5e7eb 50%, #fff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: heroShine 6s ease-in-out infinite;
}
@keyframes heroShine {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* ---------- Service card image hover zoom ---------- */
.service-img-container {
    overflow: hidden;
    position: relative;
}
.service-card-img {
    transition: transform 1.4s cubic-bezier(.2,.8,.2,1), filter .35s;
}
.service-card:hover .service-card-img {
    transform: scale(1.08);
    filter: brightness(1.05) saturate(1.1);
}
.service-img-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(8,11,17,.95));
    pointer-events: none;
}

/* ---------- Floating glow particles in contact section ---------- */
.contact { position: relative; overflow: hidden; }
.contact-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.contact-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-blue);
    box-shadow: 0 0 12px var(--primary-blue), 0 0 24px var(--primary-blue-glow);
    opacity: .55;
    animation: floatParticle 18s linear infinite;
}
.contact-particles span:nth-child(2n) { background: var(--primary-red); box-shadow: 0 0 12px var(--primary-red), 0 0 24px var(--primary-red-glow); }
.contact-particles span:nth-child(1) { left: 8%;  top: 80%; animation-delay:  0s; }
.contact-particles span:nth-child(2) { left: 18%; top: 25%; animation-delay: -3s; }
.contact-particles span:nth-child(3) { left: 35%; top: 60%; animation-delay: -6s; }
.contact-particles span:nth-child(4) { left: 55%; top: 30%; animation-delay: -9s; }
.contact-particles span:nth-child(5) { left: 72%; top: 70%; animation-delay: -12s; }
.contact-particles span:nth-child(6) { left: 88%; top: 40%; animation-delay: -15s; }
.contact-particles span:nth-child(7) { left: 25%; top: 90%; animation-delay: -2s; }
.contact-particles span:nth-child(8) { left: 65%; top: 10%; animation-delay: -8s; }
@keyframes floatParticle {
    0%   { transform: translate(0, 0)    scale(.8); opacity: 0;   }
    10%  {                                          opacity: .55; }
    50%  { transform: translate(40px, -60px) scale(1.2);          }
    90%  {                                          opacity: .55; }
    100% { transform: translate(-20px, -120px) scale(.8); opacity: 0; }
}
.contact > .container { position: relative; z-index: 1; }

/* ---------- Smooth fade-in for AOS-less elements ---------- */
.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1);
}
.fade-up.visible { opacity: 1; transform: none; }

/* ---------- VanillaTilt glare ---------- */
.tilted .js-tilt-glare {
    border-radius: var(--border-radius-lg);
}

/* ---------- Performance: reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .hero-carousel .slide,
    .tech-marquee-track,
    .contact-particles span,
    .hero h1 { animation: none !important; transition: none !important; }
    .stat-item:hover { transform: none; }
}

/* ---------- Mobile fine tuning ---------- */
@media (max-width: 768px) {
    .hero-carousel { aspect-ratio: 4 / 3; }
    .tech-marquee { padding: 12px 0; }
    .tech-marquee-item { font-size: 14px; gap: 10px; }
    .stat-number { font-size: 32px; }
}
