/* ==========================================================================
   Primatech — Página inicial (index.php)
   Visual limpo e dinâmico, somente CSS (animações e filtro por :target).
   Carregado via includes/head.php, depois de variables.css e base.css.
   ========================================================================== */

/* ===================================
   ANIMAÇÕES
   =================================== */

@keyframes home-blob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(40px, -30px) scale(1.08); }
    66%      { transform: translate(-30px, 25px) scale(0.95); }
}

@keyframes home-gradient {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

@keyframes home-fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}


@keyframes home-bounce {
    0%, 100% { transform: translate(-50%, 0); opacity: 1; }
    50%      { transform: translate(-50%, 8px); opacity: 0.6; }
}

/* ===================================
   HERO
   =================================== */

.home-hero {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--navbar-height) + 40px) 5% 100px;
    background: var(--color-background);
    overflow: hidden;
    text-align: center;
}

.home-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.45;
    animation: home-blob 16s ease-in-out infinite;
    pointer-events: none;
}

.home-blob.b1 { width: 420px; height: 420px; background: var(--color-primary);   top: -80px;  left: -100px; }
.home-blob.b2 { width: 360px; height: 360px; background: var(--color-secondary); bottom: -60px; right: -80px; animation-delay: -5s; }
.home-blob.b3 { width: 260px; height: 260px; background: var(--color-accent);    top: 40%;    left: 55%;   opacity: 0.25; animation-delay: -10s; }

.home-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 820px;
}

.home-hero-inner > * {
    animation: home-fade-up 0.8s ease both;
}

.home-hero-inner > *:nth-child(2) { animation-delay: 0.1s; }
.home-hero-inner > *:nth-child(3) { animation-delay: 0.2s; }
.home-hero-inner > *:nth-child(4) { animation-delay: 0.3s; }
.home-hero-inner > *:nth-child(5) { animation-delay: 0.4s; }

.home-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--color-border);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 28px;
}

.home-pill i {
    color: var(--color-secondary);
}

.home-hero h1 {
    font-size: clamp(40px, 7vw, 76px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -1.5px;
    margin-bottom: 22px;
}

.home-gradient-text {
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent), var(--color-primary));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: home-gradient 8s ease infinite;
}

.home-hero p {
    font-size: clamp(17px, 2.2vw, 21px);
    color: var(--color-text-muted);
    margin-bottom: 36px;
}

.home-hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 56px;
}

/* Bolhas de aplicativos no hero */
.home-bubbles {
    display: flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
}

.home-bubble {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px 10px 10px;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow);
    font-weight: 600;
    font-size: 15px;
    color: var(--color-text);
    /* FIX: sem animação contínua (causava tremor); apenas leve elevação no hover */
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.home-bubble:hover,
.home-bubble:focus-visible {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.home-bubble-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    background: var(--cor, var(--color-primary));
}

.home-scroll {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    color: var(--color-text-muted);
    font-size: 22px;
    animation: home-bounce 2s ease-in-out infinite;
}

/* ===================================
   SEÇÕES
   =================================== */

.home-section {
    padding: 96px 5%;
}

.home-section.alt {
    background: var(--color-background);
}

.home-title {
    text-align: center;
    margin-bottom: 40px;
}

.home-title h2 {
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}

.home-title p {
    font-size: 18px;
    color: var(--color-text-muted);
}

/* ===================================
   APLICATIVOS + FILTRO (somente CSS, via :target)
   =================================== */

.home-apps {
    max-width: var(--container);
    margin: 0 auto;
}

.filter-target {
    display: block;
    position: relative;
    top: calc(-1 * var(--navbar-height) - 20px);
    visibility: hidden;
}

.filter-bar {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.filter-bar a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--color-border);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
}

.filter-bar a:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* "Todos" ativo por padrão; os demais estados são gerados no index.php */
.filter-bar .pill-todos {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.filter-target:target ~ .filter-bar .pill-todos {
    background: #fff;
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.app-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    border: 1px solid var(--color-border);
    overflow: hidden;
    animation: home-fade-up 0.6s ease both;
    animation-delay: calc(var(--i, 0) * 80ms);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.app-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--cor, var(--color-primary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
}

.app-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.app-card:hover::before {
    transform: scaleX(1);
}

.app-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    background: var(--cor, var(--color-primary));
    margin-bottom: 22px;
    transition: transform 0.3s ease;
}

.app-card:hover .app-card-icon {
    transform: rotate(-8deg) scale(1.08);
}

.app-card-tag {
    position: absolute;
    top: 28px;
    right: 28px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.app-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.app-card p {
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.55;
    flex-grow: 1;
    margin-bottom: 20px;
}

.app-card-go {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--color-primary);
    transition: gap 0.2s ease;
}

.app-card:hover .app-card-go {
    gap: 14px;
}

.app-card.soon {
    border: 2px dashed var(--color-border);
    background: transparent;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-text-muted);
    min-height: 220px;
}

.app-card.soon:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--color-border);
}

.app-card.soon::before {
    display: none;
}

.app-card.soon i {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--color-secondary);
}

.app-card.soon strong {
    color: var(--color-text);
}

/* ===================================
   VANTAGENS
   =================================== */

.perks {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.perk {
    text-align: center;
    padding: 32px 20px;
    border-radius: 20px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.perk:hover {
    background: #fff;
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.perk-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--cor, var(--color-primary));
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.perk:hover .perk-icon {
    transform: scale(1.1) rotate(6deg);
}

.perk h3 {
    font-size: 20px;
    margin-bottom: 6px;
}

.perk p {
    color: var(--color-text-muted);
    font-size: 15px;
}

/* ===================================
   PASSOS
   =================================== */

.steps {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: relative;
}

.steps::before {
    content: '';
    position: absolute;
    top: 32px;
    left: 16.6%;
    right: 16.6%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent));
    opacity: 0.35;
}

.step {
    text-align: center;
    position: relative;
}

.step-num {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    background: var(--cor, var(--color-primary));
    box-shadow: 0 0 0 8px var(--color-surface);
    transition: transform 0.3s ease;
}

.step:hover .step-num {
    transform: scale(1.1);
}

.step h3 {
    font-size: 19px;
    margin-bottom: 4px;
}

.step p {
    color: var(--color-text-muted);
    font-size: 15px;
}

/* ===================================
   CHAMADA FINAL
   =================================== */

.home-cta {
    margin: 96px 5%;
    padding: 64px 5%;
    border-radius: 28px;
    text-align: center;
    color: #fff;
    background: linear-gradient(120deg, var(--color-primary), var(--color-secondary), var(--color-primary-dark));
    background-size: 200% 200%;
    animation: home-gradient 10s ease infinite;
}

.home-cta h2 {
    color: #fff;
    font-size: clamp(28px, 4vw, 40px);
    margin-bottom: 10px;
}

.home-cta p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 28px;
}

/* ===================================
   ANÚNCIOS (Google AdSense)
   =================================== */

.ad-side {
    position: fixed;
    top: calc(var(--navbar-height) + 30px);
    width: 160px;
    z-index: 10;
    display: none;
}

.ad-side-left  { left: 16px; }
.ad-side-right { right: 16px; }

/* Laterais só aparecem quando há espaço ao lado do conteúdo */
@media (min-width: 1600px) {
    .ad-side {
        display: block;
    }
}

.ad-bottom {
    padding: 0 5% 64px;
}

.ad-bottom .container {
    max-width: 970px;
}

.ad-placeholder {
    border: 2px dashed #CBD5E1;
    border-radius: var(--radius-sm);
    color: #94A3B8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    background: rgba(255, 255, 255, 0.6);
}

/* ===================================
   RESPONSIVO
   =================================== */

@media (max-width: 767px) {
    .home-hero {
        min-height: auto;
        padding-bottom: 80px;
    }

    .home-hero-actions .btn-primary,
    .home-hero-actions .btn-secondary {
        width: 100%;
    }

    .home-scroll {
        display: none;
    }

    .home-section {
        padding: 72px 5%;
    }

    .perks,
    .steps {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .steps::before {
        display: none;
    }

    .home-cta {
        margin: 64px 5%;
        border-radius: 20px;
    }
}
