:root {
  --brand-color-primary: #101010;
  --brand-color-secondary: #7A9A01;
  --brand-color-tertiary: #EE741B;

  --color-details: #41504d;
  --color-accent-soft: #bfd56b;
  --color-body-muted: #4a5568;
  --color-text-muted: #495551;
  --color-white: #ffffff;

  --background-base: #ffffff;
  --background-color: var(--background-base);
  --surface-soft: #ffffff;
  --header-topbar-bg: #1b2f24;
  --surface-green-deep: #182a21;
  --surface-dark-fill:
    radial-gradient(ellipse 120% 85% at 0% 100%, rgba(191, 213, 107, 0.08) 0%, transparent 52%),
    radial-gradient(ellipse 95% 75% at 100% 0%, rgba(238, 116, 27, 0.045) 0%, transparent 48%),
    linear-gradient(168deg, #1d3227 0%, var(--surface-green-deep) 50%, #152419 100%);

  /* Textura contínua — zona Soluções → rodapé (ver .site-textured) */
  --site-texture-image: url('assets/textures/site-grain.svg');
  --site-texture-size: 200px;
  --site-texture-opacity: 0.035;
  --surface-textured-fill: linear-gradient(180deg, #ffffff 0%, #fafafa 48%, #ffffff 100%);
  --header-shadow: 0 4px 3px rgba(0, 0, 0, 0.1), 0 2px 2px rgba(0, 0, 0, 0.1);

  --hero-overlay: rgba(0, 0, 0, 0.48);
  --hero-card-bg: #495551;

  /* Marca d'água — ícone Seg Emergência (assets/SVG) */
  --brand-watermark-orange: url('assets/SVG/laranja.svg');
  --brand-watermark-white: url('assets/SVG/branco.svg');

  /* Soluções em Emergências — única seção verde com foto de fundo */
  --emergency-solutions-section-bg: url('assets/images/solucoes-emergencias-industrial.png');
  --emergency-solutions-overlay: rgba(27, 47, 36, 0.97);
  --emergency-solutions-overlay-mid: rgba(27, 47, 36, 0.95);
  --emergency-solutions-panel-bg: rgba(27, 47, 36, 0.62);
  --emergency-solutions-panel-blur: 14px;

  --font-main: 'Manrope', sans-serif;

  /* Tipografia — escala em rem (base 16px) */
  --fs-xs: 0.75rem;       /* 12px — labels, tags, metadados */
  --fs-sm: 0.8125rem;     /* 13px — texto auxiliar */
  --fs-md: 0.875rem;      /* 14px — corpo secundário */
  --fs-base: 1rem;        /* 16px — corpo padrão */
  --fs-body: 0.9375rem;   /* 15px — botões, inputs */
  --fs-lg: 1.125rem;      /* 18px — destaques, CTAs */
  --fs-xl: 1.25rem;       /* 20px — subtítulos */
  --fs-2xl: 1.5rem;       /* 24px — títulos de card */
  --fs-3xl: 1.75rem;      /* 28px — métricas */
  --fs-4xl: 2rem;         /* 32px — h3 seção mobile */
  --fs-5xl: 2.375rem;     /* 38px — títulos médios */
  --fs-6xl: 2.625rem;     /* 42px — títulos grandes */
  --fs-h2: clamp(1.875rem, 2.5vw + 1.125rem, 3rem); /* 30–48px — h2 seções */
  --fs-h2-md: 2.125rem;   /* 34px — h2 compacto em breakpoints */
  --fs-h2-sm: 1.875rem;   /* 30px — h2 mobile */
  --fs-display: clamp(2.5rem, 4vw + 1rem, 4rem);    /* 40–64px — hero */

  --type-eyebrow: var(--fs-xs);
  --type-caption: var(--fs-sm);
  --type-body: var(--fs-base);
  --type-body-sm: var(--fs-md);
  --type-body-md: var(--fs-body);
  --type-button: var(--fs-lg);
  --type-h1: var(--fs-display);
  --type-h2: var(--fs-h2);
  --type-h3: var(--fs-4xl);
  --type-h4: 1.625rem;    /* 26px */
  --type-stat: var(--fs-3xl);
  --type-card-title: 1.3125rem; /* 21px */

  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;

  --container-width: 1140px;

  /* Cantos — imagens e cards (mínimo perceptível, nunca “quadrado”) */
  --radius-card: 1.25rem;   /* 20px — imagens, cards, mapas, painéis principais */
  --radius-inner: 1rem;     /* 16px — painéis internos, abas, itens de lista */
  --radius-chip: 0.75rem;   /* 12px — tags e chips pequenos */
  --radius-pill: 9999px;

  --reveal-distance: 14px;
  --reveal-duration: 0.42s;
  --reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --reveal-stagger: 45ms;

  --scrollbar-size: 10px;
  --scrollbar-track: #f0f0f0;
  --scrollbar-thumb: var(--brand-color-secondary);
  --scrollbar-thumb-hover: var(--brand-color-tertiary);
  --scrollbar-thumb-active: #c45f12;
  --scrollbar-border: rgba(255, 255, 255, 0.65);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 112px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  font-size: 100%;
  background-color: var(--background-base);
}

body {
  font-family: var(--font-main);
  font-size: var(--type-body);
  font-weight: 400;
  line-height: var(--leading-relaxed);
  color: var(--brand-color-primary);
  background-color: var(--color-white);
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(238, 116, 27, 0.22);
}

/* Fundo + grão únicos: Nossa História até o rodapé (seções claras contínuas) */
.site-textured {
  position: relative;
  isolation: isolate;
  background-color: var(--background-base);
  background-image: var(--surface-textured-fill);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center top;
}

.site-textured::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  background-image: var(--site-texture-image);
  background-repeat: repeat;
  background-size: var(--site-texture-size) var(--site-texture-size);
  opacity: var(--site-texture-opacity);
}

.site-textured > section,
.site-textured > .site-footer {
  position: relative;
  z-index: 1;
  margin-top: 0;
}

.site-textured > section:not(.emergency-flow):not(.emergency-solutions):not(.location-contact) {
  background: transparent;
}

.site-textured > .site-footer {
  background: transparent;
}

@media (prefers-contrast: more) {
  .site-textured::before {
    opacity: 0.022;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-textured::before {
    opacity: calc(var(--site-texture-opacity) * 0.65);
  }
}

/* Scrollbar vertical — paleta Seg Emergência (Chrome, Safari, Edge) */
*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-left: 1px solid rgba(27, 47, 36, 0.06);
}

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid var(--scrollbar-border);
  background: linear-gradient(
    180deg,
    var(--color-accent-soft) 0%,
    var(--scrollbar-thumb) 42%,
    var(--scrollbar-thumb-hover) 100%
  );
  box-shadow: 0 1px 3px rgba(16, 16, 16, 0.12);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    var(--scrollbar-thumb) 0%,
    var(--scrollbar-thumb-hover) 55%,
    var(--scrollbar-thumb-active) 100%
  );
}

*::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 9999;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--brand-color-tertiary);
  color: var(--color-white);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 200ms ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

section[id],
article[id] {
  scroll-margin-top: 112px;
}

img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--brand-color-tertiary);
  outline-offset: 4px;
}

h1 {
  font-size: var(--type-h1);
  line-height: var(--leading-tight);
  font-weight: 700;
}

h2 {
  font-size: var(--type-h2);
  line-height: var(--leading-tight);
  font-weight: 700;
}

h3 {
  font-size: var(--type-h3);
  line-height: var(--leading-tight);
  font-weight: 700;
}

h4 {
  font-size: var(--type-h4);
  line-height: var(--leading-tight);
  font-weight: 700;
}

p {
  font-size: var(--type-body);
  line-height: var(--leading-relaxed);
  font-weight: 400;
}

button, .button {
  font-family: var(--font-main);
  font-size: var(--type-button);
  line-height: var(--leading-tight);
  font-weight: 600;
}

@media (max-width: 768px) {
  :root {
    --type-h3: 1.25rem;
    --type-h4: 1.125rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html.js-reveal-ready .header [data-reveal]:not(.is-revealed) {
    pointer-events: none;
  }

  html.js-reveal-ready [data-reveal] {
    opacity: 0;
    transform: translate3d(0, var(--reveal-distance), 0);
    will-change: opacity, transform;
    transition:
      opacity var(--reveal-duration) var(--reveal-ease),
      transform var(--reveal-duration) var(--reveal-ease);
    transition-delay: var(--reveal-delay, 0ms);
  }

  html.js-reveal-ready [data-reveal].is-revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}