/* @font-face for Angella White is inline in <head> (see index.html) */

/* ==================== BASE STYLES ==================== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    opacity: 0;
    animation: fadeInBody 0.5s ease 0.1s forwards;
}

@keyframes fadeInBody {
    to { opacity: 1; }
}

::selection {
    background: rgba(126, 217, 87, 0.3);
    color: #2a1158;
}

/* ==================== PAPER / GRAIN TEXTURE ==================== */
.texture-grain {
    position: relative;
}

.texture-grain::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.35;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    mix-blend-mode: overlay;
    z-index: 1;
}

.texture-grain-dark::after {
    opacity: 0.12;
    mix-blend-mode: soft-light;
}

/* Ensure content stays above texture */
.texture-grain > * {
    position: relative;
    z-index: 2;
}

/* ==================== NAVBAR ==================== */
#navbar {
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

#navbar.scrolled {
    background: rgba(235, 230, 220, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(42, 15, 78, 0.08);
}

.nav-link {
    color: rgba(42, 17, 88, 0.75);
}
.nav-link:hover {
    color: #2a1158;
}

.hamburger-bar {
    background: #2a1158;
}

/* ==================== HERO PAPER BACKGROUND ==================== */
.hero-paper {
    background-color: #e8e3d6;
    background-image: url('../images/paper-texture.webp');
    background-size: cover;
    background-position: center;
    background-blend-mode: multiply;
}

/* ==================== HERO ANIMATIONS ==================== */
.reveal-up {
    animation: revealUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* ==================== SCROLL REVEAL ==================== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.15s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.25s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.3s; }
.scroll-reveal:nth-child(7) { transition-delay: 0.35s; }
.scroll-reveal:nth-child(8) { transition-delay: 0.4s; }

/* ==================== SECTION DIVIDERS ==================== */
.divider-wave,
.divider-brush {
    position: relative;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 3;
}

.divider-wave svg,
.divider-brush svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ==================== SERVICE CARDS ==================== */
.service-card {
    transform-style: preserve-3d;
    will-change: transform;
}

/* ==================== FEATURE CARDS ==================== */
.feature-card {
    transform-style: preserve-3d;
    will-change: transform;
}

/* ==================== 3D TILT ==================== */
.tilt-card {
    transform-style: preserve-3d;
    will-change: transform;
}

/* ==================== FAQ ==================== */
.faq-item {
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 18px;
    border-radius: 12px;
}

.faq-toggle {
    min-height: 51px;
}

.faq-item.active {
    background: rgba(126, 217, 87, 0.08);
    border-color: rgba(126, 217, 87, 0.45);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: #a8d958;
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.active .faq-content {
    max-height: 500px;
}

/* ==================== TESTIMONIAL CARDS ==================== */
.testimonial-card {
    transform-style: preserve-3d;
    will-change: transform;
}

/* ==================== BRUSH UNDERLINE (Touch Painting) ==================== */
.brush-underline {
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

.brush-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 4px;
    background: #2a1158;
    border-radius: 3px;
    transform: translateX(-50%);
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.6s;
}

/* Variante alinhada à direita — compensa trailing letter-spacing (responsivo) */
.brush-underline-right::after {
    left: auto;
    right: 0.15em;
    transform: none;
}

@media (min-width: 640px) {
    .brush-underline-right::after {
        right: 0.25em;
    }
}

@media (min-width: 768px) {
    .brush-underline-right::after {
        right: 0.4em;
    }
}

#hero .brush-underline {
    padding-bottom: 1.5rem; /* igual ao mt-6 do parágrafo → linha fica centrada */
}

@media (min-width: 768px) {
    #hero .brush-underline {
        padding-bottom: 2rem; /* igual ao mt-8 */
    }
}

#hero .brush-underline::after {
    animation: brushExpand 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

@keyframes brushExpand {
    from { width: 0; }
    to { width: 27%; }
}

.brush-underline.active::after {
    width: 40%;
}

/* ==================== HERO RAINBOW (Angella White script) ==================== */
/* Pivot em right bottom: nenhum canto rotaciona pra direita do bounding box,
   eliminando o overflow geométrico da rotação. Margin-right pequeno absorve
   o swash da fonte script. */
.hero-rainbow {
    display: inline-block;
    transform-origin: right bottom;
    position: relative;
    transform: translateY(-0.2em) rotate(-12deg);
    margin-right: -0.04em;
}

@media (min-width: 768px) {
    .hero-rainbow {
        transform: translateY(-0.3em) rotate(-14deg);
        margin-right: -0.04em;
    }
}

/* Tamanho fluido — referenciado à LARGURA DO HERO (cqw) em vez de viewport (vw).
   Isso garante que a razão Elemento:HeroWidth fique fixa em qualquer aspect
   ratio, evitando que em viewports quadrados o texto transborde
   proporcionalmente mais e cubra o papagaio. */
#hero {
    container-type: inline-size;
}

.hero-rainbow-fluid {
    font-size: clamp(6rem, min(30cqw, 54vh), 47rem);
}

.hero-touch-fluid {
    font-size: clamp(1.3rem, min(3.24cqw, 5.84vh), 4.1rem);
}

.parrot-img-fluid {
    height: clamp(200px, min(52cqw, 92vh), 1000px);
    width: auto;
}

/* Bleeding do papagaio à esquerda em % do hero (cqw). Limite max() em px
   pra que em telas muito grandes o papagaio não fique distante demais
   da borda esquerda (escala proporcional até saturar em -280px). */
.parrot-bleed {
    margin-left: max(-280px, -20cqw);
}

/* Paddings do hero em cqw pra escalar uniformemente — substitui
   pl-4/pr-16 (rem fixos) que mudavam % do viewport entre breakpoints. */
.hero-padding {
    padding-left: 1.5cqw;
    padding-right: 5cqw;
}

/* ==================== NAV TRANSPARENT ON HERO ==================== */
#navbar.nav-hidden-on-hero {
    background: transparent;
    box-shadow: none;
}

#navbar.nav-hidden-on-hero .nav-link {
    color: rgba(42, 15, 78, 0.85);
}

/* ==================== ÊNFASE NOS 10 ANOS ==================== */
.years-highlight {
    display: inline-block;
    padding: 2px 10px;
    background: #a8d958;
    color: #2a0f4e;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: underline;
    text-decoration-color: rgba(42, 15, 78, 0.4);
    text-underline-offset: 3px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.years-highlight:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 15, 78, 0.15);
}

.years-highlight-dark {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(168, 217, 88, 0.25);
    color: #c7e17a;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid rgba(168, 217, 88, 0.4);
}

/* ==================== PHONE MOCKUP ==================== */
.phone-mockup {
    filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.4));
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.phone-mockup:hover {
    transform: translateY(-6px) rotate(-1deg);
}

/* ==================== VIDEO PLACEHOLDER ==================== */
.video-placeholder {
    transition: transform 0.4s ease;
}

.video-placeholder:hover {
    transform: scale(1.01);
}

/* ==================== DULUX BADGE PULSE ==================== */
.dulux-badge {
    animation: duluxPulse 2.4s ease-in-out infinite;
    transform-origin: center;
}

.dulux-badge img {
    filter: drop-shadow(0 4px 12px rgba(0, 80, 180, 0.18));
    transition: filter 0.4s ease, transform 0.4s ease;
}

.dulux-badge:hover img {
    filter: drop-shadow(0 8px 24px rgba(0, 80, 180, 0.4));
    transform: scale(1.05);
}

@keyframes duluxPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* ==================== COUNTER ==================== */
.counter-value {
    font-variant-numeric: tabular-nums;
}

/* (Paint drip animations removed) */

/* ==================== PARALLAX ==================== */
.parallax-layer {
    will-change: transform;
}

/* ==================== FEATURE ICONS ==================== */
.feat-item .feat-icon {
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    width: 80px;
    height: 80px;
}

.feat-item h3 {
    max-width: 160px;
    margin-left: auto;
    margin-right: auto;
}

/* ==================== HERO PARROT ==================== */
.parrot-stage {
    display: inline-block;
    will-change: transform;
    transform-origin: center center;
    filter: drop-shadow(0 20px 30px rgba(126, 217, 87, 0.15));
}

/* Hide parrot until GSAP takes over to avoid flash */
.js-loaded .parrot-stage {
    opacity: 1;
}
.parrot-stage {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .parrot-stage {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ==================== PLACEHOLDER IMAGES ==================== */
.service-img-placeholder {
    transition: opacity 0.3s ease;
}

.service-img-placeholder:has(+ img[src]:not([style*="display: none"])) {
    opacity: 0;
}

/* ==================== WHATSAPP BUTTON ==================== */
@keyframes whatsappPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
}

a[aria-label="WhatsApp"] {
    animation: whatsappPulse 2s infinite;
}

/* ==================== LANGUAGE TOGGLE ==================== */
.lang-toggle {
    background: rgba(126, 217, 87, 0.18);
    border: 1px solid rgba(126, 217, 87, 0.35);
}

.lang-btn {
    color: #ffffff;
    cursor: pointer;
}

.lang-btn.active {
    background: #7ED957;
    color: #110824;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.lang-btn:not(.active):hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .feature-card {
        padding: 1rem;
    }

    .feature-card h3 {
        font-size: 0.75rem;
    }

    .feature-card .w-14 {
        width: 2.5rem;
        height: 2.5rem;
    }

    .feature-card .w-14 svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .divider-wave,
    .divider-brush {
        height: 50px;
    }
}

@media (max-width: 640px) {
    .divider-wave,
    .divider-brush {
        height: 40px;
    }
}

@media (min-width: 769px) {
    .divider-wave,
    .divider-brush {
        height: 80px;
    }
}

/* ==================== ACABAMENTOS CAROUSEL (mobile-only) ==================== */
.acabamentos-carousel {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.acabamentos-carousel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Force line-clamp on mobile descriptions (Tailwind utility flaky on Safari) */
@media (max-width: 767px) {
    .acabamentos-carousel > div > p:last-child {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        overflow: hidden;
    }

    /* Force same min-height on all cards to keep layout consistent during pin */
    .acabamentos-carousel > div {
        align-self: stretch;
        display: flex;
        flex-direction: column;
    }
}

/* ==================== CUSTOM SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2a1158;
}

::-webkit-scrollbar-thumb {
    background: #4a2080;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6a3aa0;
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .scroll-reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    .reveal-up {
        animation: none !important;
        opacity: 1 !important;
    }

    .parallax-layer,
    .parallax-text {
        transform: none !important;
    }
}
