/* ==========================================================================
   JV Marcenaria — Sistema visual
   Mobile first · WCAG 2.2 AA · Bootstrap 5.3 como base de grid/utilitários
   Índice: 1 Tokens · 2 Base · 3 Acessibilidade · 4 Botões · 5 Header
           6 Hero · 7 Seções · 8 Serviços · 9 Projetos · 10 Processo
           11 Sobre · 12 Contato/Form · 13 Footer · 14 FAB · 15 Motion
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
    /* Cores (contrastes verificados contra os fundos de uso) */
    --ink: #1f1a17;
    --ink-soft: #4d453f;
    --bg: #faf7f2;
    --surface: #ffffff;
    --line: #e6ddd0;
    --brand: #f0852d;          /* laranja da marca (fundos de botão, com texto escuro) */
    --brand-hover: #f59a4d;
    --brand-text: #a84a08;     /* laranja para TEXTO sobre claro */
    --brand-soft: #fdebdb;
    --dark: #211b17;
    --dark-2: #2d2520;
    --on-dark: #f5efe8;
    --on-dark-soft: #cfc3b6;
    --wa: #0f7a43;             /* verde WhatsApp acessível (texto branco) */
    --wa-hover: #0b6236;
    --danger: #b3261e;
    --focus: #1f1a17;

    /* Espaçamento (escala de 8px) */
    --s1: .5rem;  --s2: 1rem;  --s3: 1.5rem;  --s4: 2rem;
    --s5: 3rem;   --s6: 4rem;  --s7: 6rem;

    /* Raios e sombras */
    --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(33,27,23,.06), 0 2px 8px rgba(33,27,23,.05);
    --shadow-md: 0 10px 30px rgba(33,27,23,.10);
    --shadow-lg: 0 22px 50px rgba(33,27,23,.16);

    /* Tipografia */
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;

    --header-h: 72px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* 2. BASE ------------------------------------------------------------------ */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.01em;
    color: var(--ink);
    text-wrap: balance;
}
h1 { font-size: clamp(2.125rem, 6.2vw + .5rem, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.4vw + .7rem, 2.75rem); }
h3 { font-size: 1.3125rem; }
p  { max-width: 68ch; text-wrap: pretty; }
a  { color: var(--brand-text); text-underline-offset: .2em; }
a:hover { color: var(--ink); }
img { max-width: 100%; height: auto; }

.section { padding-block: var(--s6); }
@media (min-width: 992px) { .section { padding-block: var(--s7); } }

.eyebrow {
    display: inline-block;
    margin-bottom: var(--s2);
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--brand-text);
}
.section-head { max-width: 40rem; margin-bottom: var(--s5); }
.section-head p { color: var(--ink-soft); font-size: 1.125rem; margin-bottom: 0; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center p { margin-inline: auto; }

/* 3. ACESSIBILIDADE -------------------------------------------------------- */
.skip-link {
    position: fixed; top: 8px; left: 8px; z-index: 2000;
    padding: .75rem 1.25rem;
    background: var(--ink); color: #fff; font-weight: 600;
    border-radius: var(--r-sm); text-decoration: none;
    transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: #fff; }

:focus-visible,
a:focus-visible, button:focus-visible, summary:focus-visible,
.nav-link:focus-visible, .btn:focus-visible, .navbar-toggler:focus-visible,
.btn-close:focus-visible, .form-control:focus-visible, .form-select:focus-visible {
    outline: 3px solid var(--focus) !important;   /* !important: o Bootstrap zera o outline nesses componentes */
    outline-offset: 3px;
    border-radius: 4px;
}
.btn:focus-visible, .btn-ghost:focus-visible { border-radius: var(--r-pill); }
.navbar-toggler:focus-visible, .form-control:focus-visible, .form-select:focus-visible { border-radius: var(--r-sm); }
.on-dark :focus-visible, .site-footer :focus-visible { outline-color: #ffc58a !important; }
.fab:focus-visible { outline-color: #fff !important; }
.btn:focus-visible, .navbar-toggler:focus-visible { box-shadow: none; }

/* 4. BOTÕES ---------------------------------------------------------------- */
.btn {
    --bs-btn-border-radius: var(--r-pill);
    min-height: 48px;
    padding: .75rem 1.5rem;
    font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    transition: background-color .2s var(--ease), color .2s var(--ease),
                transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { flex: none; }

.btn-brand {
    background: var(--brand); color: var(--ink); border: 2px solid var(--brand);
    box-shadow: 0 6px 18px rgba(240,133,45,.35);
}
.btn-brand:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--ink); transform: translateY(-2px); }

.btn-ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }

.btn-wa { background: var(--wa); color: #fff; border: 2px solid var(--wa); }
.btn-wa:hover { background: var(--wa-hover); border-color: var(--wa-hover); color: #fff; transform: translateY(-2px); }

.btn-sm { min-height: 44px; padding: .5rem 1.25rem; }
.btn-lg { min-height: 56px; padding: .9rem 2rem; font-size: 1.0625rem; }

.btn.is-loading { pointer-events: none; opacity: .85; }
.btn .spinner { display: none; width: 1.1em; height: 1.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-arrow { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; }
.link-arrow span { transition: transform .2s var(--ease); }
.link-arrow:hover span { transform: translateX(4px); }
.link-arrow:hover { text-decoration: underline; }

/* 5. HEADER ---------------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 1030;
    background: rgba(250,247,242,.94);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .25s var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.site-header .navbar { min-height: var(--header-h); padding-block: .5rem; }

.brand { display: inline-flex; flex-direction: column; justify-content: center; min-height: 44px; line-height: 1.1; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.brand-role { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-text); font-weight: 700; }

.navbar-toggler { border: 2px solid var(--ink); min-width: 48px; min-height: 48px; border-radius: var(--r-sm); }
.navbar-toggler:focus { box-shadow: none; }

.site-header .nav-link {
    position: relative;
    padding: .75rem .25rem;
    color: var(--ink); font-weight: 600;
    min-height: 44px; display: flex; align-items: center;
}
.site-header .nav-link::after {
    content: ""; position: absolute; left: .25rem; right: .25rem; bottom: .35rem;
    height: 2px; background: var(--brand-text);
    transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
}
.site-header .nav-link:hover::after,
.site-header .nav-link[aria-current="true"]::after { transform: scaleX(1); }
.site-header .nav-link:hover { color: var(--ink); }

@media (max-width: 991.98px) {
    .navbar-collapse { padding-bottom: var(--s2); }
    .site-header .nav-link { border-bottom: 1px solid var(--line); font-size: 1.125rem; }
    .site-header .nav-link::after { display: none; }
    .site-header .nav-link[aria-current="true"] { color: var(--brand-text); }
    .nav-cta { margin-top: var(--s2); }
    .nav-cta .btn { width: 100%; }
}
@media (min-width: 992px) {
    .site-header .navbar-nav { gap: 1.25rem; }
    .nav-cta { margin-left: 1.25rem; }
}

/* 6. HERO ------------------------------------------------------------------ */
.hero { padding-block: var(--s5) var(--s6); overflow: hidden; }
@media (min-width: 992px) { .hero { padding-block: var(--s6) var(--s7); } }

.hero-title { margin-bottom: var(--s3); }
.hero-title em { font-style: italic; color: var(--brand-text); }
.hero-lead { font-size: 1.1875rem; color: var(--ink-soft); margin-bottom: var(--s4); }
.hero-actions { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s4); }
@media (min-width: 576px) { .hero-actions { flex-direction: row; flex-wrap: wrap; } }

.trust-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; font-weight: 600; font-size: .9375rem; }
.trust-list li { display: flex; align-items: center; gap: .6rem; }
.trust-list svg { color: var(--brand-text); flex: none; }
@media (min-width: 768px) and (max-width: 991.98px) { .trust-list { grid-template-columns: repeat(3, auto); justify-content: start; column-gap: 1.75rem; } }

.hero-media { position: relative; }
.hero-media .media {
    aspect-ratio: 4 / 3;
    border-radius: var(--r-lg) var(--r-lg) 90px var(--r-lg);
    box-shadow: var(--shadow-lg);
}
@media (min-width: 992px) { .hero-media .media { aspect-ratio: 5 / 5.2; border-bottom-right-radius: 140px; } }
.hero-badge {
    position: absolute; left: var(--s2); bottom: var(--s2);
    background: var(--surface); border-radius: var(--r-md);
    padding: .75rem 1rem; box-shadow: var(--shadow-md);
    display: flex; align-items: center; gap: .75rem; font-size: .875rem; line-height: 1.3;
    max-width: calc(100% - 2rem);
}
.hero-badge strong { display: block; font-size: .9375rem; }
.hero-badge svg { color: var(--brand-text); flex: none; }
@media (min-width: 1200px) { .hero-badge { left: -1.5rem; bottom: 2.5rem; } }

/* Mídia com skeleton enquanto a imagem carrega */
.media {
    display: block;
    position: relative; overflow: hidden; background-color: #ece4d8;
    background-image: linear-gradient(100deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 70%);
    background-size: 220% 100%;
    animation: shimmer 1.4s linear infinite;
}
.media img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s var(--ease), transform .6s var(--ease); }
.media.is-loaded { animation: none; background-image: none; }
.media.is-loaded img { opacity: 1; }
html:not(.js) .media img { opacity: 1; }
html:not(.js) .media { animation: none; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* 7. SEÇÕES ---------------------------------------------------------------- */
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.on-dark { background: var(--dark); color: var(--on-dark); }
.on-dark h2, .on-dark h3 { color: #fff; }
.on-dark .eyebrow { color: #ffb36e; }
.on-dark .section-head p, .on-dark p { color: var(--on-dark-soft); }
.on-dark a:not(.btn) { color: #ffc58a; }
.on-dark a:not(.btn):hover { color: #fff; }

/* 8. SERVIÇOS -------------------------------------------------------------- */
.service-card {
    height: 100%; display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: var(--s4); box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: #d9c9b3; }
.service-icon {
    width: 72px; height: 72px; border-radius: var(--r-md);
    display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand-text);
    margin-bottom: var(--s3);
    transition: transform .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.service-card:hover .service-icon { transform: scale(1.06) rotate(-3deg); background: var(--brand); color: var(--ink); }
.service-card h3 { margin-bottom: var(--s1); }
.service-card p { color: var(--ink-soft); }
.service-card .link-arrow { margin-top: auto; }

/* 9. PROJETOS -------------------------------------------------------------- */
.gallery { display: grid; gap: var(--s2); grid-template-columns: 1fr; }
@media (min-width: 576px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .gallery { gap: var(--s3); } }

.gallery-item {
    all: unset; box-sizing: border-box; cursor: zoom-in; display: block; position: relative;
    border-radius: var(--r-md); overflow: hidden; background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.gallery-item:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.gallery-item:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.gallery-item .media { aspect-ratio: 4 / 3; border-radius: 0; }
.gallery-item:hover .media img { transform: scale(1.05); }
.gallery-caption {
    position: absolute; inset: auto 0 0 0; padding: 2.5rem 1rem .9rem;
    background: linear-gradient(to top, rgba(20,15,12,.82), rgba(20,15,12,0));
    color: #fff; font-weight: 600; font-size: .9375rem; line-height: 1.3;
    display: flex; justify-content: space-between; align-items: flex-end; gap: .75rem;
}
.gallery-caption svg { flex: none; opacity: .9; }

.modal-content { border: 0; border-radius: var(--r-lg); overflow: hidden; }
.modal-body { padding: 0; background: #000; }
.modal-body img { display: block; width: 100%; height: auto; max-height: 75vh; object-fit: contain; }
.modal-footer { justify-content: space-between; gap: var(--s2); background: var(--surface); }
.modal-title { font-size: 1.125rem; font-family: var(--font-body); font-weight: 700; margin: 0; line-height: 1.3; }

/* 10. PROCESSO ------------------------------------------------------------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: var(--s3); }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li {
    counter-increment: step; position: relative;
    padding: var(--s4) var(--s3) var(--s3);
    background: var(--dark-2); border-radius: var(--r-lg); border: 1px solid rgba(255,255,255,.08);
}
.steps li::before {
    content: counter(step);
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    background: var(--brand); color: var(--ink); font-weight: 800; font-size: 1.125rem;
    margin-bottom: var(--s2);
}
.steps h3 { font-size: 1.1875rem; margin-bottom: .4rem; }
.steps p { margin: 0; font-size: 1rem; }

/* 11. SOBRE ---------------------------------------------------------------- */
.values { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: var(--s2); }
.values li { display: flex; gap: var(--s2); align-items: flex-start; }
.values .tick {
    flex: none; width: 36px; height: 36px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center;
}
.values strong { display: block; }
.values span { color: var(--ink-soft); }
.about-panel {
    background: var(--brand-soft); border-radius: var(--r-lg); padding: var(--s4);
    border: 1px solid #f3d3b3;
}
.about-panel blockquote { margin: 0; font-family: var(--font-display); font-size: clamp(1.25rem, 2vw + .6rem, 1.75rem); line-height: 1.35; }
.about-panel footer { margin-top: var(--s2); font-weight: 700; color: var(--brand-text); font-size: .9375rem; }

/* 11b. FAQ (acordeão) ------------------------------------------------------ */
.accordion {
    --bs-accordion-bg: var(--bg);
    --bs-accordion-color: var(--ink);
    --bs-accordion-border-color: var(--line);
    --bs-accordion-border-radius: var(--r-md);
    --bs-accordion-inner-border-radius: calc(var(--r-md) - 1px);
    --bs-accordion-btn-color: var(--ink);
    --bs-accordion-btn-bg: var(--bg);
    --bs-accordion-active-color: var(--ink);
    --bs-accordion-active-bg: var(--brand-soft);
    --bs-accordion-btn-padding-y: 1.1rem;
    --bs-accordion-btn-padding-x: 1.25rem;
    --bs-accordion-body-padding-x: 1.25rem;
    --bs-accordion-btn-focus-box-shadow: none;
    display: grid; gap: var(--s1);
}
.accordion-item { border: 1px solid var(--line); border-radius: var(--r-md) !important; overflow: hidden; background: var(--bg); }
.accordion-header { margin: 0; font-family: var(--font-body); font-size: 1rem; line-height: 1.4; letter-spacing: 0; }
.accordion-button { font-weight: 700; font-size: 1.0625rem; min-height: 56px; box-shadow: none !important; }
.accordion-button:not(.collapsed) { color: var(--ink); background: var(--brand-soft); }
.accordion-button:hover { background: #f6efe4; }
.accordion-button:not(.collapsed):hover { background: var(--brand-soft); }
.accordion-button::after { filter: none; }
.accordion-body { color: var(--ink-soft); padding-top: .25rem; padding-bottom: 1.25rem; }
.accordion-body, .accordion-button { max-width: none; }

/* 12. CONTATO / FORM ------------------------------------------------------- */
.contact-list { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: .5rem; }
.contact-list li { display: flex; gap: .6rem; align-items: center; }

.form-card { background: var(--surface); color: var(--ink); border-radius: var(--r-lg); padding: var(--s3); box-shadow: var(--shadow-lg); }
@media (min-width: 768px) { .form-card { padding: var(--s4); } }
.form-card h3 { color: var(--ink); }
.form-card p { color: var(--ink-soft); }
.form-label { font-weight: 700; margin-bottom: .35rem; }
.form-label .opt { font-weight: 400; color: var(--ink-soft); }
.form-control, .form-select {
    min-height: 52px; border: 2px solid #8b8076; border-radius: var(--r-sm);
    padding: .75rem 1rem; font-size: 1rem; color: var(--ink);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
textarea.form-control { min-height: 110px; }
.form-control:hover, .form-select:hover { border-color: var(--ink); }
.form-control:focus, .form-select:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(240,133,45,.45); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); background-image: none; padding-right: 1rem; }
.form-select.is-invalid { background-image: var(--bs-form-select-bg-img); }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { box-shadow: 0 0 0 4px rgba(179,38,30,.25); }
.field-error { display: none; margin-top: .35rem; color: var(--danger); font-weight: 600; font-size: .9375rem; align-items: center; gap: .4rem; }
.is-invalid ~ .field-error { display: flex; }
.form-note { font-size: .875rem; color: var(--ink-soft); margin: var(--s2) 0 0; }
.form-status { margin-top: var(--s2); font-weight: 600; }
.form-status:empty { display: none; }

/* 13. FOOTER --------------------------------------------------------------- */
.site-footer { background: #17120f; color: var(--on-dark-soft); padding-block: var(--s5) var(--s3); font-size: .9375rem; }
.site-footer .brand, .site-footer .brand:hover { color: #fff; align-items: flex-start; min-height: 0; }
.site-footer .brand-role { color: #ffb36e; }
.site-footer .footer-title { font-family: var(--font-body); font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase; color: #fff; margin-bottom: var(--s2); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: var(--on-dark-soft); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: var(--s4); padding-top: var(--s3); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s1); }

/* 14. BOTÃO FLUTUANTE ------------------------------------------------------ */
.fab {
    position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 1020;
    min-height: 56px; padding: 0 1.25rem 0 1rem; border-radius: var(--r-pill);
    background: var(--wa); color: #fff; font-weight: 700; text-decoration: none;
    display: inline-flex; align-items: center; gap: .6rem;
    box-shadow: 0 10px 28px rgba(15,122,67,.45);
    transition: transform .2s var(--ease), background-color .2s var(--ease), opacity .3s var(--ease);
}
.fab:hover { background: var(--wa-hover); color: #fff; transform: translateY(-3px); }
.fab:focus-visible { box-shadow: 0 0 0 3px var(--ink); }
.fab.is-hidden { opacity: 0; pointer-events: none; transform: translateY(12px); }
@media (max-width: 575.98px) { .site-footer { padding-bottom: 6rem; } }

/* 15. MOTION --------------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
}
