/* ============================================================================
   BENEMÉRITO ENGENHARIA — Design System
   Concept: "Blueprint de precisão" — azul engenharia + concreto quente + âmbar
   Fonts: Exo (display) · Public Sans (texto) · mono do sistema (labels técnicos)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Marca — azul reservado só para AÇÃO/ESTADO (nunca decoração) */
  --brand:        #0b3f8c;
  --brand-600:    #0e4aa0;
  --brand-700:    #0a3576;
  --brand-800:    #23201a;
  --brand-900:    #16140f;   /* superfícies escuras = preto quente, sem navy */
  --brand-bright: #3a72d0;
  --brand-tint:   #e9eef7;

  /* Legado "accent" mapeado ao azul (paleta monocromática) */
  --accent:       #0b3f8c;
  --accent-600:   #0a3576;
  --accent-tint:  #e9eef7;

  /* Neutros — osso / concreto (dominante ~60%) */
  --paper:        #F1EFE9;
  --paper-2:      #E7E3DA;
  --paper-3:      #DCD7C9;
  --white:        #FBFAF6;
  --line:         #DBD5C8;
  --line-strong:  #C4BDAC;

  /* Tinta quente / texto */
  --ink:          #17150F;
  --ink-2:        #55514A;
  --muted:        #837E73;
  --on-dark:      #EDEAE1;
  --on-dark-2:    #A7A196;

  /* Sinais (dessaturados; WhatsApp mantém verde reconhecível) */
  --wa:           #25D366;
  --ok:           #2E7D52;
  --warn:         #B5771F;
  --err:          #B23B3B;

  /* Tipografia */
  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-sans:    "Public Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  --font-mono:    "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Escala fluida */
  --step--2: clamp(0.69rem, 0.67rem + 0.10vw, 0.75rem);
  --step--1: clamp(0.83rem, 0.79rem + 0.18vw, 0.94rem);
  --step-0:  clamp(1.00rem, 0.95rem + 0.24vw, 1.13rem);
  --step-1:  clamp(1.20rem, 1.12rem + 0.40vw, 1.50rem);
  --step-2:  clamp(1.44rem, 1.31rem + 0.66vw, 2.00rem);
  --step-3:  clamp(1.73rem, 1.52rem + 1.05vw, 2.66rem);
  --step-4:  clamp(2.07rem, 1.75rem + 1.60vw, 3.55rem);
  --step-5:  clamp(2.49rem, 2.00rem + 2.45vw, 4.74rem);
  --step-6:  clamp(2.99rem, 2.25rem + 3.68vw, 6.31rem);

  /* Espaçamento (8pt) */
  --sp-1: 0.5rem;  --sp-2: 1rem;   --sp-3: 1.5rem; --sp-4: 2rem;
  --sp-5: 3rem;    --sp-6: 4rem;   --sp-7: 6rem;   --sp-8: 8rem;   --sp-9: 12rem;

  /* Layout */
  --container: 1240px;
  --container-narrow: 820px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  /* Raio / sombra / motion */
  --r-sm: 3px; --r-md: 7px; --r-lg: 12px; --r-xl: 18px; --r-pill: 999px;
  --r-btn: 9px;
  --sh-1: 0 1px 2px rgba(20,19,15,.05), 0 1px 3px rgba(20,19,15,.05);
  --sh-2: 0 10px 30px -16px rgba(20,19,15,.20), 0 2px 8px rgba(20,19,15,.05);
  --sh-3: 0 44px 80px -44px rgba(20,19,15,.40), 0 14px 30px -20px rgba(20,19,15,.16);
  --sh-brand: 0 16px 34px -18px rgba(20,19,15,.32);
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur: .5s;
}

/* ---------- Reset ---------- */
*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img,svg,video,canvas { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
input,textarea,select { font: inherit; color: inherit; }
ul,ol { list-style: none; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand-bright); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--brand); color: #fff; }

/* ---------- Tipografia (serifa editorial Fraunces) ---------- */
h1,h2,h3,h4 { font-family: var(--font-display); font-optical-sizing: auto; font-weight: 480; line-height: 1.03; letter-spacing: -.018em; color: var(--ink); }
h1 { font-size: var(--step-6); line-height: .97; }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); font-weight: 520; letter-spacing: -.012em; }
h4 { font-size: var(--step-1); font-weight: 560; letter-spacing: -.005em; }
p { text-wrap: pretty; }
.display { font-family: var(--font-display); font-optical-sizing: auto; font-weight: 460; line-height: .95; letter-spacing: -.022em; }
.lead { font-size: var(--step-1); color: var(--ink-2); line-height: 1.55; font-weight: 400; font-family: var(--font-sans); }
strong { font-weight: 600; }

/* Label técnico (mono, neutro — nada de cor decorativa) */
.eyebrow {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: var(--font-mono); font-size: var(--step--2);
  text-transform: uppercase; letter-spacing: .18em; font-weight: 400;
  color: var(--muted);
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--line-strong); }
.eyebrow.on-dark { color: var(--on-dark-2); }
.eyebrow.on-dark::before { background: rgba(255,255,255,.28); }

.grad-text { color: var(--brand); }
.accent-text { font-style: italic; font-weight: 460; color: var(--brand-bright); } /* ênfase editorial */

/* ---------- Layout utils ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: var(--container-narrow); }
.section { padding-block: clamp(4rem, 9vw, 8rem); position: relative; }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.stack > * + * { margin-top: var(--sp-3); }
.grid { display: grid; gap: var(--sp-4); }
.flex { display: flex; }
.hidden { display: none !important; }
@media (max-width: 720px){ .hide-mobile { display: none !important; } }

/* Cabeçalho de seção com numeração de dossiê */
.section-head { display: grid; gap: 1rem; max-width: 60ch; }
.section-head .index {
  font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted);
  letter-spacing: .1em;
}
.section-head .index b { color: var(--ink); font-weight: 700; }
.section-head h2 { margin-top: .2rem; }
.section-head p { color: var(--ink-2); }
.section-head.center { margin-inline: auto; text-align: center; justify-items: center; }
.section-head.center .eyebrow { justify-content: center; }

/* Textura de fundo — desligada (visual editorial limpo, sem grid decorativo) */
.blueprint-bg { position: relative; }
.blueprint-bg::before { content: none; }

/* Superfícies */
.surface-dark { background: var(--brand-900); color: var(--on-dark); position: relative; }
.surface-dark::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(130% 90% at 50% -15%, rgba(255,255,255,.055), transparent 55%); }
.surface-dark > * { position: relative; z-index: 1; }
.surface-dark h1,.surface-dark h2,.surface-dark h3,.surface-dark h4 { color: #fff; }
.surface-dark .lead { color: var(--on-dark-2); }
.surface-blue { background: var(--brand-900); color: #fff; }
.surface-paper2 { background: var(--paper-2); }

/* ---------- Botões ---------- */
.btn {
  --bg: var(--brand); --fg: #fff; --bd: transparent;
  position: relative; display: inline-flex; align-items: center; gap: .55rem;
  padding: .9rem 1.4rem; border-radius: var(--r-btn);
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd);
  font-family: var(--font-sans); font-weight: 600; font-size: var(--step--1); letter-spacing: .005em;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), background .25s, color .25s, border-color .25s;
  will-change: transform;
}
.btn svg { width: 1.05em; height: 1.05em; transition: transform .35s var(--ease-out); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--sh-brand); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: translateY(0); }
.btn--primary { --bg: var(--brand); box-shadow: var(--sh-2); }
.btn--accent { --bg: var(--brand); --fg: #fff; box-shadow: var(--sh-2); }
.btn--primary:hover, .btn--accent:hover { --bg: var(--brand-700); }
.btn--ghost { --bg: transparent; --fg: var(--ink); --bd: var(--line-strong); box-shadow: none; }
.btn--ghost:hover { --bd: var(--ink); --fg: var(--ink); box-shadow: none; background: rgba(23,21,15,.04); }
.btn--on-dark { --bg: rgba(255,255,255,.06); --fg:#fff; --bd: rgba(255,255,255,.3); backdrop-filter: blur(6px); }
.btn--on-dark:hover { --bg: #fff; --fg: var(--ink); box-shadow: 0 20px 40px -20px rgba(0,0,0,.5); }
.btn--wa { --bg: var(--wa); --fg: #06381f; }
.btn--lg { padding: 1.05rem 1.8rem; font-size: var(--step-0); }
.btn--block { width: 100%; justify-content: center; }

.link-underline { position: relative; color: var(--brand); font-weight: 600; }
.link-underline::after { content:""; position:absolute; left:0; bottom:-2px; width:100%; height:1.5px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease-out); }
.link-underline:hover::after { transform: scaleX(1); transform-origin: left; }

/* Chip / tag */
.chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem;
  border-radius: var(--r-pill); background: var(--brand-tint); color: var(--brand-700);
  font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: .04em; font-weight: 500;
}
.chip .dot { width: .5rem; height:.5rem; border-radius: 50%; background: currentColor; }
.chip--ok { background: #e2f4ea; color: var(--ok); }
.chip--warn { background: #efe6d4; color: var(--warn); }
.chip--muted { background: var(--paper-3); color: var(--ink-2); }

/* ---------- Cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-4); box-shadow: var(--sh-1);
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), border-color .3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: var(--line-strong); }
.card__ico {
  width: 52px; height: 52px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand); margin-bottom: 1.2rem;
}
.card__ico svg { width: 26px; height: 26px; }
.card h3 { font-size: var(--step-1); margin-bottom: .5rem; }
.card p { color: var(--ink-2); font-size: var(--step--1); }
.card--num { counter-increment: step; }
.card--num .num { font-family: var(--font-mono); color: var(--brand); font-size: var(--step--1); font-weight: 700; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: transform .4s var(--ease), background .4s, box-shadow .4s, border-color .4s;
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 0;
}
.site-header::before {
  content:""; position:absolute; inset:0; z-index:-1; opacity:0;
  background: rgba(245,243,239,.82); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line); transition: opacity .4s var(--ease);
}
.site-header.scrolled::before { opacity: 1; }
.site-header.hide { transform: translateY(-110%); }
.brand-logo { display: flex; align-items: center; gap: .7rem; }
.brand-logo img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: 2.1rem; }
.nav a { font-size: var(--step--1); font-weight: 500; color: var(--ink-2); position: relative; padding: .3rem 0; transition: color .25s; }
.nav a::after { content:""; position:absolute; left:0; bottom:-2px; height:2px; width:100%; background: var(--brand); transform: scaleX(0); transform-origin:left; transition: transform .35s var(--ease-out); }
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--brand); }
.header-cta { display: flex; align-items: center; gap: .7rem; }

/* Botão menu (mobile) */
.menu-btn { display: none; width: 46px; height: 46px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--white); }
.menu-btn span { display:block; width: 20px; height: 2px; background: var(--ink); margin: 4px auto; transition: transform .35s var(--ease), opacity .25s; }
.menu-open .menu-btn span:nth-child(1){ transform: translateY(6px) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2){ opacity: 0; }
.menu-open .menu-btn span:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }

/* Overlay mobile */
.mobile-nav {
  position: fixed; inset: 0; z-index: 90; background: var(--brand-900); color: #fff;
  padding: 6rem var(--gutter) 2rem; display: flex; flex-direction: column; gap: 1.5rem;
  transform: translateY(-100%); transition: transform .55s var(--ease-out); visibility: hidden;
}
.menu-open .mobile-nav { transform: translateY(0); visibility: visible; }
.mobile-nav a { font-family: var(--font-display); font-size: var(--step-3); font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.12); padding-bottom: 1rem; opacity: 0; transform: translateY(18px); }
.menu-open .mobile-nav a { animation: mnav .5s var(--ease-out) forwards; }
.menu-open .mobile-nav a:nth-child(1){ animation-delay:.08s } .menu-open .mobile-nav a:nth-child(2){ animation-delay:.14s }
.menu-open .mobile-nav a:nth-child(3){ animation-delay:.20s } .menu-open .mobile-nav a:nth-child(4){ animation-delay:.26s }
.menu-open .mobile-nav a:nth-child(5){ animation-delay:.32s } .menu-open .mobile-nav a:nth-child(6){ animation-delay:.38s }
@keyframes mnav { to { opacity:1; transform: none; } }
.mobile-nav .m-cta { margin-top: auto; display: grid; gap: .8rem; }

@media (max-width: 940px){
  .nav, .header-cta .btn--ghost { display: none; }
  .menu-btn { display: block; }
}

/* Header sobre hero escuro (antes do scroll) — legibilidade */
.site-header.over-dark:not(.scrolled) .brand-logo img { filter: brightness(0) invert(1); }
.site-header.over-dark:not(.scrolled) .nav a { color: rgba(255,255,255,.82); }
.site-header.over-dark:not(.scrolled) .nav a:hover { color: #fff; }
.site-header.over-dark:not(.scrolled) .nav a::after { background: var(--accent); }
.site-header.over-dark:not(.scrolled) .nav a[aria-current="page"] { color: #fff; }
.site-header.over-dark:not(.scrolled) .btn--ghost { --fg: #fff; --bd: rgba(255,255,255,.5); }
.site-header.over-dark:not(.scrolled) .btn--ghost:hover { --fg: var(--brand-900); --bd: #fff; background: #fff; }
.site-header.over-dark:not(.scrolled) .menu-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); }
.site-header.over-dark:not(.scrolled) .menu-btn span { background: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-900); color: var(--on-dark-2); position: relative; overflow: hidden; }
.site-footer .container { position: relative; z-index: 1; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2.5rem; padding-block: clamp(3rem,6vw,5rem); }
.site-footer h4 { color: #fff; font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: .18em; font-weight: 500; margin-bottom: 1.2rem; }
.site-footer a { color: var(--on-dark-2); transition: color .25s; }
.site-footer a:hover { color: #fff; }
.footer-links { display: grid; gap: .8rem; font-size: var(--step--1); }
.footer-brand img { height: 44px; margin-bottom: 1.2rem; }
.footer-brand p { color: var(--on-dark-2); font-size: var(--step--1); max-width: 34ch; }
.footer-social { display: flex; gap: .6rem; margin-top: 1.4rem; }
.footer-social a { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); display: grid; place-items: center; transition: background .25s, border-color .25s, transform .25s; }
.footer-social a:hover { background: var(--brand); border-color: var(--brand); transform: translateY(-2px); }
.footer-social svg { width: 18px; height: 18px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-block: 1.6rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; font-size: var(--step--2); font-family: var(--font-mono); letter-spacing: .02em; }
.footer-bottom .crea { color: var(--on-dark-2); }
@media (max-width: 860px){ .footer-top { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (max-width: 520px){ .footer-top { grid-template-columns: 1fr; } }

/* ---------- WhatsApp flutuante ---------- */
.wa-float {
  position: fixed; right: clamp(1rem,3vw,1.8rem); bottom: clamp(1rem,3vw,1.8rem); z-index: 80;
  display: flex; align-items: center; gap: .7rem; padding: .8rem 1.1rem .8rem .85rem;
  background: var(--wa); color: #06381f; border-radius: var(--r-pill); font-weight: 700; font-size: var(--step--1);
  box-shadow: 0 18px 40px -14px rgba(37,211,102,.6); transition: transform .4s var(--ease-out), box-shadow .4s;
  transform: translateY(0);
}
.wa-float:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 24px 50px -14px rgba(37,211,102,.7); }
.wa-float svg { width: 26px; height: 26px; }
.wa-float .wa-txt { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width .5s var(--ease-out), opacity .4s; }
.wa-float:hover .wa-txt { max-width: 180px; opacity: 1; }
.wa-float::after { content:""; position:absolute; inset:0; border-radius: inherit; border: 2px solid var(--wa); animation: waPulse 2.6s var(--ease-out) infinite; }
@keyframes waPulse { 0%{ transform: scale(1); opacity:.55 } 100%{ transform: scale(1.5); opacity:0 } }
@media (max-width:520px){ .wa-float .wa-txt { display:none; } }

/* ---------- Banner LGPD ---------- */
.lgpd {
  position: fixed; left: clamp(1rem,3vw,1.8rem); bottom: clamp(1rem,3vw,1.8rem); z-index: 85;
  max-width: 420px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.4rem; box-shadow: var(--sh-3); transform: translateY(160%); transition: transform .6s var(--ease-out);
}
.lgpd.show { transform: translateY(0); }
.lgpd h4 { font-size: var(--step-0); margin-bottom: .4rem; }
.lgpd p { font-size: var(--step--2); color: var(--ink-2); line-height: 1.55; }
.lgpd p a { color: var(--brand); text-decoration: underline; }
.lgpd .row { display: flex; gap: .6rem; margin-top: 1rem; }
.lgpd .btn { padding: .6rem 1.1rem; font-size: var(--step--2); }
@media (max-width:520px){ .lgpd { left: 1rem; right: 1rem; max-width: none; } }

/* ---------- Reveal (GSAP fallback-safe) ---------- */
[data-reveal] { opacity: 0; transform: translateY(28px); }
.reveal-in [data-reveal], [data-reveal].is-in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; white-space: nowrap; }
.marquee__track { display: inline-flex; gap: 3.5rem; padding-right: 3.5rem; animation: marq 28s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track span { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.4rem,4vw,2.4rem); color: transparent; -webkit-text-stroke: 1px var(--line-strong); letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 3.5rem; }
.marquee__track span::after { content:"◆"; -webkit-text-stroke: 0; color: var(--accent); font-size: .6em; }
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- Stat ---------- */
.stat .n { font-family: var(--font-display); font-weight: 800; font-size: var(--step-5); line-height: 1; color: var(--brand); letter-spacing: -.03em; }
.surface-dark .stat .n { color: #fff; }
.stat .n .suffix { color: var(--accent); }
.stat .l { font-size: var(--step--1); color: var(--muted); margin-top: .4rem; }
.surface-dark .stat .l { color: var(--on-dark-2); }

/* ---------- Divisórias técnicas ---------- */
.rule { height: 1px; background: var(--line); border: 0; }
.tick-row { display: flex; align-items: center; gap: 1rem; font-family: var(--font-mono); font-size: var(--step--2); color: var(--muted); letter-spacing: .06em; }
.tick-row::before, .tick-row::after { content:""; height:1px; flex:1; background: var(--line); }

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-reveal]{ opacity:1 !important; transform:none !important; }
}
