*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f9f8f6;
    color: #0f1117;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ── TOKENS ── */
:root {
    --ink: #0f1117;
    --paper: #f9f8f6;
    --white: #ffffff;
    --gold: #b8956a;
    --gold-light: #d4b896;
    --gold-dark: #8a6a44;
    --muted: #5c5f66;
    --border: #e2ddd7;
    --surface: #ffffff;
    --section-alt: #f3f0eb;

    --nav-h: 72px;
    --z-nav: 50;
    --z-fab: 40;
}

/* ── NAVBAR ── */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    z-index: var(--z-nav);
    transition: background 0.35s ease, box-shadow 0.35s ease;
}

#navbar.scrolled {
    background: var(--white);
    box-shadow: 0 1px 0 var(--border);
}

#navbar .nav-link {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 0.2s;
    white-space: nowrap;
}

#navbar .nav-link:hover {
    color: var(--ink);
}

#navbar.scrolled .nav-link {
    color: var(--muted);
}

/* ── HERO ── */
#hero {
    min-height: 100svh;
    background: var(--ink);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(150deg, rgba(184, 149, 106, 0.12) 0%, transparent 55%),
        linear-gradient(to bottom, rgba(15, 17, 23, 0.2) 0%, rgba(15, 17, 23, 0.85) 100%);
    z-index: 1;
}

#hero-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.05),
            rgba(0, 0, 0, 0.15)),
        url('../img/hero.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

#hero-bg::before {
    content: '';
    position: absolute;
    top: 8%;
    right: 6%;
    width: min(420px, 40vw);
    height: min(420px, 40vw);
    border: 1px solid rgba(184, 149, 106, 0.18);
    z-index: 1;
}

#hero-bg::after {
    content: '';
    position: absolute;
    top: calc(8% + 28px);
    right: calc(6% + 28px);
    width: min(420px, 40vw);
    height: min(420px, 40vw);
    border: 1px solid rgba(184, 149, 106, 0.09);
    z-index: 1;
}

#hero .content {
    position: relative;
    z-index: 2;
}

/* ── DIVIDER ── */
.gold-rule {
    display: block;
    width: 48px;
    height: 2px;
    background: var(--gold);
}

/* ── EYEBROW ── */
.eyebrow {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}

/* ── SERVICE CARDS ── */
.service-card {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 2rem;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.service-card:hover {
    box-shadow: 0 8px 32px rgba(15, 17, 23, 0.08);
    border-color: var(--gold-light);
    transform: translateY(-2px);
}

/* ── DIFF ITEMS ── */
.diff-item {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

/* ── FORM ── */
input,
textarea,
select {
    font-family: inherit;
    font-size: 0.9375rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 0.75rem 1rem;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    color: var(--ink);
    /* Prevent zoom on focus in iOS */
    font-size: max(16px, 0.9375rem);
}

input:focus,
textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184, 149, 106, 0.12);
}

input.error,
textarea.error {
    border-color: #c0392b;
}

.field-error {
    font-size: 0.8125rem;
    color: #c0392b;
    margin-top: 0.25rem;
    display: none;
}

.field-error.show {
    display: block;
}

/* ── BUTTONS ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    background: var(--gold);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.875rem 1.75rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    border-radius: 0;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--gold-dark);
    box-shadow: 0 4px 16px rgba(138, 106, 68, 0.35);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    background: transparent;
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.875rem 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.7);
}

/* ── FAB ── */
#fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: var(--z-fab);
    width: 56px;
    height: 56px;
    background: #25d366;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0;
    text-decoration: none;
}

#fab:hover {
    transform: scale(1.07);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

/* ── FADE-IN REVEAL ── */
.reveal {
    opacity: 1;
    transform: translateY(0);
}

.reveal-init {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (prefers-reduced-motion: reduce) {
    .reveal-init {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ── STRIP BAR ── */
.strip {
    background: var(--ink);
    color: var(--white);
}

/* ── MAP EMBED ── */
.map-frame {
    width: 100%;
    height: 280px;
    border: none;
    filter: grayscale(20%) contrast(1.05);
    display: block;
}

/* ── TESTIMONIALS PLACEHOLDER ── */
.testimonials-placeholder {
    border: 1.5px dashed var(--border);
    padding: 3rem 2rem;
    text-align: center;
    color: var(--muted);
    background: var(--white);
}

/* ── SECTION SPACING ── */
section {
    padding: 6rem 0;
}

/* ── MOBILE NAV MENU ── */
#mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--nav-h);
    background: var(--white);
    z-index: calc(var(--z-nav) - 1);
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border);
    overflow-y: auto;
}

#mobile-menu.open {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ── SOBRE: accent block responsive ── */
.sobre-accent {
    position: absolute;
    bottom: -1.5rem;
    right: -1.5rem;
    width: 140px;
    height: 140px;
    background: var(--gold);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

/* ── DIFERENCIAIS stat block ── */
.stat-block {
    background: var(--ink);
    padding: 3rem 2.5rem;
}

.stat-cta {
    background: var(--gold);
    padding: 2rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* ══════════════════════════════════
   RESPONSIVE — TABLET (max 1024px)
══════════════════════════════════ */
@media (max-width: 1024px) {
    #navbar .hidden.md\:flex {
        gap: 1.25rem;
    }
}

/* ══════════════════════════════════
   RESPONSIVE — MOBILE (max 767px)
══════════════════════════════════ */
@media (max-width: 767px) {

    /* Section spacing */
    section {
        padding: 3.5rem 0;
    }

    /* Hero decorative squares hidden on small screens */
    #hero-bg::before,
    #hero-bg::after {
        display: none;
    }

    /* Hero text padding */
    #hero .content {
        padding-bottom: 3rem !important;
    }

    /* Hero buttons: full width stack */
    #hero .flex.flex-wrap {
        flex-direction: column;
        gap: 0.75rem;
    }

    #hero .flex.flex-wrap .btn-primary,
    #hero .flex.flex-wrap .btn-ghost {
        width: 100%;
        justify-content: center;
    }

    /* Strip: 1 column on very small */
    .strip .grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    /* Sobre: image aspect ratio adjusted */
    #sobre .grid {
        gap: 2.5rem;
    }

    /* Sobre accent block smaller on mobile */
    .sobre-accent {
        width: 100px;
        height: 100px;
        bottom: -1rem;
        right: -0.75rem;
    }

    .sobre-accent span:first-child {
        font-size: 1.75rem !important;
    }

    .sobre-accent span:last-child {
        font-size: 0.5625rem !important;
    }

    /* Stats grid in Sobre */
    #sobre .grid.grid-cols-2 {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }

    /* Serviços: 1 column on mobile */
    #servicos .grid.sm\:grid-cols-2 {
        grid-template-columns: 1fr;
    }

    /* Stat block paddings reduced */
    .stat-block {
        padding: 2rem 1.5rem;
    }

    .stat-block p:first-child,
    .stat-block p:nth-child(2) {
        font-size: 2.5rem !important;
    }

    .stat-cta {
        padding: 1.5rem;
        flex-wrap: wrap;
    }

    /* Contact grid: single column */
    #contato .grid.md\:grid-cols-2 {
        grid-template-columns: 1fr;
    }

    /* Form padding */
    #contato .bg-section-alt {
        padding: 1.5rem !important;
    }

    /* Footer grid: single column */
    footer .grid.sm\:grid-cols-2 {
        grid-template-columns: 1fr;
    }

    /* Footer bottom: stack */
    footer .flex.flex-wrap.items-center.justify-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* FAB position adjusted so it doesn't cover content */
    #fab {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }

    /* CTA band padding */
    div[style*="padding:5rem"] {
        padding: 3rem 1.25rem !important;
    }

    /* Map height */
    .map-frame {
        height: 220px;
    }
}

/* ══════════════════════════════════
   RESPONSIVE — SMALL MOBILE (max 480px)
══════════════════════════════════ */
@media (max-width: 480px) {

    /* Strip: 1 column */
    .strip .grid {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }

    /* Sobre accent: hide on tiny screens */
    .sobre-accent {
        display: none;
    }

    /* Service cards padding */
    .service-card {
        padding: 1.5rem;
    }

    /* Form container padding */
    #contato [style*="padding:2.5rem"] {
        padding: 1.25rem !important;
    }

    /* Buttons full width in mobile */
    .btn-primary.w-full {
        width: 100%;
    }
}
