/* ==========================================================================
   Karpowership Brasil — protótipo
   Design system extraído de karpowershipbrasil.com.br
   Regra: Bootstrap restilizado só por variáveis; sem classes novas.
   ========================================================================== */

/* Fontes ------------------------------------------------------------------ */
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Variáveis do tema (sobrescrita do Bootstrap) ------------------------------ */
:root {
  --bs-primary: #0056a5;
  --bs-primary-rgb: 0, 86, 165;
  --bs-dark: #191919;
  --bs-dark-rgb: 25, 25, 25;
  --bs-light: #f8f8f8;
  --bs-light-rgb: 248, 248, 248;
  --bs-secondary: #626262;
  --bs-secondary-rgb: 98, 98, 98;
  --bs-body-color: #626262;
  --bs-body-color-rgb: 98, 98, 98;
  --bs-heading-color: #161922;
  --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-btn-font-family: var(--bs-font-sans-serif);
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.7;
  --bs-border-color: #cccccc;
  --bs-border-radius: 0;
  --bs-border-radius-sm: 0;
  --bs-border-radius-lg: 0;
  --bs-link-color: #0056a5;
  --bs-link-color-rgb: 0, 86, 165;
  --bs-link-hover-color: #003f78;
  --bs-link-hover-color-rgb: 0, 63, 120;
  --bs-box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.12);
}

html {
  scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  line-height: 1.15;
}

section {
  scroll-margin-top: 7rem;
}

/* Botões (variáveis do próprio Bootstrap) ----------------------------------- */
.btn {
  --bs-btn-border-radius: 0;
  --bs-btn-padding-x: 1.75rem;
  --bs-btn-padding-y: 0.8rem;
  --bs-btn-font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}

.btn-primary {
  --bs-btn-bg: #0056a5;
  --bs-btn-border-color: #0056a5;
  --bs-btn-hover-bg: #003f78;
  --bs-btn-hover-border-color: #003f78;
  --bs-btn-active-bg: #003f78;
  --bs-btn-active-border-color: #003f78;
}

.btn-outline-light {
  --bs-btn-hover-color: #161922;
}

/* Topbar + navbar fixas ----------------------------------------------------- */
header nav {
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

header nav img {
  width: clamp(9.5rem, 13vw, 12.5rem);
  height: auto;
}

.navbar {
  --bs-navbar-color: rgba(255, 255, 255, 0.85);
  --bs-navbar-hover-color: #ffffff;
  --bs-navbar-active-color: #ffffff;
  --bs-navbar-nav-link-padding-x: 0.75rem;
}

.navbar .nav-link {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  white-space: nowrap;
}

.dropdown-menu {
  --bs-dropdown-border-radius: 0;
  --bs-dropdown-bg: #191919;
  --bs-dropdown-link-color: rgba(255, 255, 255, 0.85);
  --bs-dropdown-link-hover-color: #ffffff;
  --bs-dropdown-link-hover-bg: #0056a5;
  --bs-dropdown-border-width: 0;
  --bs-dropdown-padding-y: 0.5rem;
}

@media (min-width: 1400px) {
  .navbar .dropdown:hover > .dropdown-menu {
    display: block;
    margin-top: 0;
  }
}

@media (max-width: 1399.98px) {
  .navbar-collapse {
    background-color: #191919;
    padding: 1rem;
    margin-top: 0.5rem;
  }
}

/* Hero -------------------------------------------------------------------- */
#hero article {
  min-height: 100vh;
}

#hero .owl-dots {
  position: absolute;
  bottom: 2.6rem;
}

.owl-theme .owl-dots .owl-dot span {
  background: rgba(255, 255, 255, 0.4);
  width: 2.5rem;
  height: 3px;
  border-radius: 0;
  margin: 0 0.35rem;
}

.owl-theme .owl-dots .owl-dot.active span,
.owl-theme .owl-dots .owl-dot:hover span {
  background: #ffffff;
}

#hero h1 {
  font-size: clamp(2.1rem, 5vw, 4.1rem);
  line-height: 1.1;
  max-width: 17ch;
  text-wrap: balance;
}

/* Carrosséis claros (notícias, frota): pontos azuis */
.bg-light .owl-theme .owl-dots .owl-dot span,
.bg-white .owl-theme .owl-dots .owl-dot span {
  background: rgba(0, 86, 165, 0.3);
}

.bg-light .owl-theme .owl-dots .owl-dot.active span,
.bg-white .owl-theme .owl-dots .owl-dot.active span {
  background: #0056a5;
}

/* Números ------------------------------------------------------------------ */
[data-counter] {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1;
}

/* Cards: elevação no hover ------------------------------------------------- */
.card {
  --bs-card-border-radius: 0;
  --bs-card-border-color: #e2e2e2;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--bs-box-shadow);
}

/* Imagens com zoom suave dentro de links/figuras ---------------------------- */
figure {
  overflow: hidden;
  margin: 0;
}

figure img {
  transition: scale 0.7s ease;
}

figure:hover img {
  scale: 1.06;
}

/* Mapa --------------------------------------------------------------------- */
#mapa svg {
  width: 100%;
  height: auto;
  display: block;
}

#mapa button[data-bs-toggle="tooltip"] {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(0, 86, 165, 0.7);
  animation: pulso 2.4s infinite;
}

@keyframes pulso {
  70% { box-shadow: 0 0 0 14px rgba(0, 86, 165, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 86, 165, 0); }
}

.tooltip {
  --bs-tooltip-bg: #161922;
  --bs-tooltip-border-radius: 0;
  --bs-tooltip-max-width: 14rem;
}

/* Linha do tempo ----------------------------------------------------------- */
#linha-do-tempo article {
  border-top: 3px solid #0056a5;
}

/* Vídeo: ícone de play ------------------------------------------------------- */
a[data-fancybox="videos"] i {
  font-size: 4rem;
  text-shadow: 0 0 1.5rem rgba(0, 0, 0, 0.6);
  transition: transform 0.35s ease;
}

a[data-fancybox="videos"]:hover i {
  transform: scale(1.15);
}

/* Banner de páginas internas ----------------------------------------------- */
main > header {
  min-height: 55vh;
}

.breadcrumb {
  --bs-breadcrumb-divider-color: rgba(255, 255, 255, 0.6);
  --bs-breadcrumb-item-active-color: rgba(255, 255, 255, 0.8);
}

/* Formulário --------------------------------------------------------------- */
.form-control,
.form-select {
  border-radius: 0;
  padding: 0.85rem 1rem;
}

.form-control:focus,
.form-select:focus {
  border-color: #0056a5;
  box-shadow: 0 0 0 0.2rem rgba(0, 86, 165, 0.15);
}

/* Rodapé ------------------------------------------------------------------- */
footer a {
  text-decoration: none;
}

footer a:hover {
  color: #ffffff !important;
}

footer img {
  width: 12.5rem;
  height: auto;
}

/* ==========================================================================
   MOVIMENTO
   Parallax e barra de progresso: CSS nativo (scroll-driven animations) com
   fallback em JS (main.js) para navegadores sem suporte. Só transform/opacity.
   ========================================================================== */

/* Parallax: o wrapper cria a linha do tempo; a imagem se move dentro dele */
[data-parallax] {
  overflow: clip;
  view-timeline: --parallax block;
}

[data-depth] {
  top: -10%;
  height: 120%;
  will-change: transform;
}

figure[data-parallax] > img[data-depth] {
  top: -10%;
  height: 120%;
}

@keyframes parallax {
  from { transform: translateY(-7%); }
  to   { transform: translateY(7%); }
}

@supports ((animation-timeline: view()) and (animation-range: entry)) {
  [data-depth] {
    animation: parallax linear both;
    animation-timeline: --parallax;
  }
}

/* Barra de progresso de leitura */
#progresso {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 1100;
  pointer-events: none;
  background: color-mix(in srgb, #0056a5 65%, white);
  transform-origin: 0 50%;
  scale: 0 1;
}

@keyframes progresso {
  to { scale: 1 1; }
}

@supports ((animation-timeline: scroll()) and (animation-range: entry)) {
  #progresso {
    animation: progresso linear both;
    animation-timeline: scroll(root);
  }
}

/* Hero: zoom lento (Ken Burns), texto escalonado e saída em profundidade */
#hero article img {
  scale: 1;
  transition: scale 14s ease-out;
}

#hero .owl-item.active article img {
  scale: 1.07;
}

@keyframes subir {
  from { opacity: 0; translate: 0 2.5rem; }
  to   { opacity: 1; translate: 0 0; }
}

#hero .owl-item.active .col-lg-9 > * {
  animation: subir 1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

#hero .owl-item.active .col-lg-9 > :nth-child(1) { animation-delay: 0.1s; }
#hero .owl-item.active .col-lg-9 > :nth-child(2) { animation-delay: 0.25s; }
#hero .owl-item.active .col-lg-9 > :nth-child(3) { animation-delay: 0.45s; }
#hero .owl-item.active .col-lg-9 > :nth-child(4) { animation-delay: 0.6s; }
#hero .owl-item.active .col-lg-9 > :nth-child(5) { animation-delay: 0.7s; }

@keyframes sair {
  to { translate: 0 7rem; opacity: 0; }
}

@supports ((animation-timeline: scroll()) and (animation-range: 0 100vh)) {
  #hero .container {
    animation: sair linear both;
    animation-timeline: scroll(root);
    animation-range: 0 90vh;
  }
}

#hero .owl-dots {
  left: auto;
  right: 9rem;
  width: auto;
}

#pausar {
  --bs-btn-border-color: rgba(255, 255, 255, 0.45);
  padding: 0;
  letter-spacing: 0;
}

/* Indicador "Descubra" */
#descubra span {
  display: inline-block;
  width: 4rem;
  height: 1px;
  margin-left: 1rem;
  background: rgba(255, 255, 255, 0.35);
  position: relative;
  overflow: hidden;
}

#descubra span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #ffffff;
  translate: -100% 0;
  animation: descubra 2.2s ease-in-out infinite;
}

@keyframes descubra {
  60%, 100% { translate: 100% 0; }
}

/* Entradas ao rolar (atributos data-reveal, o JS adiciona .show) ------------- */
@media (scripting: enabled) {
  [data-reveal] {
    opacity: 0;
    translate: 0 1.5rem;
    transition: opacity 1s ease, translate 1.1s cubic-bezier(0.16, 0.8, 0.2, 1), scale 1.1s cubic-bezier(0.16, 0.8, 0.2, 1);
    transition-delay: var(--d, 0s);
  }

  [data-reveal="left"]  { translate: -2.5rem 0; }
  [data-reveal="right"] { translate: 2.5rem 0; }
  [data-reveal="zoom"]  { translate: 0 0; scale: 0.97; }

  [data-reveal].show {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }

  /* Revelação em "cortina" para imagens */
  figure[data-reveal="wipe"] {
    opacity: 1;
    translate: 0 0;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.2s cubic-bezier(0.7, 0, 0.2, 1);
    transition-delay: var(--d, 0s);
  }

  figure[data-reveal="wipe"].show {
    clip-path: inset(0 0 0 0);
  }

  /* Títulos: palavras sobem de dentro de uma máscara */
  [data-split] > span {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding-bottom: 0.14em;
    margin-bottom: -0.14em;
  }

  [data-split] > span > span {
    display: inline-block;
    translate: 0 115%;
    transition: translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(var(--i) * 0.07s);
  }

  [data-split].show > span > span {
    translate: 0 0;
  }
}

/* Mapa: linha de transmissão com fluxo contínuo e pins que "brotam" */
@keyframes fluxo {
  to { stroke-dashoffset: -28; }
}

#mapa path[stroke-dasharray] {
  animation: fluxo 1.4s linear infinite;
}

@keyframes brotar {
  from { scale: 0; }
  to   { scale: 1; }
}

#mapa [data-reveal].show button[data-bs-toggle="tooltip"] {
  animation: brotar 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both, pulso 2.4s 2s infinite;
  animation-delay: calc(0.5s + var(--i) * 0.15s), calc(2s + var(--i) * 0.3s);
}

/* Carrossel da frota: item central em destaque */
#frota .owl-item {
  opacity: 0.45;
  scale: 0.9;
  transition: opacity 0.5s ease, scale 0.5s ease;
}

#frota .owl-item.center {
  opacity: 1;
  scale: 1;
}

@media (max-width: 767.98px) {
  #frota .owl-item { opacity: 1; scale: 1; }
}

/* Botões e links: microinterações */
.btn {
  transition: translate 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.btn:hover {
  translate: 0 -3px;
}

[data-counter] {
  font-variant-numeric: tabular-nums;
}

/* Preferência por menos movimento --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  [data-depth],
  #progresso,
  #hero .owl-item.active .col-lg-9 > *,
  #hero .container,
  #descubra span::after,
  #mapa path[stroke-dasharray],
  #mapa button[data-bs-toggle="tooltip"] {
    animation: none !important;
  }

  #progresso { scale: 1 1; opacity: 0; }

  #hero article img,
  #frota .owl-item,
  .card,
  figure img,
  .btn {
    transition: none;
  }

  #hero .owl-item.active article img { scale: 1; }

  [data-reveal],
  figure[data-reveal="wipe"],
  [data-split] > span > span {
    opacity: 1 !important;
    translate: 0 0 !important;
    scale: 1 !important;
    clip-path: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   AJUSTE FINO — imersão com elegância
   ========================================================================== */

/* Véus de gradiente sobre as fotos */
[data-veil="hero"] {
  background:
    linear-gradient(90deg, rgba(8, 12, 20, 0.92) 0%, rgba(8, 12, 20, 0.74) 36%, rgba(8, 12, 20, 0.34) 62%, rgba(8, 12, 20, 0.04) 100%),
    linear-gradient(0deg, rgba(8, 12, 20, 0.7) 0%, rgba(8, 12, 20, 0) 38%),
    linear-gradient(180deg, rgba(8, 12, 20, 0.55) 0%, rgba(8, 12, 20, 0) 26%);
}

[data-veil="faixa"] {
  background:
    linear-gradient(90deg, rgba(8, 12, 20, 0.88) 0%, rgba(8, 12, 20, 0.55) 55%, rgba(8, 12, 20, 0.25) 100%),
    linear-gradient(0deg, rgba(25, 25, 25, 0.9) 0%, rgba(25, 25, 25, 0) 30%),
    linear-gradient(180deg, rgba(248, 248, 248, 0) 70%, rgba(0, 86, 165, 0) 100%);
}

[data-veil="pagina"] {
  background:
    linear-gradient(0deg, rgba(8, 12, 20, 0.85) 0%, rgba(8, 12, 20, 0.35) 55%, rgba(8, 12, 20, 0.2) 100%),
    linear-gradient(180deg, rgba(8, 12, 20, 0.6) 0%, rgba(8, 12, 20, 0) 30%);
}

[data-veil="cta"] {
  background: linear-gradient(90deg, rgba(0, 63, 120, 0.92) 0%, rgba(0, 86, 165, 0.78) 60%, rgba(0, 86, 165, 0.55) 100%);
}

/* Navbar: vidro fosco ao rolar; topbar recolhe e a navbar compacta */
header nav.navbar.bg-dark {
  --bs-bg-opacity: 0.92;
  backdrop-filter: blur(14px) saturate(1.2);
}

header[data-header] > div:first-child {
  max-height: 3rem;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

header[data-header][data-compact] > div:first-child {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

header[data-header] nav {
  transition: background-color 0.35s ease, box-shadow 0.35s ease, padding 0.4s ease;
}

header[data-header][data-compact] nav {
  padding-top: 0.6rem !important;
  padding-bottom: 0.6rem !important;
}

/* Títulos de seção: filete antes do rótulo */
section [data-reveal] > p.text-uppercase:first-child::before {
  content: "";
  display: inline-block;
  width: 2.5rem;
  height: 1px;
  background: currentColor;
  vertical-align: middle;
  margin-right: 0.9rem;
  opacity: 0.7;
}

/* Profundidade nas seções escuras e azuis */
#projeto {
  background-image:
    radial-gradient(55% 45% at 85% 0%, rgba(0, 86, 165, 0.28), rgba(0, 86, 165, 0) 70%),
    radial-gradient(40% 35% at 0% 100%, rgba(0, 86, 165, 0.16), rgba(0, 86, 165, 0) 70%);
}

#pdi {
  background-image: radial-gradient(50% 45% at 15% 0%, rgba(0, 86, 165, 0.22), rgba(0, 86, 165, 0) 70%);
}

#numeros {
  background-image: linear-gradient(135deg, #0a63b8 0%, #0056a5 45%, #003f78 100%);
}

/* Cards mais sóbrios */
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 1rem 2.25rem rgba(0, 0, 0, 0.1);
}

/* Fotos: leve contraste */
figure img {
  filter: saturate(1.04) contrast(1.02);
}

/* Carrossel da frota: legenda discreta */
#frota figcaption h3 {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1rem;
}

::selection {
  background: #0056a5;
  color: #ffffff;
}

/* Foco visível e consistente */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px #0056a5;
}

/* WhatsApp flutuante (todas as páginas) */
#whatsapp {
  right: 1.25rem;
  bottom: 1.25rem;
  width: 3.5rem;
  height: 3.5rem;
  z-index: 1040;
  --bs-btn-bg: #25d366;
  --bs-btn-border-color: #25d366;
  --bs-btn-hover-bg: #1ebe5a;
  --bs-btn-hover-border-color: #1ebe5a;
  --bs-btn-active-bg: #1ebe5a;
  --bs-btn-active-border-color: #1ebe5a;
  font-size: 1.7rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#whatsapp:hover {
  transform: scale(1.08);
}

@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  #whatsapp {
    animation: wa-entrada 0.6s 1.2s both ease-out;
  }
}

@keyframes wa-entrada {
  from { opacity: 0; translate: 0 1rem; }
}

/* Navbar fixa no mobile: menu aberto rola dentro da tela */
header[data-header] {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
}

@media (max-width: 1399.98px) {
  header[data-header] #menu {
    max-height: calc(100dvh - 5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Entradas laterais não ampliam a largura da página no celular */
main {
  overflow-x: clip;
}

@media (max-width: 991.98px) {
  [data-reveal="left"], [data-reveal="right"] { translate: 0 1.5rem; }
}

body {
  overflow-x: hidden;
}

/* Inter em todo o projeto (inclui botões, formulários, tooltips e carrosséis) */
html, body, button, input, select, textarea, optgroup,
.btn, .form-control, .form-select, .dropdown-menu, .tooltip, .popover, .owl-carousel {
  font-family: var(--bs-font-sans-serif);
}

/* Números de autoridade: 2 linhas x 3 colunas abaixo de 1400px */
@media (max-width: 1399.98px) {
  [data-counter] {
    font-size: clamp(1.7rem, 5.2vw, 3rem);
  }
}

/* Cards de projetos */
#projeto .card img {
  transition: scale 0.9s cubic-bezier(0.16, 0.8, 0.2, 1);
}

#projeto .card:hover img {
  scale: 1.06;
}

#projeto .card {
  --bs-card-bg: #0a0a0a;
  border-top: 2px solid transparent !important;
  transition: border-color 0.3s ease, translate 0.4s ease;
}

#projeto .card:hover {
  border-top-color: var(--bs-primary) !important;
}

.modal {
  --bs-modal-border-radius: 0;
  --bs-modal-border-width: 0;
}

.modal-backdrop {
  --bs-backdrop-opacity: 0.7;
}
