/* ============================================================
   SafetyCare: consultoria em segurança do trabalho
   Direção: documento técnico. Tipografia industrial (Archivo) +
   técnica (IBM Plex Sans/Mono). Cor derivada da logo metálica:
   azul-aço e bronze. Assinatura: a matriz de risco do PGR (NR-01).
   ============================================================ */

:root {
  /* base */
  --ink:        #060d18;
  --navy-900:   #0b1626;
  --navy-800:   #12233a;
  --navy-700:   #1c3352;
  --steel-300:  #8fb4dd;
  --steel-500:  #4b7fb5;

  /* acento metálico (herdado da logo) */
  --bronze-300: #f0c68c;
  --bronze-500: #d29553;
  --bronze-700: #a4652c;

  /* superfícies claras */
  --paper:      #f7f8fa;
  --paper-alt:  #eceff4;
  --white:      #ffffff;

  /* texto */
  --text:       #0b1626;
  --text-mute:  #5d6b80;
  --text-faint: #8b97a8;

  /* linhas */
  --line-dark:  rgba(255, 255, 255, 0.12);
  --line-light: #dde3ec;

  /* escala de risco, funcional, usada só na matriz */
  --risk-low:   #2e9e63;
  --risk-mod:   #d3ad3c;
  --risk-high:  #dd7f3c;
  --risk-crit:  #cf4038;

  /* tipografia */
  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body:    'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --container: 1140px;
  --gutter: 1.5rem;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

:focus-visible {
  outline: 2px solid var(--bronze-500);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- tipografia ---------- */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.028em;
}

.h-xl {
  font-size: clamp(2.5rem, 5.4vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: -0.038em;
}
.h-lg { font-size: clamp(1.85rem, 3.1vw, 2.75rem); letter-spacing: -0.03em; }
.h-sm { font-family: var(--display); font-size: 1.05rem; font-weight: 700; letter-spacing: -0.012em; line-height: 1.25; }

.kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bronze-700);
}
.on-dark .kicker { color: var(--bronze-300); }

.lead {
  font-size: 1.09rem;
  line-height: 1.62;
  color: var(--text-mute);
  max-width: 58ch;
}
.on-dark .lead { color: rgba(255, 255, 255, 0.72); }

/* ---------- seções ---------- */

.section { padding-block: clamp(4.25rem, 8vw, 7.5rem); }
.section--paper { background: var(--paper); }
.section--dark { background: var(--ink); color: var(--white); }

/* cabeçalho de seção: regra fina + kicker, ancorado à esquerda
   (a regra marca o início da seção, como num documento técnico) */
.shead {
  border-top: 1px solid var(--line-light);
  padding-top: 1.15rem;
  margin-bottom: clamp(2.5rem, 4vw, 3.5rem);
  max-width: 62ch;
}
.on-dark .shead { border-top-color: var(--line-dark); }
.shead h2 { margin-top: 0.55rem; }
.shead .lead { margin-top: 0.9rem; }

/* ---------- botões ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  height: 50px;
  padding-inline: 1.7rem;
  border-radius: 4px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.005em;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.btn:active { transform: translateY(1px); }

/* primário: gradiente metálico, ecoa o relevo da logo */
.btn-primary {
  color: #2b1a08;
  background: linear-gradient(163deg, var(--bronze-300) 0%, var(--bronze-500) 48%, var(--bronze-700) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary:hover { filter: brightness(1.07); }

.btn-line {
  border: 1px solid var(--line-dark);
  color: var(--white);
}
.btn-line:hover { border-color: var(--bronze-300); color: var(--bronze-300); }

.btn-line-dark {
  border: 1px solid var(--line-light);
  color: var(--text);
}
.btn-line-dark:hover { border-color: var(--navy-900); background: var(--navy-900); color: var(--white); }

.btn-block { width: 100%; }

/* ---------- header ---------- */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  background: rgba(6, 13, 24, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line-dark);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 112px;
  transition: height 0.3s ease;
}
.header.is-scrolled .header__inner { height: 84px; }

.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand img {
  height: 88px;
  width: auto;
  transition: height 0.3s ease;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.45));
}
.header.is-scrolled .brand img { height: 64px; }
.brand span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: -0.025em;
  color: var(--white);
}
.brand b { color: var(--bronze-300); font-weight: 700; }

.nav { display: flex; align-items: center; gap: 1.9rem; }
.nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.16s ease;
}
.nav a:hover { color: var(--bronze-300); }

.header__actions { display: flex; align-items: center; gap: 1.1rem; }
.header__actions .btn { height: 42px; padding-inline: 1.25rem; font-size: 0.88rem; }

.navtoggle { display: none; width: 42px; height: 42px; position: relative; }
.navtoggle span {
  position: absolute; left: 10px; right: 10px; height: 1.5px;
  background: var(--white); transition: transform 0.22s ease, opacity 0.22s ease;
}
.navtoggle span:nth-child(1) { top: 15px; }
.navtoggle span:nth-child(2) { top: 20.5px; }
.navtoggle span:nth-child(3) { top: 26px; }
.navtoggle.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.navtoggle.is-open span:nth-child(2) { opacity: 0; }
.navtoggle.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  background: var(--ink);
  color: var(--white);
  padding-top: clamp(9.5rem, 14vw, 13rem);
  padding-bottom: clamp(4.5rem, 8vw, 7rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 70% at 78% 18%, rgba(75, 127, 181, 0.20), transparent 62%),
    radial-gradient(60% 50% at 12% 92%, rgba(210, 149, 83, 0.10), transparent 70%);
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}
.hero h1 { margin-top: 1.1rem; }
.hero h1 em { font-style: normal; color: var(--bronze-300); }
.hero .lead { margin-top: 1.35rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2.2rem; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  margin-top: 2.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-dark);
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.52);
}

/* ---------- assinatura: matriz de risco ---------- */

.matrix {
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(28, 51, 82, 0.42), rgba(11, 22, 38, 0.42));
  padding: clamp(1.1rem, 2vw, 1.6rem);
}
.matrix__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line-dark);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.matrix__head b { color: var(--white); font-weight: 500; }
.matrix__head span { color: rgba(255, 255, 255, 0.42); }

.matrix__plot {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.matrix__ylab, .matrix__xlab {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}
.matrix__ylab {
  grid-column: 1; grid-row: 1;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  align-self: center;
}
.matrix__xlab { grid-column: 2; grid-row: 2; text-align: center; padding-top: 0.15rem; }

.matrix__grid {
  grid-column: 2; grid-row: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 1fr;
  gap: 3px;
  aspect-ratio: 1.15 / 1;
}
.cell {
  border-radius: 2px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}
.cell { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.cell--low  { background: color-mix(in srgb, var(--risk-low)  75%, #0b1728); }
.cell--mod  { background: color-mix(in srgb, var(--risk-mod)  75%, #0b1728); }
.cell--high { background: color-mix(in srgb, var(--risk-high) 75%, #0b1728); }
.cell--crit { background: color-mix(in srgb, var(--risk-crit) 75%, #0b1728); }

/* marcadores: onde a operação estava e onde ela chega */
.pin {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.42rem;
  border-radius: 2px;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}
.pin--from {
  background: #060d18;
  color: #ff9d94;
  box-shadow: inset 0 0 0 1px rgba(255, 157, 148, 0.5);
}
.pin--to {
  background: #060d18;
  color: #6fe3a6;
  box-shadow: inset 0 0 0 1px rgba(111, 227, 166, 0.55);
  animation: pin-in 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) 1.1s both;
}
@keyframes pin-in {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

.matrix__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.05rem;
  margin-top: 1.15rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line-dark);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.matrix__legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 0.4rem; }
.matrix__note {
  margin-top: 0.85rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- barra de credenciais ---------- */

.credbar { background: var(--navy-900); color: rgba(255, 255, 255, 0.62); }
.credbar__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.4rem;
  padding-block: 1.15rem;
  font-family: var(--mono);
  font-size: 0.71rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.credbar__inner span::before { content: "· "; color: var(--bronze-500); }

/* ---------- serviços ---------- */

.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-light);
  border: 1px solid var(--line-light);
}
.svc {
  background: var(--white);
  padding: clamp(1.6rem, 2.6vw, 2.1rem);
  transition: background 0.2s ease;
}
.svc:hover { background: var(--paper); }
.svc svg { width: 22px; height: 22px; color: var(--bronze-700); stroke-width: 1.5; }
.svc h3 { margin: 1.1rem 0 0.5rem; }
.svc p { font-size: 0.93rem; color: var(--text-mute); }

/* ---------- normas (vernáculo real do setor) ---------- */

.norms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.norms span {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.82);
  transition: border-color 0.18s ease, color 0.18s ease;
}
.norms span:hover { border-color: var(--bronze-500); color: var(--bronze-300); }

/* ---------- método (sequência real: numeração justificada) ---------- */

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-light); border-top: 1px solid var(--line-light); border-bottom: 1px solid var(--line-light); }
.step { background: var(--paper); padding: 1.9rem 1.4rem 2.1rem; }
.step__n {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--bronze-700);
}
.step h3 { margin: 0.9rem 0 0.45rem; }
.step p { font-size: 0.9rem; color: var(--text-mute); }

/* ---------- segmentos ---------- */

.segs { display: flex; flex-wrap: wrap; gap: 0.6rem 0; }
.segs li {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  letter-spacing: -0.02em;
  padding-right: 1.1rem;
  margin-right: 1.1rem;
  border-right: 1px solid var(--line-light);
  color: var(--text);
}
.segs li:last-child { border-right: none; }

/* ---------- CTA ---------- */

.cta {
  background: var(--ink);
  color: var(--white);
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
}
.cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.cta h2 { max-width: 20ch; }
.cta__actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* ---------- contato ---------- */

.contact { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2.5rem, 5vw, 4rem); }

.cinfo { display: grid; gap: 1.5rem; margin-top: 2.2rem; }
.cinfo a, .cinfo div { display: block; }
.cinfo dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.28rem;
}
.cinfo dd { font-family: var(--display); font-weight: 600; font-size: 1.02rem; letter-spacing: -0.015em; }
.cinfo dd a:hover { color: var(--bronze-700); }

.form { background: var(--white); border: 1px solid var(--line-light); padding: clamp(1.6rem, 3vw, 2.2rem); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { margin-bottom: 1.05rem; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 0.4rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--line-light);
  border-radius: 3px;
  padding: 0.72rem 0.85rem;
  transition: border-color 0.16s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--navy-800);
}
.field textarea { resize: vertical; min-height: 104px; }
.form-note { font-size: 0.78rem; color: var(--text-faint); margin-top: 0.8rem; }

/* ---------- rodapé ---------- */

.footer { background: var(--ink); color: rgba(255, 255, 255, 0.6); padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line-dark);
}
.footer .brand { margin-bottom: 1.15rem; }
.footer .brand img { height: 62px; }
.footer .brand span { font-size: 1.25rem; }
.footer__desc { font-size: 0.88rem; max-width: 34ch; color: rgba(255, 255, 255, 0.5); }
.footer h4 {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  margin-bottom: 1.05rem;
}
.footer ul { display: grid; gap: 0.65rem; }
.footer li, .footer ul a { font-size: 0.9rem; color: rgba(255, 255, 255, 0.68); }
.footer ul a:hover { color: var(--bronze-300); }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.38);
}
.socials { display: flex; gap: 0.5rem; }
.socials a {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.socials svg { width: 15px; height: 15px; }
.socials a:hover { border-color: var(--bronze-500); color: var(--bronze-300); }

/* ---------- WhatsApp ---------- */

.wa {
  position: fixed;
  right: 1.3rem;
  bottom: 1.3rem;
  z-index: 90;
  display: flex;
  align-items: center;
  height: 54px;
  border-radius: 27px;
  background: #1fb457;
  color: #fff;
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.55);
  transition: padding-right 0.26s ease, background 0.18s ease;
}
.wa svg { width: 26px; height: 26px; padding: 14px; box-sizing: content-box; flex: none; }
.wa span {
  max-width: 0; min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  transition: max-width 0.26s ease, opacity 0.2s ease;
}
.wa:hover { background: #1aa04e; padding-right: 1.15rem; }
.wa:hover span, .wa:focus-visible span { max-width: 180px; opacity: 1; }
.wa:focus-visible { padding-right: 1.15rem; }

/* ---------- reveal (progressivo: visível sem JS) ---------- */

body.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
body.js-reveal [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- responsivo ---------- */

@media (max-width: 1000px) {
  .hero__grid { grid-template-columns: 1fr; }
  .matrix { max-width: 520px; }
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  /* logo maior nao cabe num header de mobile: reduz proporcionalmente */
  .header__inner { height: 84px; }
  .header.is-scrolled .header__inner { height: 70px; }
  .brand img { height: 62px; }
  .header.is-scrolled .brand img { height: 50px; }
  .brand span { font-size: 1.2rem; }

  .nav {
    position: fixed;
    inset: 70px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.15rem;
    padding: 1.6rem var(--gutter) 2rem;
    background: rgba(6, 13, 24, 0.98);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-dark);
    transform: translateY(-135%);
    transition: transform 0.28s ease;
  }
  .nav.is-open { transform: none; }
  .nav a { font-size: 0.82rem; }
  .navtoggle { display: block; }
  .header__actions .btn { display: none; }
  .svc-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
  .wa span { display: none; }
}

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