/* ============================================================
   TERRAM — Engenharia de Infraestrutura
   Identidade: preto + amarelo construção
   ============================================================ */

:root {
  --black: #0f0f10;
  --ink: #16171a;
  --surface: #1c1d21;
  --surface-2: #25272c;
  --line: rgba(255, 255, 255, 0.10);
  --yellow: #f5b301;
  --yellow-deep: #e0a200;
  --white: #ffffff;
  --muted: #9aa0a8;
  --muted-dark: #5b6068;
  --paper: #f6f6f4;
  --paper-ink: #14151a;

  --container: 1200px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .55);
  --ease: cubic-bezier(.22, 1, .36, 1);

  --font-head: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--font-body);
  background: var(--black);
  color: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4, h5 { font-family: var(--font-head); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }

.section { padding: 110px 0; }

.kicker {
  display: inline-block;
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 18px;
}

.section-head { max-width: 680px; margin: 0 auto 64px; text-align: center; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 16px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 15px 28px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: .98rem;
  cursor: pointer; border: 0; transition: transform .25s var(--ease), background .25s, color .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--yellow); color: var(--black); }
.btn-primary:hover { background: var(--white); box-shadow: 0 12px 30px -10px var(--yellow); }
.btn-ghost { background: rgba(255,255,255,.08); color: var(--white); backdrop-filter: blur(6px); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,.16); }
.btn-dark { background: var(--surface); color: var(--white); border: 1px solid rgba(245,179,1,.45); }
.btn-dark:hover { background: var(--yellow); color: var(--black); border-color: var(--yellow); }
.btn-block { width: 100%; }

/* ============ HEADER ============ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background .35s, backdrop-filter .35s, box-shadow .35s, padding .35s;
  padding: 18px 0;
}
.site-header.scrolled {
  background: rgba(15,15,16,.85);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
  padding: 10px 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand img { height: 70px; width: auto; transition: height .35s; }
.site-header.scrolled .brand img { height: 56px; }

.nav { display: flex; align-items: center; gap: 30px; }
.nav a { font-size: .95rem; font-weight: 500; color: rgba(255,255,255,.85); transition: color .2s; position: relative; }
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0; background: var(--yellow); transition: width .25s var(--ease);
}
.nav a:not(.btn):hover { color: var(--white); }
.nav a:not(.btn):hover::after { width: 100%; }
.nav-cta { padding: 11px 22px; }

.menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.menu-toggle span { width: 26px; height: 2px; background: var(--white); border-radius: 2px; transition: transform .3s, opacity .3s; }
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ HERO ============ */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-overlay {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(15,15,16,.72) 0%, rgba(15,15,16,.55) 45%, rgba(15,15,16,.92) 100%);
}
.hero-content { padding-top: 90px; padding-bottom: 90px; max-width: 860px; }
.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--yellow); border: 1px solid rgba(245,179,1,.35); border-radius: 999px; padding: 8px 16px; margin-bottom: 26px;
}
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 5rem); font-weight: 800; margin-bottom: 22px; }
.hero h1 .hl { color: var(--yellow); }
.hero-sub { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: rgba(255,255,255,.85); max-width: 640px; margin-bottom: 36px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.scroll-cue { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); width: 26px; height: 44px; border: 2px solid rgba(255,255,255,.4); border-radius: 14px; }
.scroll-cue span { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 4px; height: 8px; background: var(--yellow); border-radius: 2px; animation: scrollPulse 1.6s infinite; }
@keyframes scrollPulse { 0% { opacity: 0; transform: translate(-50%, 0); } 50% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 14px); } }

/* ============ STATS ============ */
.stats { background: var(--yellow); color: var(--black); padding: 56px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 24px; }
.stat { text-align: center; }
.stat-num { font-family: var(--font-head); font-weight: 800; font-size: clamp(2.4rem, 4vw, 3.4rem); line-height: 1; }
.stat-label { font-weight: 600; font-size: .95rem; margin-top: 8px; }
.stat:not(:nth-child(3n+1)) { border-left: 1px solid rgba(0,0,0,.12); }

/* ============ SERVIÇOS ============ */
.servicos { background: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card-serv {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 30px; transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.card-serv:hover { transform: translateY(-6px); border-color: rgba(245,179,1,.5); }
.serv-icon { width: 56px; height: 56px; border-radius: 14px; background: rgba(245,179,1,.12); color: var(--yellow); display: grid; place-items: center; margin-bottom: 22px; }
.serv-icon svg { width: 30px; height: 30px; }
.card-serv h3 { font-size: 1.35rem; margin-bottom: 10px; }
.card-serv p { color: var(--muted); font-size: .98rem; }
.card-serv--accent { background: linear-gradient(160deg, var(--yellow) 0%, var(--yellow-deep) 100%); color: var(--black); display: flex; flex-direction: column; justify-content: center; }
.card-serv--accent h3, .card-serv--accent p { color: var(--black); }
.card-serv--accent p { opacity: .85; }
.card-link { display: inline-block; margin-top: 16px; font-family: var(--font-head); font-weight: 700; color: var(--black); }

/* ============ SPLIT (institucional / socio / contato) ============ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split--reverse .split-media { order: 2; }
.split-text h2 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); margin-bottom: 18px; }
.split-text p { color: var(--muted); margin-bottom: 16px; }
.split-media { position: relative; }
.split-media img { width: 100%; height: 460px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.float-badge {
  position: absolute; bottom: -22px; right: -10px; background: var(--yellow); color: var(--black);
  border-radius: var(--radius-sm); padding: 18px 24px; text-align: center; box-shadow: var(--shadow);
}
.float-badge strong { display: block; font-family: var(--font-head); font-weight: 800; font-size: 2rem; line-height: 1; }
.float-badge span { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }

.check-list { margin: 22px 0 28px; display: grid; gap: 12px; }
.check-list li { position: relative; padding-left: 32px; color: rgba(255,255,255,.9); }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; background: var(--yellow); color: var(--black); border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; }

.institucional { background: var(--black); }

/* ============ OBRAS ============ */
.obras { background: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 44px; }
.filter {
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  padding: 10px 22px; border-radius: 999px; font-family: var(--font-head); font-weight: 600; font-size: .9rem;
  cursor: pointer; transition: all .25s var(--ease);
}
.filter:hover { color: var(--white); border-color: rgba(245,179,1,.5); }
.filter.active { background: var(--yellow); color: var(--black); border-color: var(--yellow); }

.obras-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.obra-card {
  position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4/3;
  cursor: default; transition: transform .35s var(--ease), opacity .35s;
}
.obra-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.obra-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.85) 100%); }
.obra-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 18px; transform: translateY(8px); opacity: .92; transition: transform .35s var(--ease), opacity .35s; }
.obra-info h3 { font-size: 1.1rem; }
.obra-info span { font-size: .82rem; color: var(--yellow); font-weight: 600; }
.obra-card:hover { transform: translateY(-5px); }
.obra-card:hover img { transform: scale(1.08); }
.obra-card:hover .obra-info { transform: translateY(0); opacity: 1; }
.obra-card.hide { display: none; }

/* ============ SOCIOAMBIENTAL ============ */
.socio { background: var(--ink); }
.socio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 26px 0; }
.socio-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; }
.socio-item h4 { font-size: 1.02rem; margin-bottom: 6px; color: var(--yellow); }
.socio-item p { color: var(--muted); font-size: .9rem; margin: 0; }
.socio-quote { border-left: 3px solid var(--yellow); padding-left: 18px; font-style: italic; color: rgba(255,255,255,.85); }

/* ============ CONTATO ============ */
.contato { background: var(--black); }
.contato-list { margin-top: 30px; display: grid; gap: 22px; }
.contato-list li { display: flex; gap: 16px; align-items: flex-start; }
.contato-list .ci { font-size: 1.3rem; flex-shrink: 0; }
.contato-list strong { font-family: var(--font-head); }
.contato-list a:hover { color: var(--yellow); }

.contato-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; }
.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 8px; color: rgba(255,255,255,.8); }
.field input, .field textarea {
  width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 15px; color: var(--white); font-family: var(--font-body); font-size: .95rem; transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(245,179,1,.18); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-dark); }
.form-feedback { margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-sm); background: rgba(245,179,1,.14); color: var(--yellow); font-weight: 600; font-size: .92rem; text-align: center; }
.form-feedback.is-error { background: rgba(229,62,62,.15); color: #ff8f8f; }

/* ============ FOOTER ============ */
.site-footer { background: var(--black); border-top: 1px solid var(--line); padding-top: 64px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.footer-brand img { height: 88px; margin-bottom: 16px; }
.footer-brand p { color: var(--muted); max-width: 280px; }
.site-footer h5 { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--yellow); margin-bottom: 18px; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { color: var(--muted); transition: color .2s; }
.footer-nav a:hover { color: var(--white); }
.footer-contact p { color: var(--muted); margin-bottom: 12px; font-size: .95rem; }
.footer-contact a:hover { color: var(--yellow); }
.footer-bottom { border-top: 1px solid var(--line); padding: 22px 0; }
.footer-bottom p { color: var(--muted-dark); font-size: .85rem; text-align: center; }

/* ============ BACK TO TOP ============ */
.back-to-top {
  position: fixed; bottom: 26px; right: 26px; z-index: 90; width: 48px; height: 48px; border-radius: 50%;
  background: var(--yellow); color: var(--black); display: grid; place-items: center; font-size: 1.3rem; font-weight: 700;
  box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(12px); transition: all .3s var(--ease);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--white); }

/* ============ REVEAL ANIMATION ============ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .obras-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .section { padding: 80px 0; }
  .nav {
    position: fixed; top: 0; right: 0; bottom: 0; left: auto; height: 100vh; width: min(78vw, 320px);
    flex-direction: column; align-items: flex-start; justify-content: center; overflow-y: auto;
    gap: 22px; background: var(--ink); padding: 90px 40px 40px; transform: translateX(100%); transition: transform .4s var(--ease); box-shadow: var(--shadow);
  }
  .nav.open { transform: translateX(0); }
  .nav a { font-size: 1.15rem; }
  .menu-toggle { display: flex; z-index: 101; }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .split--reverse .split-media { order: 0; }
  .split-media img { height: 340px; }
  .socio-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 20px; }
  .stats-grid .stat { border-left: 0; }
}

@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .cards { grid-template-columns: 1fr; }
  .obras-grid { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .socio-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============ SUBPÁGINA (Transparência Salarial) ============ */
.site-header.static-solid { background: rgba(15,15,16,.92); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); padding: 12px 0; }
.subpage-hero { background: var(--ink); padding: 150px 0 60px; border-bottom: 1px solid var(--line); }
.subpage-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 18px; }
.legal-note { color: var(--muted); max-width: 780px; font-size: 1.02rem; }
.reports { background: var(--black); padding: 64px 0 110px; }
.report-list { display: grid; gap: 16px; max-width: 860px; }
.report-card {
  display: flex; align-items: center; gap: 22px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 28px; transition: transform .25s var(--ease), border-color .25s;
}
.report-card:hover { transform: translateY(-3px); border-color: rgba(245,179,1,.55); }
.report-ico { width: 50px; height: 50px; flex-shrink: 0; border-radius: 12px; background: rgba(245,179,1,.12); color: var(--yellow); display: grid; place-items: center; }
.report-ico svg { width: 26px; height: 26px; }
.report-body { flex: 1; min-width: 0; }
.report-body h3 { font-size: 1.15rem; margin-bottom: 4px; }
.report-body span { color: var(--muted); font-size: .88rem; }
.report-open { flex-shrink: 0; color: var(--yellow); font-family: var(--font-head); font-weight: 700; font-size: .92rem; white-space: nowrap; }

@media (max-width: 560px) {
  .report-card { flex-wrap: wrap; gap: 14px 18px; padding: 20px; }
  .report-open { width: 100%; }
}

/* ============ FICHA TÉCNICA DA OBRA (modal) ============ */
.obra-card.has-ficha { cursor: pointer; }
.obra-plus {
  position: absolute; top: 10px; right: 10px; z-index: 3; width: 30px; height: 30px;
  border-radius: 50%; background: var(--yellow); color: var(--black);
  display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; line-height: 1;
  opacity: 0; transform: scale(.7); transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.obra-card.has-ficha:hover .obra-plus,
.obra-card.has-ficha:focus-visible .obra-plus { opacity: 1; transform: scale(1); }
.obra-card.has-ficha:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
body.no-scroll { overflow: hidden; }

.obra-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.obra-modal[hidden] { display: none; }
.obra-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.obra-modal-dialog {
  position: relative; z-index: 1; width: min(860px, 100%); max-height: 88vh; overflow: auto;
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 0.92fr 1.08fr; animation: modalIn .35s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.obra-modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 4; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; border: 0; font-size: 1.7rem; line-height: 1; cursor: pointer; transition: background .2s;
}
.obra-modal-close:hover { background: var(--yellow); color: var(--black); }
.obra-modal-media img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; display: block; }
.obra-modal-body { padding: 34px 32px; }
.obra-modal-meta { display: inline-block; font-family: var(--font-body); font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--yellow); margin-bottom: 10px; }
.obra-modal-body h3 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 10px; }
.obra-modal-desc { color: rgba(255,255,255,.9); font-weight: 600; margin-bottom: 18px; }
.obra-modal-vols { display: grid; gap: 0; margin-bottom: 20px; }
.obra-modal-vols li { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.obra-modal-vols span { color: var(--muted); font-size: .92rem; }
.obra-modal-vols strong { font-family: var(--font-head); font-size: 1.05rem; color: var(--yellow); white-space: nowrap; }
.obra-modal-des { color: var(--muted); font-size: .95rem; line-height: 1.7; }

@media (max-width: 680px) {
  .obra-modal { padding: 0; align-items: stretch; }
  .obra-modal-dialog { grid-template-columns: 1fr; max-height: 100vh; border-radius: 0; width: 100%; }
  .obra-modal-media img { min-height: 200px; max-height: 240px; }
  .obra-modal-body { padding: 26px 22px 40px; }
}
