/* Estilos só da página home (app/Views/home.php). Carregado depois do base.css. */

.home-hero {
    position: relative;
    display: grid;
    place-items: center;
    min-height: max(520px, 85svh);
    padding-block: 96px;
    overflow: hidden;
    text-align: center;
    color: #fff;
    background: var(--navy-dark);

    .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
    /* com picture "contents", o <source> viraria uma linha vazia do grid e empurraria o texto para baixo */
    source { display: none; }

    &::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 1;
        background:
            radial-gradient(rgba(251, 252, 255, 0.12) 1.4px, transparent 1.6px) 0 0 / 45px 45px,
            radial-gradient(ellipse at center, rgba(18, 32, 50, 0.55) 0%, rgba(18, 32, 50, 0.3) 70%);
    }

    /* estrelas em canvas (app.js); sem JS fica a grade de pontos do ::before */
    .stars { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }

    .content { position: relative; z-index: 2; max-width: calc(980px + 2 * var(--gutter)); }
    .eyebrow { margin-bottom: 10px; }
    .lead { max-width: 900px; margin: 28px auto 0; color: rgba(255, 255, 255, 0.9); }

    .cue {
        position: absolute;
        bottom: 40px;
        left: 50%;
        z-index: 2;
        translate: -50% 0;
        display: grid;
        place-items: center;
        width: 48px;
        height: 48px;
        color: #fff;
        animation: scroll-cue 2.2s ease-in-out infinite;

        .icon { width: 30px; height: 30px; }
    }
}

@keyframes scroll-cue {
    0%, 100% { transform: translateY(0); opacity: 0.8; }
    50% { transform: translateY(8px); opacity: 1; }
}

.markets {
    padding-top: var(--section-y);
    background: var(--white);

    .head {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        justify-content: space-between;
        gap: 28px 48px;
        margin-bottom: clamp(40px, 5vw, 64px);

        > div { max-width: 830px; }
        .lead { margin-top: 12px; }
    }

    .panel {
        position: relative;
        overflow: hidden;
        color: #fff;
        background: linear-gradient(-127deg, var(--accent) 19%, var(--accent-dark) 118%);
    }

    .base { position: relative; padding: 48px var(--gutter); }
    .image { width: 200px; height: auto; aspect-ratio: 260 / 240; object-fit: contain; margin-bottom: 28px; }
    h3 { font-family: var(--font-display); font-size: clamp(2rem, 1.6rem + 1.4vw, 3rem); font-weight: 700; line-height: 1; }
    .summary { max-width: 540px; margin-top: 14px; font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.5rem); line-height: 1.4; transition: opacity 0.4s ease; }
    .text .btn { margin-top: 26px; color: var(--accent); transition: opacity 0.4s ease; }

    .products { display: grid; gap: 12px; padding: 0 var(--gutter) 48px; }

    /* mobile: o botão vem depois dos produtos */
    .after-products { display: none; }
    @media (max-width: 767px) {
        .text .btn { display: none; }
        .products { padding-bottom: 28px; }
        .after-products { display: inline-flex; margin: 0 var(--gutter) 48px; color: var(--accent); }
    }

    .product {
        display: flex;
        gap: 14px;
        align-items: flex-start;
        padding: 16px 18px 16px 22px;
        border-radius: var(--radius);
        background: linear-gradient(90deg, var(--accent-tint) 0%, #fff 100%);
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
        color: var(--ink);

        img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
        h4 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; line-height: 1.15; color: var(--accent); }
        p { margin-top: 6px; font-size: 0.875rem; line-height: 1.3; }

        .links {
            display: flex;
            flex-wrap: wrap;
            gap: 4px 8px;
            margin-top: 10px;
            font-family: var(--font-display);
            font-size: 0.8125rem;
            font-weight: 500;
            color: var(--accent);

            a:hover { text-decoration: underline; }
        }
    }

    @media (min-width: 768px) and (max-width: 1279px) {
        .panel { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
        .products { padding: 48px var(--gutter) 48px 0; }
    }

    /* Painéis horizontais que expandem no hover */
    @media (min-width: 1280px) {
        .panels { display: flex; height: 674px; }
        .panel { flex: 1 1 0; min-width: 0; transition: flex-grow 0.9s var(--ease); }
        .panel.is-open { flex-grow: 3.3; }

        .base { position: absolute; inset: 0 auto 0 0; width: 100%; padding: 0; transition: width 0.9s var(--ease); }
        .is-open .base { width: 54%; }

        .image {
            position: absolute;
            top: 80px;
            left: 50%;
            width: 260px;
            margin: 0;
            translate: -50% 0;
            transition: scale 0.9s var(--ease), filter 0.4s ease;
        }
        .is-open .image { filter: drop-shadow(0 24px 22px rgba(0, 0, 0, 0.35)); }

        .text { position: absolute; left: 50px; right: 50px; bottom: 50px; }
        .summary { min-height: 2.8em; }

        .products {
            position: absolute;
            inset: 0 0 0 auto;
            width: 46%;
            align-content: center;
            padding: 24px 40px 24px 0;
            opacity: 0;
            visibility: hidden;
            translate: 24px 0;
            transition: opacity 0.4s ease, translate 0.6s var(--ease), visibility 0.4s;
        }
        .is-open .products { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 0.35s; }

        .panels.has-open .panel:not(.is-open) {
            .image { scale: 0.82; }
            .summary, .text .btn { opacity: 0; }
        }
    }
}

.statement {
    .accent-line { margin-bottom: 26px; }
    /* imagem menor: a seção fica na altura do texto */
    .media.contain img { max-width: 340px; }

    .title {
        font-family: var(--font-display);
        font-size: clamp(1.875rem, 1.4rem + 1.7vw, 2.9rem);
        font-weight: 700;
        line-height: 1.18;
        letter-spacing: -0.012em;
        color: var(--navy);
    }

    .pillars {
        margin-top: 28px;
        font-family: var(--font-display);
        font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.75rem);
        line-height: 1.5;
        color: var(--navy);
    }
}

.numbers {
    display: grid;
    gap: 48px;
    align-items: center;

    @media (min-width: 1100px) { grid-template-columns: 0.55fr 1fr; gap: 64px; }

    .h3 { font-size: clamp(1.75rem, 1.3rem + 1.2vw, 2.5rem); }
    .intro-text { margin-top: 20px; font-size: 1.25rem; font-weight: 300; line-height: 1.4; }
    .intro .btn { margin-top: 32px; color: var(--blue); }

    .grid {
        display: grid;
        gap: 22px;
        @media (min-width: 640px) { grid-template-columns: 1fr 1fr; }
    }

    .stat {
        position: relative;
        display: flex;
        min-height: 196px;
        overflow: hidden;
        border-radius: var(--radius);
        background: #fff;
        color: var(--ink);

        .body { position: relative; z-index: 1; flex: 1; padding: 22px 28px; }
        .value { font-family: var(--font-display); font-size: clamp(2.5rem, 2rem + 1.4vw, 3.625rem); font-weight: 600; line-height: 1; color: var(--blue); }
        .label { margin-top: 6px; font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; color: var(--ink); }
        .text { margin-top: 6px; font-size: 0.9375rem; line-height: 1.4; color: var(--muted); }
        img { width: 42%; object-fit: cover; clip-path: ellipse(100% 78% at 100% 50%); }
    }
}

.principles {
    display: grid;
    gap: 24px;

    @media (min-width: 640px) { grid-template-columns: 1fr 1fr; }
    @media (min-width: 1100px) { grid-template-columns: repeat(4, 1fr); }

    li {
        position: relative;
        padding: 34px 32px 38px;
        border: 1px solid var(--line);
        border-radius: var(--radius-lg);
        background: linear-gradient(180deg, #fff 0%, #f2f5fb 100%);
        box-shadow: var(--shadow-sm);
    }

    .number {
        position: absolute;
        top: 15px;
        right: 26px;
        font-family: var(--font-display);
        font-size: 3.5rem;
        font-weight: 700;
        line-height: 1;
        color: rgba(52, 108, 172, 0.16);
    }

    .accent-line { height: 2px; }
    h3 { margin-top: 0px; max-width: 80%; font-family: var(--font-display); font-size: clamp(1.25rem, 1.1rem + 0.4vw, 1.5625rem); font-weight: 700; line-height: 1.2; color: var(--navy); }
    p { margin-top: 14px; font-size: 1.0625rem; font-weight: 300; line-height: 1.55; color: var(--muted); }
}

.two-ways {
    .mark {
        position: absolute;
        right: -3%;
        bottom: 20%;
        width: min(620px, 70vw);
        color: rgba(156, 195, 242, 0.18);
    }

    .grid {
        position: relative;
        display: grid;
        gap: 64px;

        @media (min-width: 1100px) { grid-template-columns: 1fr 1fr; gap: 0; }
    }

    .col {
        max-width: 700px;

        p { max-width: 620px; margin-top: 24px; font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.25rem); font-weight: 300; line-height: 1.6; }
        .btn, .link { margin-top: 40px; }

        @media (min-width: 1100px) {
            & + .col { padding-left: clamp(48px, 5vw, 120px); border-left: 1px solid rgba(255, 255, 255, 0.12); }
        }
    }
}

/* Intro da home: só aparece com html.intro (script no <head>); app.js anima e remove.
   Se o JS falhar, some sozinho depois de 5s. */
.intro-overlay { display: none; }

.intro .intro-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    color: var(--navy-dark);
    animation: intro-failsafe 0s 5s forwards;

    svg { display: block; width: 100%; height: 100%; }
    .mark { fill: #fff; opacity: 0; } /* começa invisível: o app.js (defer) faz o fade in, sem "salto" no carregamento */
}

@keyframes intro-failsafe { to { visibility: hidden; } }
