@import url('variables.css');

/* =========================================
   1. RESET & BASE
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Tipografia */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

a { text-decoration: none; transition: all 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* Utilitários */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; width: 100%; }
.section-padding { padding: 100px 0; }

.section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 50px;
    line-height: 1.2;
}

/* =========================================
   2. HEADER & NAV
   ========================================= */
header {
    background-color: rgba(255, 255, 255, 0.98);
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
}

.logo {
    position: absolute;
    left: 115px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.logo-img {
    height: 90px;
    width: auto;
    display: block;
}

.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    position: relative;
}

.header-actions {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo span {
    font-weight: 300;
    font-size: 0.8em;
    color: var(--color-text);
}

.desktop-nav .nav-list { display: flex; gap: 40px; }

.nav-item {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-text);
    position: relative;
    padding: 5px 0;
}

.nav-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--color-secondary);
    transition: width 0.3s;
}

.nav-item:hover::after { width: 100%; }
.nav-item:hover { color: var(--color-primary); }

.btn-header {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-secondary);
    border: 1px solid var(--color-secondary);
    padding: 10px 24px;
    transition: all 0.3s ease;
}

.btn-header:hover { background-color: var(--color-secondary); color: white; }

/* Hamburger */
.hamburger { display: none; cursor: pointer; }
.bar { width: 25px; height: 2px; background-color: var(--color-primary); margin: 5px 0; transition: 0.3s; }

/* Menu Mobile */
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: white;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    flex-direction: column;
    gap: 20px;
    text-align: center;
}
.mobile-nav.active { display: flex; }

/* =========================================
   3. HERO (HOME)
   ========================================= */
.hero {
    height: 90vh;
    position: relative;
    display: flex;
    align-items: center;
    margin-top: var(--header-height);
    overflow: hidden;
    background-color: #000;
}

.hero-video {
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.hero-overlay,
.hero-content {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero.is-loaded .hero-overlay,
.hero.is-loaded .hero-content {
    opacity: 1;
}

.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 100%);
}

.hero-content {
    position: relative; z-index: 2; color: white; max-width: 800px;
    padding-left: 40px;
    border-left: 4px solid var(--color-secondary);
}

.hero h1 { color: white; font-size: 3.5rem; margin-bottom: 20px; line-height: 1.1; }
.hero p { font-size: 1.2rem; font-weight: 300; margin-bottom: 30px; max-width: 600px; }

.btn-hero {
    background-color: var(--color-secondary);
    color: white;
    padding: 15px 40px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    display: inline-block;
}
.btn-hero:hover { background-color: #a85630; }

/* =========================================
   4. COMPONENTES GERAIS
   ========================================= */

/* Grids */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; }

/* Layout Imagem + Texto */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-image {
    height: 100%;
    min-height: 500px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.about-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.about-image:hover img { transform: scale(1.03); }

/* Trigger da Imagem da Equipe (abre balão) */
.team-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    cursor: pointer;
    background: none;
    font-family: inherit;
}
.team-trigger-hint {
    position: absolute;
    left: 20px;
    bottom: 20px;
    background: rgba(27, 77, 62, 0.9);
    color: white;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 18px;
    border-radius: 4px;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.3s ease;
}
.team-trigger:hover .team-trigger-hint,
.team-trigger:focus-visible .team-trigger-hint {
    opacity: 1;
    transform: translateY(0);
}

/* Coluna 2 do about-grid: cards OU balão da equipe */
.about-side { position: relative; }

/* Balão: Equipe */
.team-info {
    position: relative;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 35px;
    box-shadow: var(--shadow-soft);
    animation: teamInfoIn 0.3s ease;
}

.team-info::before,
.team-info::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    transform: translateY(-50%);
}
.team-info::before {
    left: -15px;
    border-right: 15px solid var(--color-border);
}
.team-info::after {
    left: -13px;
    border-right: 14px solid var(--color-white);
}

@keyframes teamInfoIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.team-info-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--color-text-light);
    cursor: pointer;
    transition: color 0.3s ease;
}
.team-info-close:hover { color: var(--color-secondary); }

.team-member {
    padding: 18px 0;
    border-top: 1px solid var(--color-border);
}
.team-member:first-of-type { border-top: none; padding-top: 15px; }

.team-member h3 {
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-bottom: 4px;
}
.team-member-role {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.team-member p { font-size: 0.95rem; color: var(--color-text-light); }

/* Info Cards */
.info-card {
    background: white;
    border: 1px solid var(--color-border);
    padding: 30px;
    transition: 0.3s;
    height: 100%;
}
.info-card:hover { border-color: var(--color-secondary); transform: translateY(-5px); }
.info-card h3 { font-size: 1.2rem; margin-bottom: 10px; border-bottom: 2px solid var(--color-secondary); display: inline-block; padding-bottom: 5px; }
.info-card p { font-size: 0.95rem; color: var(--color-text-light); }

/* Impacto (Números) */
.impact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.impact-num { 
    font-size: 3.5rem; 
    font-weight: 700; 
    color: var(--color-primary); 
    display: block; 
    line-height: 1; 
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums; 
}
.impact-txt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--color-text-light); }

/* Projetos */
.project-card { position: relative; height: 450px; overflow: hidden; cursor: pointer; will-change: transform; }
.project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; will-change: transform; transform: translateZ(0); }
.project-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 30px;
    color: white;
    transform: translate3d(0, 20px, 0);
    transition: transform 0.3s ease;
    will-change: transform;
}
.project-card:hover img { transform: scale3d(1.06, 1.06, 1); }
.project-card:hover .project-overlay { transform: translate3d(0, 0, 0); }
.project-overlay h3 { color: white; font-size: 1.4rem; margin-bottom: 5px; }
.project-overlay p { font-size: 0.9rem; opacity: 0.8; font-weight: 300; }

/* Processo */
.process-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.process-step { 
    background: white; border: 1px solid var(--color-border); padding: 40px; position: relative;            
    transition: all 0.3s ease; height: 100%; display: flex; flex-direction: column; justify-content: center;
}
.process-step:hover { border-color: var(--color-secondary); transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.process-step h4 { font-size: 1.2rem; margin: 15px 0; border-bottom: 2px solid var(--color-secondary); display: inline-block; padding-bottom: 5px; position: relative; z-index: 2; }
.process-step p { font-size: 0.95rem; color: var(--color-text-light); position: relative; z-index: 2; }
.step-num { font-size: 4rem; font-weight: 700; color: #f0f0f0; position: absolute; top: 10px; right: 20px; line-height: 1; z-index: 1; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--color-border); padding: 20px 0; }
details summary { font-family: var(--font-heading); font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: var(--color-primary); list-style: none; }
details summary::after { content: '+'; font-size: 1.5rem; font-weight: 300; }
details[open] summary::after { content: '-'; }
details p { margin-top: 15px; color: var(--color-text-light); font-size: 0.95rem; }

/* =========================================
   5. PÁGINAS INTERNAS (Fertilizantes, Sobre)
   ========================================= */
.page-header {
    height: 50vh;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-top: var(--header-height);
    text-align: center;
}

.page-header::before {
    content: '';
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); 
}

.page-title {
    position: relative;
    z-index: 2;
    color: white;
    font-size: 3.2rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.page-subtitle {
    position: relative;
    z-index: 2;
    color: white;
    font-size: 1.2rem;
    font-weight: 300;
    margin-top: 15px;
    max-width: 600px;
    opacity: 0.9;
}

.text-content p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 25px;
    line-height: 1.8;
}

/* Botões de Ação */
.btn-center-wrapper { text-align: center; margin-top: 50px; }

.btn-outline {
    display: inline-block;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 12px 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-heading);
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: white;
    transform: translateY(-3px);
}

/* =========================================
   6. ANIMAÇÕES
   ========================================= */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
    will-change: opacity, transform;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-with-text {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
    will-change: opacity, transform;
}

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

.float-img-right {
    float: right;
    margin: 0 0 15px 25px;
    max-width: 260px;
}

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }

/* =========================================
   7. FOOTER
   ========================================= */
footer { 
    background: #ffffff; 
    color: var(--color-text); 
    padding: 80px 0; 
    font-size: 0.9rem; 
    border-top: 1px solid var(--color-border);
}

.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 50px; }
footer h4 { color: var(--color-primary); margin-bottom: 20px; font-size: 0.8rem; letter-spacing: 2px; font-weight: 700; }
footer p { color: var(--color-text-light); max-width: 300px; }
footer a { color: var(--color-text-light); display: block; margin-bottom: 10px; transition: color 0.3s ease; }
footer a:hover { color: var(--color-secondary); }
.copyright { margin-top: 60px; border-top: 1px solid var(--color-border); padding-top: 20px; text-align: center; color: var(--color-text-light); font-size: 0.8rem; }


/* =========================================
   8. RESPONSIVIDADE (MEDIA QUERIES)
   ========================================= */

/* --- TABLETS GRANDES (Até 1024px) --- */
@media (max-width: 1024px) {
    .logo { left: 20px; }
    .header-actions { right: 20px; }
    .desktop-nav .nav-list { gap: 24px; }
    .hero h1 { font-size: 2.8rem; }
}

/* --- TABLETS E CELULARES (Até 768px) --- */
@media (max-width: 768px) {
    /* Header */
    :root { --header-height: 70px; }

    .logo { left: 50%; transform: translate(-50%, -50%); }
    .logo-img { height: 75px; }

    .desktop-nav, .btn-header { display: none; }
    .hamburger { display: block; }

    .header-actions {
        right: 12px;
        gap: 0;
    }

    /* Hero */
    .hero h1 { font-size: 2rem; }
    .hero-content { padding-left: 20px; border-left-width: 3px; }
    .hero p { font-size: 1rem; }

    /* Títulos de páginas internas */
    .page-title { font-size: 2rem !important; line-height: 1.2; }
    .page-subtitle { font-size: 1rem !important; padding: 0 20px; }

    /* Grids viram 1 coluna */
    .grid-3, .footer-grid, .about-grid {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    /* Grid de Impacto vira 2 colunas */
    .impact-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px 10px;
    }

    .about-image { min-height: 300px; order: -1; }

    figure {
        margin: 20px -20px !important;
        width: calc(100% + 40px) !important;
    }
    figure img { border-radius: 0 !important; }

    .float-img-right {
        float: none !important;
        width: 260px !important;
        max-width: 70% !important;
        margin: 0 auto 20px !important;
    }
    .float-img-right img { border-radius: 4px !important; }

    .section-padding { padding: 60px 0; }
    .container { padding: 0 16px; }

    /* Footer */
    .footer-grid { gap: 20px; }
}

/* --- CELULARES MÉDIOS (Até 600px) --- */
@media (max-width: 600px) {
    .btn-center-wrapper {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 0 20px;
    }

    .btn-hero,
    .btn-outline {
        display: block;
        width: 100%;
        margin: 0 !important;
        text-align: center;
        padding: 15px 10px;
        font-size: 0.85rem;
    }

    .hero-content { max-width: 100%; }
}

/* --- CELULARES PEQUENOS (Até 480px) --- */
@media (max-width: 480px) {
    .logo { left: 50%; transform: translate(-50%, -50%); }
    .logo-img { height: 64px; }

    .section-title {
        font-size: 1.6rem !important;
        line-height: 1.3;
        word-wrap: break-word;
    }

    .hero h1 { font-size: 1.7rem; }

    .impact-num { font-size: 2rem; }
    .impact-txt { font-size: 0.7rem; letter-spacing: 0.5px; }
    .impact-grid > div { padding: 0 5px; }

    .project-card { height: 320px; }
}

/* --- CELULARES MUITO PEQUENOS (Até 360px) --- */
@media (max-width: 360px) {
    .logo-img { height: 44px; }
    .hero h1 { font-size: 1.4rem; }
    .section-title { font-size: 1.4rem !important; }
}
/* =========================================
   ANIMAÇÃO DE ESCRITA (SEM CURSOR)
   ========================================= */

/* --- Configuração Geral do Texto --- */
.typing-text {
    display: inline-block;
    overflow: hidden; /* Esconde o texto não escrito */
    white-space: nowrap; /* Garante que fique em uma linha durante a animação */
    width: 0; /* Começa invisível */
    margin: 0;
    /* SEM BORDER-RIGHT AQUI */
}

/* --- Título do Hero (2 Linhas) --- */
.hero-title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Alinha à esquerda */
}

/* Linha 1: "SOLUÇÕES AMBIENTAIS" */
.line-1 {
    animation: typing 2s steps(30, end) forwards;
}

/* Linha 2: "INTEGRADAS" (Começa depois) */
.line-2 {
    animation: typing 1.5s steps(20, end) forwards;
    animation-delay: 2s; /* Espera a linha 1 terminar */
}

/* --- Títulos dos Cards (1 Linha) --- */
.card-typing {
    /* A animação roda assim que o elemento aparece */
    animation: typing 2.5s steps(30, end) forwards;
}

/* --- O Movimento (Aumentando a largura) --- */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

/* --- MOBILE (Segurança) --- */
/* No celular, usamos fade-in para evitar quebra de layout */
@media (max-width: 768px) {
    .typing-text, .card-typing {
        white-space: normal;
        width: 100%;
        animation: fadeIn 1.5s ease-out forwards;
    }
    .line-2 { animation-delay: 0.3s; }
}

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