/* ==========================================================================
   C2R Engenharia e Construção — styles
   ========================================================================== */

:root {
  --red: #c72e36;
  --red-dark: #a5232a;
  --red-tint: #fbeceb;
  --ink: #23282b;
  --ink-soft: #4d5459;
  --gray-600: #6b7176;
  --gray-300: #e2e0dd;
  --gray-150: #f0efec;
  --off-white: #f8f7f5;
  --white: #ffffff;

  --font-head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --container: 1180px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(35, 40, 43, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(35, 40, 43, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(35, 40, 43, 0.25);

  --header-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
svg { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

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

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding-block: clamp(64px, 10vw, 120px); }
.section-alt { background: var(--off-white); }

.section-head { max-width: 640px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); margin-top: 10px; }
.section-sub { margin-top: 16px; color: var(--ink-soft); font-size: 1.0625rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}
.eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  background: var(--red);
  border-radius: 2px;
}

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 8px 20px -8px rgba(199, 46, 54, 0.55);
}
.btn-primary:hover { background: var(--red-dark); transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgba(199, 46, 54, 0.55); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--gray-300);
}
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-sm { padding: 10px 20px; font-size: 0.875rem; }

/* ---------- Header ---------- */
.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  background: var(--ink);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 8px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0);
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { position: relative; display: block; }
.brand-logo { height: 30px; width: auto; transition: opacity 0.3s var(--ease); }
.brand-logo-dark { position: absolute; inset: 0; opacity: 0; }
.site-header.is-scrolled .brand-logo-light { opacity: 0; }
.site-header.is-scrolled .brand-logo-dark { opacity: 1; }
.footer-logo { height: 28px; width: auto; }

.nav { display: flex; align-items: center; gap: 32px; }
.nav-list { display: flex; align-items: center; gap: 28px; }
.nav-link {
  position: relative;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.92);
  padding-block: 4px;
  transition: color 0.2s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--red);
  border-radius: 2px;
  transition: right 0.25s var(--ease);
}
.nav-link:hover, .nav-link.is-active { color: var(--white); }
.nav-link:hover::after, .nav-link.is-active::after { right: 0; }
.site-header.is-scrolled .nav-link { color: var(--ink-soft); }
.site-header.is-scrolled .nav-link:hover, .site-header.is-scrolled .nav-link.is-active { color: var(--ink); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 22px;
  background: var(--white);
  margin-inline: auto;
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), background-color .3s var(--ease);
}
.site-header.is-scrolled .nav-toggle span,
.nav-toggle[aria-expanded="true"] span { background: var(--ink); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    top: var(--header-h);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    background: var(--white);
    padding: 32px 24px;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    overflow-y: auto;
  }
  .nav.is-open { transform: translateX(0); }
  .nav-list { flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; }
  .nav-link,
  .site-header.is-scrolled .nav-link {
    display: block; width: 100%; padding: 14px 4px; font-size: 1.125rem;
    border-bottom: 1px solid var(--gray-150); color: var(--ink-soft);
  }
  .nav-link:hover, .nav-link.is-active,
  .site-header.is-scrolled .nav-link:hover, .site-header.is-scrolled .nav-link.is-active { color: var(--ink); }
  .nav-link::after { display: none; }
  .nav-cta { margin-top: 20px; width: 100%; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-top: var(--header-h);
  overflow: hidden;
  background: var(--ink);
}

.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
  transform: scale(1.02);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(20, 16, 15, 0.88) 0%, rgba(24, 20, 19, 0.55) 45%, rgba(30, 22, 21, 0.28) 75%, rgba(35, 25, 24, 0.35) 100%),
    linear-gradient(100deg, rgba(35, 22, 22, 0.35) 0%, transparent 55%);
}

.hero-inner { position: relative; z-index: 1; max-width: 760px; padding-block: 56px clamp(72px, 12vw, 128px); }
.hero-title { font-size: clamp(2.4rem, 5.6vw, 4.1rem); margin-top: 18px; }
.hero-sub { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); color: var(--ink-soft); margin-top: 22px; max-width: 560px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 38px; }

.eyebrow-on-photo { color: #ff9d9f; }
.eyebrow-on-photo::before { background: #ff9d9f; }
.hero-title-on-photo { color: var(--white); }
.hero-sub-on-photo { color: rgba(255, 255, 255, 0.86); }
.btn-ghost-on-photo { color: var(--white); border-color: rgba(255, 255, 255, 0.4); }
.btn-ghost-on-photo:hover { border-color: var(--white); background: rgba(255, 255, 255, 0.08); }

.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  animation: bob 2.2s ease-in-out infinite;
  z-index: 1;
}
.scroll-cue svg { width: 18px; height: 18px; }
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.card h3 { font-size: 1.125rem; margin-top: 18px; margin-bottom: 8px; }
.card p { color: var(--ink-soft); font-size: 0.95rem; }

.icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--red-tint);
  color: var(--red);
  display: grid;
  place-items: center;
}
.icon-badge svg { width: 24px; height: 24px; }
.icon-badge-lg { width: 56px; height: 56px; border-radius: 14px; }
.icon-badge-lg svg { width: 28px; height: 28px; }

.service p { max-width: 40ch; }

/* ---------- Mission ---------- */
.mission {
  background: linear-gradient(180deg, var(--red-tint) 0%, var(--off-white) 100%);
  color: var(--ink);
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--gray-300);
}
.mission-inner {
  position: relative;
  padding-block: clamp(72px, 10vw, 120px);
  max-width: 760px;
  text-align: center;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.mission-mark {
  position: absolute;
  top: -10px;
  font-family: var(--font-head);
  font-size: 7rem;
  color: rgba(199,46,54,0.12);
  line-height: 1;
  z-index: 0;
}
.mission-quote {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3.4vw, 2.25rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.mission-inner .btn-primary { margin-top: 10px; }

/* ---------- Contact ---------- */
.contact-card { display: block; }
.contact-card p { color: var(--ink); font-size: 1.0625rem; font-weight: 600; font-family: var(--font-head); margin-bottom: 6px; }
.contact-note { font-size: 0.8125rem; color: var(--gray-600); }
a.contact-card:hover { border-color: var(--red); }

/* ---------- Footer ---------- */
.site-footer { background: var(--off-white); border-top: 1px solid var(--gray-300); }
.footer-inner {
  padding-block: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-nav { display: flex; gap: 24px; }
.footer-nav a { font-size: 0.9rem; color: var(--ink-soft); font-weight: 500; }
.footer-nav a:hover { color: var(--red); }
.footer-copy { font-size: 0.8125rem; color: var(--gray-600); width: 100%; text-align: center; order: 3; margin-top: 8px; }

@media (min-width: 700px) {
  .footer-copy { width: auto; text-align: right; order: 0; margin-top: 0; }
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background-color .3s var(--ease);
  z-index: 90;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { background: var(--red); }
.to-top svg { width: 18px; height: 18px; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
