:root {
    --bg-base: #020309;
    --bg-layer: #040817;
    --bg-glow: rgba(9, 35, 84, 0.45);
    --accent-cyan: #3be0ff;
    --accent-green: #1ef4b9;
    --text-main: #f5f9ff;
    --text-soft: #9bb5d6;
    --border-soft: rgba(59, 224, 255, 0.18);
    --border-strong: rgba(59, 224, 255, 0.4);
    --surface: rgba(6, 14, 28, 0.78);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --transition: 200ms ease;
    font-size: 16px;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: radial-gradient(circle at 20% -10%, rgba(59, 224, 255, 0.2) 0, transparent 50%), radial-gradient(circle at 80% 0%, rgba(30, 244, 185, 0.18) 0, transparent 45%), var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: -40%;
    background: conic-gradient(from 120deg, rgba(59, 224, 255, 0.08), transparent 35%, rgba(30, 244, 185, 0.05), transparent 75%);
    animation: rotateGlow 28s linear infinite;
    z-index: -3;
}

@keyframes rotateGlow {
    to {
        transform: rotate(360deg);
    }
}

#particles-js {
    position: fixed;
    inset: 0;
    z-index: -2;
}

.wrap {
    width: 100%;
    max-width: 460px; /* Instagram fix: substitui min() para compatibilidade com WebView */
    padding: 28px 24px 22px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    backdrop-filter: blur(26px);
    box-shadow: 0 30px 80px rgba(2, 5, 15, 0.65);
    display: grid;
    gap: 18px;
    text-align: center;
}

.hero-stack {
    display: grid;
    gap: 6px;
    justify-items: center;
}

.tagline {
    max-width: 320px;
    font-size: 0.85rem;
    color: rgba(155, 181, 214, 0.88);
    line-height: 1.45;
    margin-top: 6px;
    margin-bottom: -18px;
}

.logo-frame {
    position: relative;
    width: 140px;
    height: 140px;
}

.logo-badge,
.carousel-frame {
    position: absolute;
    inset: 0;
    width: 128px;
    height: 128px;
    border-radius: 24px;
    opacity: 0;
    transform: translateX(0);
    pointer-events: none;
    transition: transform 0.7s ease, opacity 0.7s ease;
}

.logo-badge {
    background: #ffffff;
    display: grid;
    place-items: center;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35), 0 0 22px rgba(59, 224, 255, 0.3);
    border: 1px solid rgba(8, 12, 25, 0.1);
}

.logo-badge img {
    width: 78%;
    height: auto;
}

.logo-frame .is-active {
    opacity: 1;
    pointer-events: auto;
}

.logo-frame .slide-left {
    transform: translateX(-160px);
}

.logo-frame .slide-right {
    transform: translateX(160px);
}

.logo-frame .return-center {
    transform: translateX(0);
}

.carousel-frame {
    background: rgba(6, 12, 24, 0.92);
    box-shadow: 0 16px 40px rgba(10, 24, 48, 0.5);
    border: 1px solid var(--border-soft);
    overflow: hidden;
}

.carousel-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-label {
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.3em;
    color: rgba(59, 224, 255, 0.8);
}

.links {
    display: grid;
    gap: 14px;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    padding: 11px 12px;
    background: rgba(7, 14, 26, 0.58);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: border-color var(--transition), transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.link-card span {
    flex: 1;
    text-align: center;
}

.link-card i {
    font-size: 1.2rem;
    color: var(--accent-cyan);
}

.link-card img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.link-card:hover {
    border-color: var(--border-strong);
    background: rgba(10, 20, 38, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(9, 25, 55, 0.45);
}

.primary-link {
    margin-top: 36px;
    width: 100%;
}

/* Instagram fix: ajustes específicos para o WebView do Instagram */
.ig-webview body {
    width: 100vw;
    overflow-x: hidden;
}

.ig-webview .wrap {
    width: 100vw;
    max-width: 480px;
    padding: 24px 18px 20px;
    margin: 0 auto;
}

.ig-webview .hero-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ig-webview .logo-frame {
    width: 136px;
    height: 136px;
}

.ig-webview .logo-badge,
.ig-webview .carousel-frame {
    width: 136px;
    height: 136px;
    transform: none !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease !important;
}

.ig-webview .logo-frame .is-active {
    opacity: 1;
    pointer-events: auto;
}

.ig-webview .logo-frame .slide-left,
.ig-webview .logo-frame .slide-right,
.ig-webview .logo-frame .return-center {
    transform: none !important;
}

.ig-webview .link-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.ig-webview .link-grid .link-card {
    flex: 1 1 calc(50% - 12px);
    max-width: 220px;
}

.ig-webview [data-animate] {
    transform: translate3d(0, 12px, 0);
}


.footer {
    display: grid;
    gap: 12px;
    justify-items: center;
}

.social-links {
    display: flex;
    gap: 14px;
}

.social-links a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-soft);
    display: grid;
    place-items: center;
    color: var(--text-main);
    font-size: 1.3rem;
    transition: transform var(--transition), border-color var(--transition), color var(--transition), background var(--transition);
}

.social-links a:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    color: var(--accent-cyan);
    background: rgba(10, 22, 44, 0.85);
}

[data-animate] {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: var(--animate-delay, 0s);
}

[data-animate="fade"].is-visible,
.wrap.is-visible {
    opacity: 1;
    transform: none;
}

#gatinho {
    position: fixed;
    width: 90px;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
}

@media (max-height: 740px) {
    body {
        padding: 18px 12px;
    }

    .wrap {
        padding: 20px;
        gap: 16px;
    }

    .logo-frame {
        width: 120px;
        height: 120px;
    }

    .logo-badge,
    .carousel-frame {
        width: 120px;
        height: 120px;
        border-radius: 20px;
    }

    .primary-link {
        margin-top: 62px;
    }
}

@media (max-width: 420px) {
    body {
        padding: 18px 12px;
    }

    .wrap {
        padding: 18px;
    }

    .logo-frame {
        width: 120px;
        height: 120px;
    }

    .primary-link {
        margin-top: 56px;
    }

    .link-card {
        font-size: 0.9rem;
        padding: 11px 14px;
    }

    #gatinho {
        width: 72px;
    }
}
/* ======= FIX INSTAGRAM WEBVIEW E SAFARI ======= */
img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    transform: translateZ(0); /* corrige bugs de escala no iOS WebView */
    image-rendering: -webkit-optimize-contrast;
    -webkit-transform: translateZ(0); /* corrige bugs de escala no iOS WebView */
}

/* Evita zoom e overflow em contêineres */
.logo-badge img,
.carousel-frame img,
.link-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Garante que o body nunca seja escalado além da viewport */
html,
body {
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
    -webkit-overflow-scrolling: touch;
}
