/* ==========================================================================
   MAAR — Design tokens
   ========================================================================== */
:root {
  --terracota: #b5541e;
  --terracota-dark: #8a3f16;
  --terracota-light: #d97f4e;
  --oliva: #6b6b4a;
  --oliva-dark: #4f4f38;
  --bege: #f5f1e8;
  --bege-deep: #ece2cd;
  --grafite: #262420;
  --grafite-soft: #55524a;
  --white: #ffffff;

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  --container: 1180px;
  --radius-lg: 28px;
  --radius-md: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--grafite);
  background: var(--bege);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 0.4em;
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 600;
}
p { line-height: 1.65; margin: 0 0 1em; color: var(--grafite-soft); }
.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
section { position: relative; }

:focus-visible {
  outline: 3px solid var(--terracota);
  outline-offset: 3px;
}

/* ==========================================================================
   Signature motif — the wavy "M" line, used as a divider / underline
   ========================================================================== */
.wave-divider {
  width: 100%;
  height: 40px;
  display: block;
}
.wave-divider path {
  stroke: var(--oliva);
  stroke-width: 5;
  fill: none;
  stroke-linecap: round;
}
.wave-underline {
  display: block;
  width: 130px;
  height: 26px;
  margin-top: 6px;
}
.wave-underline path {
  stroke: var(--terracota);
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: draw 1.1s var(--ease) forwards 0.3s;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--terracota); color: var(--white); }
.btn-primary:hover { background: var(--terracota-dark); }
.btn-outline { background: transparent; border-color: currentColor; color: inherit; }
.btn-outline:hover { background: var(--grafite); color: var(--white); border-color: var(--grafite); }
.btn-light { background: var(--bege); color: var(--grafite); }
.btn-light:hover { background: var(--white); }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  transition: background 0.35s var(--ease), padding 0.35s var(--ease), box-shadow .35s var(--ease);
}
.nav.is-scrolled {
  background: rgba(245, 241, 232, 0.92);
  backdrop-filter: blur(10px);
  padding: 12px 28px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.06);
}
.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__brand img { height: 30px; width: auto; }
.nav__brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--grafite);
}
.nav.is-on-dark:not(.is-scrolled) .nav__brand span,
.nav.is-on-dark:not(.is-scrolled) .nav__links a { color: var(--white); }

.nav__links { display: flex; gap: 34px; align-items: center; }
.nav__links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--grafite);
  position: relative;
  padding: 4px 0;
}
.nav__links a.is-active { color: var(--terracota); }
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 2px;
  background: var(--terracota);
  transition: width 0.3s var(--ease);
}
.nav__links a:hover::after, .nav__links a.is-active::after { width: 100%; }

.nav__cta {
  padding: 10px 20px;
  font-size: 0.88rem;
}
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav__toggle span { width: 24px; height: 2px; background: currentColor; }

@media (max-width: 860px) {
  .nav__links { position: fixed; top: 0; right: 0; height: 100vh; width: min(78vw, 320px);
    background: var(--bege); flex-direction: column; justify-content: center; align-items: flex-start;
    padding: 40px; gap: 26px; transform: translateX(100%); transition: transform 0.4s var(--ease);
    box-shadow: -10px 0 40px rgba(0,0,0,0.12);
  }
  .nav__links.is-open { transform: translateX(0); }
  .nav__links a { font-size: 1.4rem; color: var(--grafite) !important; }
  .nav__toggle { display: flex; }
  .nav.is-on-dark .nav__toggle { color: inherit; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero__bg {
  position: absolute; top:0; right:0; bottom:0; left:0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  animation: heroZoom 16s var(--ease) forwards;
}
@keyframes heroZoom { to { transform: scale(1); } }

.page-hero {
  position: relative;
  min-height: 46vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-top: 0;
}
.page-hero__bg {
  position: absolute; top:0; right:0; bottom:0; left:0;
  background-size: cover;
  background-position: center;
}
.page-hero__scrim {
  position: absolute; top:0; right:0; bottom:0; left:0;
  background: linear-gradient(120deg, rgba(38,36,32,0.82) 10%, rgba(38,36,32,0.35) 75%);
}
.page-hero__content { position: relative; z-index: 2; color: var(--white); padding-top: 70px; }
.page-hero__content .eyebrow { color: var(--terracota-light); }
.page-hero__content p { color: rgba(255,255,255,0.85); max-width: 46ch; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracota);
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--oliva); }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: 110px 0; }
.section--tight { padding: 70px 0; }
.section--bege-deep { background: var(--bege-deep); }
.section--grafite { background: var(--grafite); color: var(--bege); }
.section--grafite p { color: rgba(245,241,232,0.72); }
.section--oliva { background: var(--oliva); color: var(--white); }
.section--oliva p { color: rgba(255,255,255,0.82); }

.section__head { max-width: 640px; margin-bottom: 56px; }
.section__head h2 { font-size: clamp(2rem, 3.4vw, 2.9rem); }

.statement {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
}
.statement em { color: var(--terracota-light); font-style: normal; }

/* Reveal on scroll — content is visible by default (progressive enhancement);
   JS adds .reveal-init before observing, so a JS failure never hides content. */
.reveal.reveal-init { opacity: 0; transform: translateY(28px); }
.reveal { transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.reveal-init.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Grids / cards
   ========================================================================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.grid-services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 34px 28px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  border: 1px solid rgba(38,36,32,0.06);
}
.card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(38,36,32,0.09); }
.card__icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--bege);
  color: var(--terracota);
  margin-bottom: 20px;
}
.card__icon svg { width: 26px; height: 26px; }
.card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.card p { margin-bottom: 0; font-size: 0.95rem; }
.card--link { display: block; }
.card--link .card__go { color: var(--terracota); font-weight: 600; font-size: 0.88rem; display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; }

.value-item { text-align: left; }
.value-item .card__icon { background: rgba(255,255,255,0.14); color: var(--white); }
.section--bege .value-item .card__icon,
.value-item.on-light .card__icon { background: var(--white); color: var(--terracota); }

.img-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.img-frame img { width: 100%; height: 100%; object-fit: cover; }
.img-frame--tall { aspect-ratio: 3/4; }
.img-frame--wide { aspect-ratio: 16/10; }

/* Blob accent shape echoing the brand's rounded corner motif */
.blob-tag {
  position: absolute;
  bottom: -18px; left: -18px;
  background: var(--oliva);
  color: var(--white);
  border-radius: 100px;
  padding: 16px 26px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 14px 30px rgba(0,0,0,0.18);
}

/* ==========================================================================
   Gallery (Projetos)
   ========================================================================== */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.gallery__item { border-radius: var(--radius-md); overflow: hidden; position: relative; aspect-ratio: 4/5; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.gallery__item:hover img { transform: scale(1.06); }
.gallery__caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 20px;
  background: linear-gradient(0deg, rgba(38,36,32,0.85), transparent);
  color: var(--white);
}
.gallery__caption strong { font-family: var(--font-display); display: block; font-size: 1.05rem; }
.gallery__caption span { font-size: 0.82rem; color: rgba(255,255,255,0.78); }

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta-band {
  background: var(--terracota);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 64px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.cta-band h2 { margin-bottom: 6px; }
.cta-band p { color: rgba(255,255,255,0.85); margin-bottom: 0; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { background: var(--grafite); color: var(--bege); padding: 70px 0 30px; }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 50px; }
.footer__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.footer__brand img { height: 28px; filter: brightness(0) invert(1); opacity: 0.92; }
.footer__brand span { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.footer p { color: rgba(245,241,232,0.6); max-width: 34ch; }
.footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(245,241,232,0.5); margin-bottom: 16px; }
.footer__links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer__links a { color: rgba(245,241,232,0.82); font-size: 0.95rem; }
.footer__links a:hover { color: var(--terracota-light); }
.footer__bottom {
  border-top: 1px solid rgba(245,241,232,0.12);
  padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 0.82rem; color: rgba(245,241,232,0.45);
}

/* ==========================================================================
   Contact page
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 60px; }
.contact-info__item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 28px; }
.contact-info__item .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--bege-deep); display: flex; align-items: center; justify-content: center; color: var(--terracota); flex-shrink: 0; }
.contact-info__item .ic svg { width: 22px; height: 22px; }
.contact-info__item strong { display: block; margin-bottom: 3px; font-family: var(--font-display); }

.form { background: var(--white); border-radius: var(--radius-lg); padding: 42px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 7px; color: var(--grafite); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1.5px solid rgba(38,36,32,0.14);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--bege);
  color: var(--grafite);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--terracota); outline: none; }
.field textarea { resize: vertical; min-height: 110px; }

/* ==========================================================================
   Page transition overlay
   ========================================================================== */
#page { animation: pageIn 0.5s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
#page.is-leaving { opacity: 0; transform: translateY(-10px); transition: opacity 0.32s var(--ease), transform 0.32s var(--ease); }

.transition-veil {
  position: fixed; top:0; right:0; bottom:0; left:0; z-index: 9999;
  background: var(--bege);
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
}
.transition-veil.is-active {
  animation: veilIn 0.55s var(--ease) forwards;
}
.transition-veil.is-leaving {
  transform-origin: top;
  animation: veilOut 0.55s var(--ease) forwards;
}
@keyframes veilIn { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes veilOut { from { transform: scaleY(1); } to { transform: scaleY(0); } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; gap: 32px; }
  .grid-services { grid-template-columns: repeat(2, 1fr); }
  .grid-values { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .footer__top { grid-template-columns: 1fr; gap: 30px; }
  .contact-grid { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; padding: 44px 30px; }
}
@media (max-width: 600px) {
  .section { padding: 72px 0; }
  .grid-services { grid-template-columns: 1fr; }
  .grid-values { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .cta-band { padding: 34px 24px; border-radius: 20px; }
  .form { padding: 28px 22px; }
}
