/* =========================================================================
   ANIMAÇÕES PREMIUM - IG ENGENHARIA CIVIL
   Inspirado no padrão visual de sites de engenharia de alto padrão
   ========================================================================= */

/* ── TOKENS EXTRAS DE ANIMAÇÃO ────────────────────────────────────────── */
:root {
    --glow-primary: 0 0 20px rgba(245, 221, 32, 0.35), 0 0 60px rgba(245, 221, 32, 0.12);
    --glow-primary-sm: 0 0 10px rgba(245, 221, 32, 0.3);
    --shadow-gold: 0 8px 32px rgba(245, 221, 32, 0.18), 0 2px 8px rgba(245, 221, 32, 0.1);
    --shadow-card-dark: 0 4px 20px rgba(0,0,0,0.35), 0 1px 4px rgba(0,0,0,0.2);
    --shadow-card-hover: 0 20px 50px rgba(0,0,0,0.4), 0 8px 20px rgba(245, 221, 32, 0.1);
}

/* ── CURSOR GLOW (segue o mouse) ──────────────────────────────────────── */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(circle, rgba(245, 221, 32, 0.06) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    will-change: transform;
}

/* ── ANIMAÇÕES DE ENTRADA (SCROLL REVEAL) ─────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.reveal.reveal-scale {
    transform: scale(0.92) translateY(20px);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Delays staggered para listas */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.0s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.5s; }
.reveal-stagger.is-visible > * {
    opacity: 1;
    transform: none;
}

/* ── HERO — PARTÍCULAS FLUTUANTES ─────────────────────────────────────── */
.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.hero-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--color-primary);
    opacity: 0;
    animation: particle-float linear infinite;
}

@keyframes particle-float {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 0.6; }
    90%  { opacity: 0.3; }
    100% { transform: translateY(-20vh) scale(1.5); opacity: 0; }
}

/* ── HERO — BADGE ANIMADO ─────────────────────────────────────────────── */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(245, 221, 32, 0.1);
    border: 1px solid rgba(245, 221, 32, 0.3);
    color: var(--color-primary);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    animation: fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: badge-pulse 1.8s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0px rgba(245,221,32,0.6); }
    50%       { box-shadow: 0 0 0 6px rgba(245,221,32,0); }
}

/* ── HERO — ANIMAÇÕES DE ENTRADA STAGGERED ────────────────────────────── */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.anim-fade-up-1 { animation: fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both; }
.anim-fade-up-2 { animation: fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both; }
.anim-fade-up-3 { animation: fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both; }
.anim-fade-up-4 { animation: fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both; }
.anim-fade-up-5 { animation: fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both; }

/* ── HERO — SCROLL INDICATOR ──────────────────────────────────────────── */
.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.6;
    animation: fade-in 1s ease 1.5s both;
}

.scroll-indicator-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--color-primary), transparent);
    animation: scroll-line 2s ease-in-out infinite;
}

.scroll-indicator-text {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-muted-light);
    writing-mode: vertical-rl;
}

@keyframes scroll-line {
    0%   { transform: scaleY(0); transform-origin: top; }
    50%  { transform: scaleY(1); transform-origin: top; }
    51%  { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ── SECTION TAG (como a Realize usa) ─────────────────────────────────── */
.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 0.8rem;
}

.section-tag::before {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
}

/* ── BOTÕES — GLOW NO HOVER ───────────────────────────────────────────── */
.btn-primary:hover {
    box-shadow: var(--shadow-gold) !important;
    background-color: var(--color-primary-hover);
}

.btn-primary:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

/* Efeito de ondulação (ripple) nos botões */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.25) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:active::after {
    opacity: 1;
}

/* ── HEADER — LINHA AMARELA NA BORDA INFERIOR (quando scrollou) ───────── */
.site-header.scrolled {
    border-bottom: 1px solid rgba(245, 221, 32, 0.15);
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

/* ── CARDS DE SERVIÇO — HOVER BRILHANTE ──────────────────────────────── */
.service-card {
    position: relative;
    overflow: hidden;
}

/* Glow no canto superior esquerdo ao hover */
.service-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(245,221,32,0.06) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.service-card:hover::after {
    opacity: 1;
}

.service-card:hover {
    box-shadow: var(--shadow-card-hover) !important;
    border-color: rgba(245, 221, 32, 0.2) !important;
}

/* ── CARDS DE PORTFÓLIO — HOVER PROFUNDO ─────────────────────────────── */
.portfolio-card {
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.portfolio-card:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 24px 50px rgba(0,0,0,0.18), 0 4px 12px rgba(245,221,32,0.08) !important;
}

/* Imagem zoom no hover */
.project-img-container {
    overflow: hidden;
}

.project-img-container img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.portfolio-card:hover .project-img-container img {
    transform: scale(1.06) !important;
}

/* Overlay gradiente na imagem do portfólio */
.project-img-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(13,20,26,0.5) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.portfolio-card:hover .project-img-container::after {
    opacity: 1;
}

/* Badge da categoria com glow */
.project-category-badge {
    transition: all 0.3s ease !important;
}

.portfolio-card:hover .project-category-badge {
    background: var(--color-primary) !important;
    color: var(--color-dark-bg) !important;
    box-shadow: var(--glow-primary-sm) !important;
}

/* ── STAT NUMBERS — CONTADOR ANIMADO ─────────────────────────────────── */
.stat-number {
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* ── HIGHLIGHTS STATS CARD — GLOW ─────────────────────────────────────── */
.highlights-stats-card {
    position: relative;
    overflow: hidden;
}

.highlights-stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    animation: shimmer-line 3s ease-in-out infinite;
}

@keyframes shimmer-line {
    0%   { transform: scaleX(0); transform-origin: left; opacity: 1; }
    50%  { transform: scaleX(1); transform-origin: left; opacity: 1; }
    51%  { transform-origin: right; }
    100% { transform: scaleX(0); transform-origin: right; opacity: 0; }
}

/* ── CARDS DE INFO — HOVER ────────────────────────────────────────────── */
.info-card {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease !important;
}

.info-card:hover {
    transform: translateX(6px) !important;
    box-shadow: 0 4px 20px rgba(245,221,32,0.1) !important;
    border-color: rgba(245,221,32,0.2) !important;
}

/* ── NAV LINKS — GLOW NA LINHA INFERIOR ──────────────────────────────── */
.nav-link::after {
    box-shadow: none;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s ease !important;
}

.nav-link:hover::after,
.nav-link.active::after {
    box-shadow: 0 2px 8px rgba(245,221,32,0.5) !important;
}

/* ── FOOTER — LINHA DE SEPARAÇÃO ANIMADA ─────────────────────────────── */
.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245,221,32,0.3), transparent);
    margin: 2rem 0;
    position: relative;
}

/* ── GALERIA — HOVER OVERLAY ──────────────────────────────────────────── */
.gallery-item {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s ease !important;
}

.gallery-item:hover {
    transform: scale(1.03) !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2), 0 0 0 2px rgba(245,221,32,0.3) !important;
    z-index: 2;
}

/* ── BLOG CARDS — HOVER ───────────────────────────────────────────────── */
.blog-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s ease !important;
}

.blog-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 20px 45px rgba(0,0,0,0.14), 0 4px 10px rgba(245,221,32,0.06) !important;
}

/* ── SEÇÃO HERO — LINHA DECORATIVA ANIMADA ────────────────────────────── */
.hero-title-underline {
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), rgba(245,221,32,0.3));
    border-radius: 2px;
    margin: 1rem 0 1.5rem;
    animation: fade-up 1s ease 0.8s both;
}

/* ── SECTION TITLE — SUBLINHADO ELEGANTE ─────────────────────────────── */
.section-title-highlight {
    color: var(--color-primary);
    position: relative;
}

/* ── SERVIÇOS EM FUNDO ESCURO — NÚMERO DECORATIVO ────────────────────── */
.service-card-number {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 3.5rem;
    font-weight: 800;
    color: rgba(245,221,32,0.04);
    font-family: var(--font-heading);
    line-height: 1;
    user-select: none;
    transition: color 0.4s ease;
}

.service-card:hover .service-card-number {
    color: rgba(245,221,32,0.08);
}

/* ── PROGRESS LINE SECTION ─────────────────────────────────────────────── */
.section-divider-gold {
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), rgba(245,221,32,0.4));
    border-radius: 3px;
    margin: 1rem auto 2.5rem;
}

/* ── ABOUT SECTION STATS — GLOW ──────────────────────────────────────── */
.about-stat-box {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.about-stat-box:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(245,221,32,0.12) !important;
}

.about-stat-num {
    text-shadow: 0 0 20px rgba(245,221,32,0.3);
}

/* ── FORM CONTROL — FOCUS GLOW ────────────────────────────────────────── */
.form-control:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(245,221,32,0.15), 0 1px 4px rgba(245,221,32,0.1) !important;
    outline: none;
}

/* ── TESTIMONIAL CARD — ANIMAÇÃO DE ENTRADA ──────────────────────────── */
.testimonial-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s ease !important;
}

.testimonial-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 16px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(245,221,32,0.1) !important;
}

/* ── POST HEADER — LINHA DOURADA ──────────────────────────────────────── */
.post-header-section {
    position: relative;
}

.post-header-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), transparent 60%);
}

/* ── MAPA / IFRAME — BORDA ANIMADA ───────────────────────────────────── */
.map-wrapper {
    transition: box-shadow 0.4s ease !important;
}

.map-wrapper:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 0 0 2px rgba(245,221,32,0.15) !important;
}

/* ── ANIMAÇÃO DO LOGO NO HEADER AO SCROLL ─────────────────────────────── */
.site-header .header-logo {
    transition: height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.35s ease !important;
}

.site-header.scrolled .header-logo {
    height: 58px !important;
}

/* ── BACK-TO-TOP BUTTON ───────────────────────────────────────────────── */
#back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 998;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(13,20,26,0.92);
    border: 1px solid rgba(245,221,32,0.35);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
}

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

#back-to-top:hover {
    box-shadow: var(--glow-primary-sm);
    border-color: var(--color-primary);
    background: rgba(245,221,32,0.12);
}

/* ── LOADING SKELETON SHIMMER ────────────────────────────────────────── */
@keyframes skeleton-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

/* ── FLOATING ACCENT SHAPES (decorativo) ─────────────────────────────── */
.hero-accent-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    animation: accent-float 8s ease-in-out infinite;
}

.hero-accent-shape-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245,221,32,0.08) 0%, transparent 70%);
    top: 10%;
    right: 5%;
    animation-delay: 0s;
}

.hero-accent-shape-2 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(245,221,32,0.05) 0%, transparent 70%);
    bottom: 20%;
    left: 8%;
    animation-delay: 3s;
}

@keyframes accent-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-25px) scale(1.05); }
}

/* ── GRID PATTERN DE FUNDO (hero dark sections) ───────────────────────── */
.dark-grid-bg {
    background-image:
        linear-gradient(rgba(245,221,32,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245,221,32,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ── SECTION TRANSITION (borda suave entre seções) ────────────────────── */
.section-wave-top {
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

/* ── RESPONSIVE: desativa animações pesadas em mobile ─────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .cursor-glow { display: none; }
}

@media (max-width: 768px) {
    .cursor-glow { display: none; }
    .hero-accent-shape { display: none; }
    
    .reveal {
        transform: translateY(20px);
    }
    .reveal.reveal-left,
    .reveal.reveal-right {
        transform: translateY(20px);
    }
    
    /* Botão scroll-to-top — fica abaixo do WhatsApp */
    #back-to-top {
        bottom: 20px !important;
        right: 16px !important;
        width: 36px !important;
        height: 36px !important;
    }

    /* Spacing for hero title badge from fixed header on mobile */
    .hero-badge {
        margin-top: 4rem !important;
    }
}
