/* Meller Engenharia e Construções — landing page
   Conceito: placa de obra (hero) + paginação de revestimento (serviços). */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --glaze: #1f5a47;        /* verde esmaltado */
  --glaze-deep: #163f33;
  --ochre: #d8a21f;        /* ocre de ladrilho hidráulico */
  --grout: #e3e5e2;        /* rejunte */
  --tile: #fbfbf8;         /* branco cerâmico */
  --slate: #23292b;        /* texto */
  --muted: #566064;
  --post: #8b918d;         /* poste da placa */
  --line: #c9cdc9;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --joint: 6px;            /* largura do rejunte */

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 4.2vw, 3rem);
  --step-4: clamp(2.25rem, 5.6vw, 4rem);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--grout);
  color: var(--slate);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--step-0);
  font-stretch: 100%;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }

h1, h2, h3 {
  margin: 0;
  font-stretch: 72%;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-stretch: 85%; font-weight: 700; line-height: 1.15; }
p { margin: 0; max-width: 64ch; text-wrap: pretty; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 10;
  background: var(--slate); color: var(--tile); padding: 10px 14px; text-decoration: none;
}
.skip:focus { top: 8px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

/* ---------- Cabeçalho ---------- */
.topbar { background: var(--tile); border-bottom: 1px solid var(--line); }
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand-name { font-size: 1.5rem; font-weight: 800; font-stretch: 125%; letter-spacing: -0.02em; line-height: 1; }
.brand-sub { font-size: var(--step--1); color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  font: inherit; font-weight: 650; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  border: 2px solid transparent; border-radius: 2px;
}
.btn-solid { background: var(--glaze); color: var(--tile); }
.btn-solid:hover { background: var(--glaze-deep); }
.btn-line { background: transparent; color: var(--slate); border-color: var(--slate); }
.btn-line:hover { background: var(--slate); color: var(--tile); }

/* ---------- Hero: a placa de obra ---------- */
.hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: flex; align-items: flex-end;
  overflow: hidden;
  background: #9aa09c;
}
.hero-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 70% 40%;
  filter: saturate(0.55) contrast(1.05);
}
.hero::after { /* chão / sombra junto à base para os postes "assentarem" */
  content: ""; position: absolute; inset: auto 0 0 0; height: 18%;
  background: linear-gradient(to top, rgba(35, 41, 43, 0.45), transparent);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; padding-top: clamp(48px, 8vh, 96px); }

.sign { width: min(100%, 600px); }
.sign-board {
  position: relative;
  background: var(--glaze);
  color: var(--tile);
  border: 5px solid var(--tile);
  box-shadow: 0 18px 40px -18px rgba(20, 25, 27, 0.55);
}
.sign-board::before, .sign-board::after { /* parafusos */
  content: ""; position: absolute; top: 10px; width: 7px; height: 7px; border-radius: 50%;
  background: rgba(251, 251, 248, 0.55); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.sign-board::before { left: 10px; }
.sign-board::after { right: 10px; }
.sign-band {
  background: var(--ochre); color: var(--slate);
  padding: 12px 28px 10px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.sign-band .brand-name { font-size: clamp(1.4rem, 3.4vw, 1.9rem); }
.sign-band span:last-child { font-weight: 600; font-size: var(--step--1); }
.sign-body { padding: 24px 28px 8px; }
.sign h1 { font-size: var(--step-4); }
.sign dl { margin: 22px 0 0; }
.sign-row {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 4px 16px; align-items: baseline;
  padding: 11px 0; border-top: 1px solid rgba(251, 251, 248, 0.28);
}
.sign dt { font-size: var(--step--1); color: rgba(251, 251, 248, 0.78); }
.sign dd { margin: 0; font-size: var(--step-1); font-weight: 650; font-stretch: 90%; line-height: 1.2; overflow-wrap: anywhere; }
.sign dd a { text-decoration-thickness: 1px; text-underline-offset: 4px; }
.sign dd a:hover { color: var(--ochre); }
.sign-cta { padding: 8px 28px 26px; }
.sign-cta .btn { background: var(--tile); color: var(--glaze-deep); }
.sign-cta .btn:hover { background: var(--ochre); color: var(--slate); }

.sign-posts { display: flex; justify-content: space-between; padding-inline: 16%; height: clamp(56px, 12vh, 120px); }
.sign-posts span {
  width: 18px; height: 100%;
  background: linear-gradient(90deg, #2f3537, #4a5153 35%, #6b7275 55%, #2f3537);
  box-shadow: 4px 0 8px rgba(20, 25, 27, 0.35);
}

@media (prefers-reduced-motion: no-preference) {
  .sign-board { animation: raise 700ms cubic-bezier(.2, .7, .2, 1) 150ms both; }
  .sign-posts span { transform-origin: bottom; animation: plant 450ms ease-out both; }
}
@keyframes raise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes plant { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ---------- Seções ---------- */
.section { padding-block: clamp(56px, 9vw, 112px); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head p { color: var(--muted); }

/* ---------- Serviços: paginação de revestimento ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "ct cp cp rt"
    "qp qp qt rp"
    "pt pt pp pp";
  gap: var(--joint);
  background: var(--grout);
}
.a-ct { grid-area: ct; } .a-cp { grid-area: cp; } .a-rt { grid-area: rt; } .a-rp { grid-area: rp; }
.a-qt { grid-area: qt; } .a-qp { grid-area: qp; } .a-pt { grid-area: pt; } .a-pp { grid-area: pp; }
.tile { background: var(--tile); min-height: 280px; }
.tile-text { padding: clamp(20px, 2.4vw, 32px); display: flex; flex-direction: column; gap: 12px; }
.tile-text h3 { font-size: var(--step-2); font-stretch: 75%; font-weight: 800; line-height: 1.05; }
.tile-text p { color: var(--muted); font-size: 1rem; }
.tile-photo { position: relative; overflow: hidden; }
.tile-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-glaze { background: var(--glaze); color: var(--tile); }
.tile-glaze p { color: rgba(251, 251, 248, 0.82); }
.tile-ochre { background: var(--ochre); }
.tile-ochre p { color: #3b3420; }

/* ---------- Etapas da obra ---------- */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
  counter-reset: etapa;
  border-top: 3px solid var(--slate);
}
.steps li { counter-increment: etapa; padding: 20px 20px 0 0; display: grid; gap: 8px; align-content: start; }
.steps li::before {
  content: counter(etapa);
  font-size: var(--step-3); font-weight: 800; font-stretch: 62%; line-height: 1; color: var(--glaze);
}
.steps p { color: var(--muted); font-size: 1rem; }

/* ---------- História ---------- */
.history { background: var(--tile); }
.history .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.history-year {
  font-size: clamp(5rem, 16vw, 11rem); font-weight: 800; font-stretch: 62%; line-height: 0.85;
  color: var(--glaze); letter-spacing: -0.03em;
}
.history-text { display: grid; gap: 16px; }
.history-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- Contato ---------- */
.contact { background: var(--glaze); color: var(--tile); }
.contact .wrap { display: grid; gap: 22px; }
.contact p { color: rgba(251, 251, 248, 0.85); }
.contact-mail {
  font-size: clamp(1.6rem, 6.4vw, 4.5rem); font-weight: 800; font-stretch: 70%; line-height: 1;
  text-decoration: none; overflow-wrap: anywhere; width: fit-content;
  border-bottom: 4px solid var(--ochre); padding-bottom: 6px;
}
.contact-mail:hover { color: var(--ochre); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.contact .btn-solid { background: var(--ochre); color: var(--slate); }
.contact .btn-solid:hover { background: var(--tile); }
.contact .btn-line { color: var(--tile); border-color: rgba(251, 251, 248, 0.7); }
.contact .btn-line:hover { background: var(--tile); color: var(--glaze-deep); }
.copy-status { font-size: var(--step--1); min-height: 1.5em; color: var(--tile); }

/* ---------- Rodapé ---------- */
.footer { padding-block: 28px 36px; font-size: var(--step--1); color: var(--muted); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.footer details { max-width: 70ch; }
.footer summary { cursor: pointer; }
.footer ul { margin: 8px 0 0; padding-left: 18px; }

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .tiles {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas: "ct cp" "rp rt" "qt qp" "pp pt";
  }
  .tile { min-height: 240px; }
  .steps { grid-template-columns: 1fr; border-top: 0; border-left: 3px solid var(--slate); }
  .steps li { grid-template-columns: 3rem 1fr; column-gap: 12px; padding: 14px 0 14px 18px; }
  .steps li::before { grid-row: span 2; }
  .history .wrap { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .brand-sub { display: none; }
  .topbar .btn { padding: 8px 12px; font-size: 0.9375rem; }
  .hero { min-height: 0; display: block; background: var(--grout); }
  .hero-photo { position: relative; height: 42vh; min-height: 240px; }
  .hero::after { display: none; }
  .hero .wrap { margin-top: -96px; padding-top: 0; padding-bottom: 8px; }
  .sign-band, .sign-body, .sign-cta { padding-inline: 18px; }
  .sign-row { grid-template-columns: 1fr; gap: 2px; }
  .sign-posts { display: none; }
  .tiles { grid-template-columns: 1fr; grid-template-areas: "ct" "cp" "rt" "rp" "qt" "qp" "pt" "pp"; }
  .tile { min-height: 0; }
  .tile-photo { aspect-ratio: 16 / 10; }
  .contact-actions .btn { flex: 1 1 100%; }
}
.section-steps { padding-top: 0; }
