/* Silva Comércio — materiais de construção
   Paleta: grafite quente, tijolo, cinza-concreto, laranja de acabamento, areia. */
:root {
  --ink: #2B211C;
  --deep: #9C3D24;
  --mid: #8A8580;
  --accent: #D9822B;
  --paper: #F3E9DA;
  --paper-2: #EADCC6;
  --sand-light: #FBF6EE;
  --ink-soft: #5C4B41;
  --on-dark: #D8CBBB;
  --line: rgba(43, 33, 28, .14);
  --display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --body: "Nunito Sans", system-ui, sans-serif;
  --nav-h: 72px;
  --r: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--body);
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 750; line-height: 1.08; letter-spacing: -.02em; margin: 0; }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r); }
.skip:focus { top: 12px; }

/* roteamento: sem JS, todas as páginas ficam legíveis em sequência */
.js .page { display: none; }
.js .page.active { display: block; }

.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js [data-reveal].revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: var(--r);
  font: 650 1rem/1.2 var(--display); text-decoration: none; text-align: center;
  border: 2px solid transparent; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--deep); color: #fff; }
.btn-primary:hover { background: #7f3019; }
.btn-line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-wa { background: var(--accent); color: var(--ink); }
.btn-wa:hover { background: #c4711f; }

/* ---------- navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: rgba(243, 233, 218, .96); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.nav-row { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; min-height: 44px; }
.brand img { width: 40px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font: 800 1.2rem/1.1 var(--display); letter-spacing: -.02em; }
.brand-text span { font-size: .8rem; color: var(--ink-soft); }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav-links a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px;
  text-decoration: none; font-weight: 600; font-size: .95rem; border-radius: var(--r);
}
.nav-links a:hover { background: var(--paper-2); }
.nav-cta { min-height: 44px; padding: 0 18px; }
.nav-toggle {
  display: none; width: 48px; height: 48px; border: 0; background: transparent; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px; border-radius: var(--r);
}
.nav-toggle span { width: 24px; height: 3px; background: var(--ink); border-radius: 1px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 1040px) {
  .nav-toggle { display: flex; order: 3; }
  .nav-cta { display: none; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: var(--nav-h);
    flex-direction: column; gap: 0; padding: 8px 20px 20px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 24px -16px rgba(43, 33, 28, .35);
  }
  .nav-links.open { display: flex; }
  .nav-links a { min-height: 52px; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0 4px; }
}

/* ---------- hero ---------- */
.hero { padding: clamp(40px, 6vw, 88px) 0 clamp(56px, 7vw, 104px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 {
  font-size: clamp(2.9rem, 1rem + 5vw, 5rem);
  font-weight: 800; line-height: .94; letter-spacing: -.04em;
  font-variation-settings: "opsz" 96;
  margin-bottom: 24px; text-wrap: balance;
}
.hero-lead { font-size: clamp(1.08rem, 1rem + .35vw, 1.25rem); color: var(--ink-soft); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 32px; }
.hero-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hero-facts li { position: relative; padding-left: 30px; font-weight: 600; }
.hero-facts li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 18px; height: 9px;
  background: var(--deep); border-radius: 1.5px; box-shadow: 0 0 0 0 transparent;
}
.hero-facts li:last-child::before { background: var(--accent); }

/* foto com "espera" de alvenaria: fiadas alternadas avançam na borda esquerda */
.hero-photo { position: relative; }
.hero-photo img {
  width: 100%; height: clamp(320px, 42vw, 580px); object-fit: cover;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 7% 100%, 7% 87.5%, 0 87.5%, 0 75%, 7% 75%, 7% 62.5%, 0 62.5%, 0 50%, 7% 50%, 7% 37.5%, 0 37.5%, 0 25%, 7% 25%, 7% 12.5%, 0 12.5%);
}

/* ---------- etapas da obra ---------- */
.etapas { background: var(--ink); color: var(--paper); padding: clamp(64px, 8vw, 112px) 0; }
.sec-head { max-width: 46rem; margin-bottom: 40px; }
.sec-head p { font-size: 1.1rem; margin-top: 14px; color: var(--ink-soft); }
.etapas .sec-head p { color: var(--on-dark); }

.tablist {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory;
}
.tablist::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 76px; padding: 12px 14px 22px; border: 0; border-radius: var(--r) var(--r) 0 0;
  background: transparent; color: var(--on-dark); text-align: left; cursor: pointer; scroll-snap-align: start;
  font: 650 clamp(1rem, .9rem + .45vw, 1.3rem)/1.15 var(--display); letter-spacing: -.01em;
}
.tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
  background: rgba(243, 233, 218, .16); border-radius: 1.5px;
}
.tab:hover { color: var(--paper); background: rgba(243, 233, 218, .06); }
.tab:has(~ .tab[aria-selected="true"])::after { background: var(--deep); }
.tab[aria-selected="true"] { color: var(--paper); background: rgba(243, 233, 218, .09); }
.tab[aria-selected="true"]::after { background: var(--accent); }
.tab-n { font-size: .85rem; font-weight: 600; color: var(--accent); }
.tab:focus-visible { outline-offset: -3px; }

.panel {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 4vw, 56px);
  padding-top: 40px; align-items: start;
}
.panel:focus-visible { outline-offset: 6px; }
.panel[hidden] { display: none; }
.panel h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-bottom: 12px; }
.materiais { list-style: none; margin: 0; padding: 0; }
.materiais li {
  position: relative; padding: 13px 0 13px 32px;
  border-bottom: 1px solid rgba(243, 233, 218, .14); font-size: 1.05rem;
}
.materiais li::before {
  content: ""; position: absolute; left: 0; top: 1.3em; width: 16px; height: 8px;
  background: var(--accent); border-radius: 1.5px;
}
.dica {
  background: var(--paper); color: var(--ink); border-radius: var(--r);
  padding: 26px 26px 24px; border-top: 8px solid var(--deep);
}
.dica h4 { font-size: 1.15rem; margin-bottom: 10px; }
.dica-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--deep); text-underline-offset: 4px; }
html:not(.js) .tablist { display: none; }
html:not(.js) .panel + .panel { margin-top: 24px; border-top: 1px solid rgba(243, 233, 218, .2); }

/* ---------- serviços ---------- */
.servicos { padding: clamp(64px, 8vw, 112px) 0; }
.serv-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 44px); }
.serv { border-top: 3px solid var(--ink); padding-top: 22px; }
.serv-ico { width: 48px; height: 48px; color: var(--deep); margin-bottom: 14px; }
.serv h3 { font-size: 1.45rem; margin-bottom: 10px; }
.serv p { color: var(--ink-soft); margin: 0; }

.orc {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 5vw, 64px); align-items: center;
  margin-top: clamp(56px, 7vw, 96px);
}
.orc-photo img { border-radius: var(--r); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.orc-copy h3 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); margin-bottom: 22px; }
.passos { list-style: none; margin: 0 0 28px; padding: 0; counter-reset: p; }
.passos li { counter-increment: p; position: relative; padding: 0 0 18px 58px; color: var(--ink-soft); }
.passos li strong { display: block; color: var(--ink); font-size: 1.1rem; }
.passos li::before {
  content: counter(p); position: absolute; left: 0; top: -4px;
  width: 42px; height: 42px; display: grid; place-items: center;
  font: 800 1.35rem/1 var(--display); color: #fff; background: var(--deep); border-radius: var(--r);
}

/* ---------- calculadora ---------- */
.calc { background: var(--deep); color: var(--paper); padding: clamp(64px, 8vw, 112px) 0; }
.calc-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.calc-intro p { font-size: 1.1rem; margin-top: 16px; color: #F8EEE4; max-width: 30em; }
.calc-photo img { margin-top: 28px; width: 100%; max-width: 340px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r); }
.calc-card {
  background: var(--paper); color: var(--ink); border-radius: 6px;
  padding: clamp(22px, 3vw, 34px); box-shadow: 12px 12px 0 var(--ink);
}
.calc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 700; font-size: .95rem; }
.field small { font-size: .85rem; color: var(--ink-soft); }
.opc { font-weight: 400; color: var(--ink-soft); }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  font: 400 1.05rem/1.4 var(--body); color: var(--ink);
  background: var(--sand-light); border: 2px solid var(--mid); border-radius: var(--r);
}
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: 3px solid var(--accent); outline-offset: 1px; }
.calc-btn { width: 100%; margin-top: 20px; }
.calc-out {
  margin-top: 20px; min-height: 112px; padding: 18px 20px;
  background: var(--sand-light); border: 2px dashed var(--mid); border-radius: var(--r);
  display: flex; align-items: center;
}
.calc-out dl { margin: 0; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.calc-out dt { font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.calc-out dd { margin: 2px 0 0; font: 800 clamp(1.5rem, 1.2rem + 1vw, 2rem)/1.1 var(--display); letter-spacing: -.02em; }
.calc-out .calc-compra { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); }
.calc-out .calc-compra dd { color: var(--deep); font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); }
.calc-msg { margin: 0; color: var(--ink-soft); font-weight: 600; }
.calc-nota { font-size: .88rem; color: var(--ink-soft); margin: 12px 0 0; }
.calc-pedir { width: 100%; margin-top: 16px; }
.calc-pedir[hidden] { display: none; }

/* ---------- balcão de família ---------- */
.familia { padding: clamp(64px, 8vw, 112px) 0 clamp(48px, 6vw, 80px); }
.familia-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.familia-copy h2 { margin-bottom: 20px; }
.familia-copy p { color: var(--ink-soft); font-size: 1.08rem; max-width: 34em; }
.familia-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); }

/* ---------- depoimentos ---------- */
.clientes { background: var(--paper-2); padding: clamp(64px, 8vw, 104px) 0; }
.dep-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.dep { background: var(--sand-light); border-radius: var(--r); padding: 28px 26px; display: flex; flex-direction: column; border-bottom: 6px solid var(--deep); }
.dep:nth-child(2) { border-bottom-color: var(--accent); }
.dep blockquote { margin: 0 0 20px; font-size: 1.06rem; flex: 1; }
.dep figcaption strong { display: block; font-family: var(--display); font-size: 1.05rem; }
.dep figcaption span { font-size: .9rem; color: var(--ink-soft); }
.aviso { font-size: .85rem; color: var(--ink-soft); margin: 20px 0 0; }

/* ---------- contato ---------- */
.contato { padding: clamp(64px, 8vw, 112px) 0; }
.contato-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.contato-info p { color: var(--ink-soft); font-size: 1.08rem; margin-top: 16px; max-width: 30em; }
.contato-lista { list-style: none; margin: 28px 0 0; padding: 0; }
.contato-lista li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.contato-lista span { width: 6.5em; font-size: .9rem; color: var(--ink-soft); }
.contato-lista a { font: 700 1.15rem/1.3 var(--display); text-decoration-color: var(--accent); text-underline-offset: 4px; overflow-wrap: anywhere; min-height: 44px; display: inline-flex; align-items: center; }
.contato-form { display: grid; gap: 18px; background: var(--sand-light); border: 1px solid var(--line); border-radius: 6px; padding: clamp(22px, 3vw, 34px); }

/* ---------- páginas legais ---------- */
.legal { max-width: 800px; padding-top: clamp(40px, 6vw, 72px); padding-bottom: 96px; }
.legal h1 { font-size: clamp(2.2rem, 1.6rem + 2.5vw, 3.4rem); margin: 20px 0 6px; }
.legal-data { color: var(--ink-soft); font-size: .95rem; margin-bottom: 32px; }
.legal h2 { font-size: 1.3rem; margin: 32px 0 10px; }
.legal p { color: #3d302a; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--deep); text-underline-offset: 4px; }
.back::before { content: ""; width: 10px; height: 10px; border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); margin-right: 10px; }
html:not(.js) .page + .page { border-top: 8px solid var(--deep); }

/* ---------- rodapé ---------- */
.footer { background: var(--ink); color: var(--on-dark); padding: 64px 0 96px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 36px; }
.footer-brand img { width: 250px; margin-bottom: 18px; }
.footer-brand p { max-width: 24em; }
.footer-h { font-size: 1rem; color: var(--paper); margin-bottom: 12px; letter-spacing: 0; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li a { display: inline-flex; align-items: center; min-height: 40px; text-decoration: none; overflow-wrap: anywhere; }
.footer li a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 4px; }
.footer-bottom { margin-top: 44px; font-size: .88rem; }
.footer-bottom::before { content: ""; display: block; border-top: 1px solid rgba(243, 233, 218, .14); margin-bottom: 22px; }
.footer-bottom p { margin: 0 0 6px; }

/* ---------- WhatsApp flutuante ---------- */
.wa-float {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--deep); color: var(--paper);
  box-shadow: 0 8px 20px -6px rgba(43, 33, 28, .55), 0 0 0 3px var(--paper);
  transition: transform .2s;
}
.wa-float:hover { transform: translateY(-2px); }
.wa-float svg { width: 30px; height: 30px; }

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  .hero-grid, .orc, .calc-grid, .familia-grid, .contato-grid { grid-template-columns: 1fr; }
  .hero-photo img { height: clamp(220px, 56vw, 420px); }
  .panel { grid-template-columns: 1fr; }
  .serv-grid, .dep-grid { grid-template-columns: 1fr; }
  .calc-photo { display: none; }
  .familia-photo { order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .tablist { grid-template-columns: repeat(5, minmax(128px, 1fr)); margin-right: -20px; padding-right: 20px; }
}
@media (max-width: 520px) {
  .calc-fields { grid-template-columns: 1fr; }
  .calc-card { box-shadow: 8px 8px 0 var(--ink); }
  .hero-actions .btn { flex: 1 1 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .contato-lista span { width: 100%; }
  .contato { padding-bottom: 96px; }
}
