/* ============================================================
   EFFECTS.CSS
   Camada de efeitos visuais/animações adicionada sobre o site
   existente. Não altera textos, títulos ou fontes — apenas
   transições, animações, hover e microinterações.
   ============================================================ */

:root {
    --ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Scrollbar customizada ---------- */
html {
    scrollbar-width: thin;
    scrollbar-color: #268819 #eee;
}

::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #268819;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1d6b13;
}

/* ---------- Fade-in geral ao carregar a página ---------- */
body {
    animation: bodyFadeIn 0.6s ease both;
}

@keyframes bodyFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------- Barra de progresso de leitura ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #268819, #5c533b);
    z-index: 2000;
    transition: width 0.15s linear;
}

/* ---------- Utilitário de scroll-reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s var(--ease-out-soft), transform 0.7s var(--ease-out-soft);
    will-change: opacity, transform;
}

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

.reveal-left {
    transform: translateX(-45px);
}

.reveal-left.is-visible {
    transform: translateX(0);
}

.reveal-right {
    transform: translateX(45px);
}

.reveal-right.is-visible {
    transform: translateX(0);
}

/* Obs.: o atraso escalonado (stagger) da entrada dos cards é aplicado
   via JS (inline style) e removido logo depois de concluído — assim
   ele nunca "vaza" para as transições de hover dos cards. */

/* ---------- Header dinâmico ao rolar ---------- */
header {
    transition: box-shadow 0.35s ease, background-color 0.35s ease;
}

body.scrolled header {
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
}

.logo {
    transition: transform 0.3s var(--ease-standard);
}

body.scrolled .logo {
    transform: translateX(20px) scale(0.88) !important;
}

/* ---------- Menu hambúrguer animado ---------- */
.menu-toggle {
    transition: transform 0.3s var(--ease-standard);
}

.menu-toggle.open {
    transform: rotate(90deg);
}

/* Menu mobile com slide-down suave (substitui o show/hide instantâneo) */
@media screen and (max-width: 768px) {
    .nav-menu {
        display: flex;
        flex-direction: column;
        background-color: white;
        position: absolute;
        top: 5rem;
        left: 0;
        width: 100%;
        padding: 1rem;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-14px);
        pointer-events: none;
        transition: opacity 0.3s ease, transform 0.35s var(--ease-out-soft), visibility 0.35s;
    }

    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* ---------- Hero: fundo com Ken Burns + brilho sutil ---------- */
.background-container {
    overflow: hidden;
    animation: kenBurns 24s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes kenBurns {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

.background-container::after {
    content: "";
    position: absolute;
    inset: -10%;
    background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.16), transparent 55%);
    animation: driftGlow 16s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes driftGlow {
    0% { transform: translate(-4%, -2%) scale(1); }
    100% { transform: translate(4%, 3%) scale(1.1); }
}

/* Entrada do conteúdo do hero ao carregar */
.content h1 {
    animation: heroFadeUp 0.9s var(--ease-out-soft) both;
}

.content .buttons {
    animation: heroFadeUp 0.9s var(--ease-out-soft) 0.15s both;
}

@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Indicador de scroll no hero */
.scroll-cue {
    position: fixed;
    left: 50%;
    bottom: 1.75rem;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.scroll-cue span {
    width: 14px;
    height: 14px;
    border-right: 3px solid rgba(255, 255, 255, 0.85);
    border-bottom: 3px solid rgba(255, 255, 255, 0.85);
    transform: rotate(45deg);
    animation: chevronBounce 1.8s ease-in-out infinite;
}

.scroll-cue span:nth-child(2) {
    animation-delay: 0.2s;
    opacity: 0.6;
}

@keyframes chevronBounce {
    0%, 100% { transform: translateY(0) rotate(45deg); }
    50% { transform: translateY(8px) rotate(45deg); }
}

body.scrolled .scroll-cue {
    opacity: 0;
    pointer-events: none;
}

/* ---------- Botões: brilho deslizante + sombra no hover ---------- */
.btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s var(--ease-standard);
}

.btn:hover::after {
    left: 130%;
}

.btn:hover {
    box-shadow: 0 0.5rem 1.25rem rgba(38, 136, 25, 0.35);
}

/* ---------- Serviços: cards com elevação e ícone reativo ---------- */
.service-box {
    transition: opacity 0.6s var(--ease-out-soft), transform 0.4s var(--ease-out-soft), box-shadow 0.4s ease;
}

.service-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 1.25rem 2rem rgba(0, 0, 0, 0.12);
}

.service-icon img {
    transition: transform 0.4s var(--ease-out-soft);
}

.service-box:hover .service-icon img {
    transform: scale(1.15) rotate(-6deg);
}

/* ---------- Seção Meio: imagem reativa ---------- */
.middle-image img {
    transition: transform 0.5s var(--ease-out-soft), box-shadow 0.5s ease;
}

.middle-image img:hover {
    transform: scale(1.04);
    box-shadow: 0 0.9375rem 1.875rem rgba(0, 0, 0, 0.18);
}

/* ---------- Especialidades: cards e ícone com anel de pulso ---------- */
.specialties-box {
    transition: opacity 0.6s var(--ease-out-soft), transform 0.4s var(--ease-out-soft), box-shadow 0.4s ease;
}

.specialties-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 1.5rem 2.5rem rgba(0, 0, 0, 0.35);
}

.specialties-icon::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(38, 136, 25, 0.5);
    opacity: 0;
    animation: pulseRing 2.8s ease-out infinite;
}

@keyframes pulseRing {
    0% { transform: scale(0.85); opacity: 0.6; }
    70% { transform: scale(1.25); opacity: 0; }
    100% { opacity: 0; }
}

/* ---------- Sobre: fundo com Ken Burns ---------- */
.about-bg {
    animation: kenBurns 30s ease-in-out infinite alternate;
    will-change: transform;
}

/* ---------- Rodapé: links e ícones reativos ---------- */
.footer-nav ul li a,
.footer-contact a {
    position: relative;
}

.footer-nav ul li a::after,
.footer-contact a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0%;
    height: 2px;
    background-color: #ffffff;
    transition: width 0.3s ease;
}

.footer-nav ul li a:hover::after,
.footer-contact a:hover::after {
    width: 100%;
}

.icon-footer {
    transition: transform 0.3s var(--ease-standard);
}

a:hover .icon-footer {
    transform: scale(1.15) rotate(-8deg);
}

/* ---------- WhatsApp flutuante: anel de pulso ---------- */
.whatsapp-float {
    transition: transform 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.08);
}

.whatsapp-float::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.55);
    animation: waPulse 2.4s ease-out infinite;
    z-index: -1;
}

@keyframes waPulse {
    0% { transform: scale(1); opacity: 0.55; }
    100% { transform: scale(1.9); opacity: 0; }
}

/* ---------- Botão voltar ao topo ---------- */
.back-to-top {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #268819;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background-color: #1d6b13;
    transform: translateY(-3px);
}

/* ---------- Acessibilidade: respeita prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
