/* ============================================================
   INDEX.CSS — Design System CopyWrite
   Estética Editorial / Brutalista | Fraunces + JetBrains Mono
   ============================================================ */

/* -------------------------------------------------------
   1. Fonts — importadas via head.php (não-bloqueante)
   ------------------------------------------------------- */

.font-mono  { font-family: 'JetBrains Mono', monospace; }
.font-sans  { font-family: 'Inter', sans-serif; letter-spacing: -0.02em; }

/* -------------------------------------------------------
   2. Textura de Ruído (Paper Noise)
   — position:absolute + will-change evita repaint no scroll
   ------------------------------------------------------- */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    will-change: transform; /* Promove para layer de GPU, sem repaint no scroll */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
}

/* -------------------------------------------------------
   3. Blueprint Grid Background
   ------------------------------------------------------- */
.bg-blueprint {
    background-image: 
        linear-gradient(to right, rgba(10, 10, 10, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(10, 10, 10, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* -------------------------------------------------------
   4. Animação Cinematográfica (Clip-Path Reveal)
   ------------------------------------------------------- */
@keyframes clipReveal {
    0% { 
        clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); 
        transform: translateY(40px);
    }
    100% { 
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); 
        transform: translateY(0);
    }
}

.reveal-clip {
    animation: clipReveal 1.2s cubic-bezier(0.77, 0, 0.175, 1) both;
    animation-play-state: paused;
    will-change: clip-path, transform;
}

/* -------------------------------------------------------
   5. Index Row (Catálogo Técnico)
   — transition: all substituído por propriedades específicas
   ------------------------------------------------------- */
.index-row {
    transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                padding-left 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                padding-right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.index-row:hover {
    background-color: #0A0A0A;
    color: #F2F2ED;
    padding-left: 2rem;
    padding-right: 2rem;
}
.index-row:hover .index-icon {
    color: #0E67E4;
    transform: scale(1.1) rotate(-5deg);
}

/* -------------------------------------------------------
   6. App Wrapper (Fade-in Orquestrado)
   ------------------------------------------------------- */
#app-wrapper {
    transition: opacity 1s ease-out;
}

/* -------------------------------------------------------
   7. Scroll Reveal (Fade Up)
   — will-change reduz custo de layout durante animação
   ------------------------------------------------------- */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
    will-change: auto; /* Libera a layer após animação */
}

/* -------------------------------------------------------
   8. Pain Card (Problema do Cliente)
   — transition: all → específico
   ------------------------------------------------------- */
.pain-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid rgba(10, 10, 10, 0.1);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
.pain-item:hover {
    border-color: #0E67E4;
    background: rgba(14, 103, 228, 0.03);
}

/* -------------------------------------------------------
   9. FAQ Accordion
   ------------------------------------------------------- */
.faq-item {
    border-bottom: 1px solid rgba(10, 10, 10, 0.1);
    overflow: hidden;
}
.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.9375rem;
    color: #0A0A0A;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    letter-spacing: -0.02em;
    transition: color 0.2s ease;
}
.faq-question:hover { color: #0E67E4; }
.faq-question svg {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    color: rgba(10, 10, 10, 0.3);
}
.faq-item.active .faq-question svg {
    transform: rotate(180deg);
    color: #0E67E4;
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.faq-item.active .faq-answer {
    max-height: 300px;
}
.faq-answer-inner {
    padding: 0 0 1.5rem 0;
    font-family: 'Inter', sans-serif;
    color: rgba(10, 10, 10, 0.6);
    font-size: 0.9375rem;
    line-height: 1.7;
    letter-spacing: -0.02em;
}

/* -------------------------------------------------------
   10. Testimonial Card
   ------------------------------------------------------- */
.testimonial-card {
    border: 1px solid rgba(10, 10, 10, 0.1);
    padding: 2rem;
    position: relative;
    transition: border-color 0.3s ease;
}
.testimonial-card:hover {
    border-color: #0E67E4;
}
.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 0.75rem;
    right: 1.25rem;
    font-size: 4rem;
    font-weight: 700;
    color: rgba(14, 103, 228, 0.08);
    line-height: 1;
    font-family: Georgia, serif;
}

/* -------------------------------------------------------
   11. Scrollbar
   ------------------------------------------------------- */
::selection {
    background: #0E67E4;
    color: white;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #F2F2ED; }
::-webkit-scrollbar-thumb {
    background: rgba(10, 10, 10, 0.15);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(10, 10, 10, 0.3); }

/* -------------------------------------------------------
   12. Check Item (Diferenciais)
   ------------------------------------------------------- */
.check-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(10, 10, 10, 0.08);
}
.check-item:last-child { border-bottom: none; }

/* -------------------------------------------------------
   13. Process Card
   — transition: all → específico
   ------------------------------------------------------- */
.process-card {
    border: 1px solid rgba(10, 10, 10, 0.1);
    padding: 2rem;
    transition: border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.process-card:hover {
    border-color: #0E67E4;
    transform: translateY(-4px);
}
.process-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #0E67E4;
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.process-card:hover::after {
    transform: scaleX(1);
}

/* -------------------------------------------------------
   14. Portfolio Card
   ------------------------------------------------------- */
.portfolio-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.5s ease;
    border: 1px solid rgba(10,10,10,0.1);
    border-radius: 16px;
}
.portfolio-card:hover {
    transform: scale(1.03);
    border-color: #0E67E4;
    box-shadow: 0 20px 60px rgba(14, 103, 228, 0.12);
}
.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,10,10,0.92) 0%, rgba(10,10,10,0.5) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
}

/* -------------------------------------------------------
   15. Content Visibility — seções off-screen
   Reduz drasticamente o trabalho de Style & Layout
   ------------------------------------------------------- */
section {
    content-visibility: auto;
    contain-intrinsic-block-size: 600px; /* Estimativa de altura para evitar CLS */
}

/* Hero (primeira seção visível) NÃO deve ter content-visibility */
section:first-of-type,
section[id="servicos"],
.hero-section {
    content-visibility: visible;
    contain-intrinsic-block-size: auto;
}

/* -------------------------------------------------------
   16. Magnetic Buttons — GPU layer durante interação
   ------------------------------------------------------- */
.magnetic-btn {
    transform: translate(0, 0); /* Força criação de contexto de composição */
}

/* -------------------------------------------------------
   17. Preferências de Acessibilidade
   ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal-up {
        opacity: 1;
        transform: translateY(0);
    }
}
