/* =========================================================================
   Site institucional — Controle Interno na Prática
   Complementa o Tailwind (CDN) com o que ele não cobre: keyframes próprios,
   entrada por scroll e os fundos compostos do hero.
   Paleta herdada do app: #111111 (tinta), #f7f6f3 (papel), #ea580c (laranja),
   #fdf1ec (laranja lavado).
   ========================================================================= */

:root {
  --cip-tinta: #111111;
  --cip-papel: #f7f6f3;
  --cip-laranja: #ea580c;
  --cip-laranja-claro: #f97316;
  --cip-laranja-lavado: #fdf1ec;
  --cip-header-altura: 88px;
}

html {
  scroll-behavior: smooth;
  /* Âncoras não podem parar embaixo do header fixo. */
  scroll-padding-top: var(--cip-header-altura);
}

body {
  overflow-x: hidden;
}

/* --------------------------------------------------------------------- */
/* Entrada por scroll                                                     */
/* --------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Variações de direção, para as seções não entrarem todas do mesmo jeito. */
.reveal-left  { transform: translate3d(-32px, 0, 0); }
.reveal-right { transform: translate3d(32px, 0, 0); }
.reveal-zoom  { transform: scale(0.94); }
.reveal-left.is-visible,
.reveal-right.is-visible { transform: translate3d(0, 0, 0); }
.reveal-zoom.is-visible  { transform: scale(1); }

/* --------------------------------------------------------------------- */
/* Keyframes                                                              */
/* --------------------------------------------------------------------- */

@keyframes cip-flutuar {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

/* Deriva lenta dos brilhos do hero — o fundo nunca fica parado. */
@keyframes cip-deriva {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  33%  { transform: translate3d(4%, -3%, 0) scale(1.08); }
  66%  { transform: translate3d(-3%, 3%, 0) scale(1.04); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

/* Zoom quase imperceptível na foto do topo. */
@keyframes cip-ken-burns {
  from { transform: scale(1); }
  to   { transform: scale(1.12); }
}

@keyframes cip-brilho {
  from { background-position: -180% 0; }
  to   { background-position: 180% 0; }
}

@keyframes cip-pulsar {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(1.35); }
}

@keyframes cip-descer {
  0%   { transform: translateY(0);   opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

@keyframes cip-traco {
  to { stroke-dashoffset: 0; }
}

@keyframes cip-surgir {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------- */
/* Hero                                                                   */
/* --------------------------------------------------------------------- */

.cip-hero {
  position: relative;
  isolation: isolate;
  background-color: var(--cip-tinta);
  overflow: hidden;
}

/* Camada da foto (quando houver). A imagem entra por style inline na view. */
.cip-hero__foto {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  animation: cip-ken-burns 26s ease-out infinite alternate;
  z-index: -3;
}

/* Fallback sem foto: dois brilhos laranja à deriva sobre o preto.
   Garante que o topo já nasça apresentável antes de o cliente subir a imagem. */
.cip-hero__brilho {
  position: absolute;
  inset: -25%;
  z-index: -3;
  background:
    radial-gradient(42% 46% at 22% 28%, rgba(234, 88, 12, 0.42) 0%, transparent 62%),
    radial-gradient(38% 42% at 78% 68%, rgba(249, 115, 22, 0.24) 0%, transparent 60%);
  animation: cip-deriva 22s ease-in-out infinite;
}

/* Escurecimento para o texto ter contraste sobre qualquer imagem. */
.cip-hero__veu {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, rgba(17, 17, 17, 0.86) 0%, rgba(17, 17, 17, 0.68) 45%, rgba(17, 17, 17, 0.94) 100%);
}

/* Grade técnica sutil — remete a papel de trabalho / planilha. */
.cip-hero__grade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 30%, transparent 78%);
}

.cip-hero__scroll {
  animation: cip-descer 1.9s ease-in-out infinite;
}

/* --------------------------------------------------------------------- */
/* Componentes                                                            */
/* --------------------------------------------------------------------- */

/* Card de fase/recurso: sobe e ganha borda laranja no hover. */
.cip-card {
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    border-color 0.4s ease;
}

.cip-card:hover {
  transform: translateY(-6px);
  border-color: rgba(234, 88, 12, 0.4);
  box-shadow: 0 22px 45px -22px rgba(17, 17, 17, 0.35);
}

/* Barra que cresce da esquerda no hover do card. */
.cip-card__barra {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.cip-card:hover .cip-card__barra {
  transform: scaleX(1);
}

/* Sublinhado animado dos links do menu. */
.cip-link {
  position: relative;
}

.cip-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  height: 2px;
  width: 100%;
  background: var(--cip-laranja);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.cip-link:hover::after,
.cip-link[data-ativo="true"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Botão com brilho passando por cima. */
.cip-botao-brilho {
  position: relative;
  overflow: hidden;
}

.cip-botao-brilho::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  background-size: 220% 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cip-botao-brilho:hover::before {
  opacity: 1;
  animation: cip-brilho 1.1s ease-out;
}

.cip-flutuar { animation: cip-flutuar 6s ease-in-out infinite; }
.cip-pulsar  { animation: cip-pulsar 2.4s ease-in-out infinite; }

/* Check da tela de confirmação: o traço se desenha. */
.cip-traco {
  stroke-dasharray: 130;
  stroke-dashoffset: 130;
  animation: cip-traco 0.9s cubic-bezier(0.65, 0, 0.45, 1) 0.25s forwards;
}

.cip-surgir {
  opacity: 0;
  animation: cip-surgir 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

/* Índice lateral das páginas legais. */
.cip-indice a[data-ativo="true"] {
  color: var(--cip-laranja);
  border-left-color: var(--cip-laranja);
  font-weight: 600;
}

/* Barra de progresso de leitura no rodapé do header. */
.cip-progresso {
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.1s linear;
}

/* Faixa de logos/termos em movimento contínuo. */
.cip-esteira {
  display: flex;
  width: max-content;
  animation: cip-esteira 38s linear infinite;
}

@keyframes cip-esteira {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.cip-esteira:hover { animation-play-state: paused; }

/* Tabela GUT: destaque da célula sob o cursor. */
.cip-gut td { transition: background-color 0.25s ease, color 0.25s ease; }
.cip-gut tbody tr:hover td { background-color: var(--cip-laranja-lavado); }

/* --------------------------------------------------------------------- */
/* Acessibilidade                                                         */
/* --------------------------------------------------------------------- */

/* Quem pediu menos movimento no sistema recebe a página inteira sem animação —
   nada some, tudo apenas aparece parado. */
@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;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-zoom,
  .cip-surgir {
    opacity: 1 !important;
    transform: none !important;
  }

  .cip-traco { stroke-dashoffset: 0; }
}

/* Foco visível — o Tailwind via CDN não garante isso nos elementos customizados. */
.cip-foco:focus-visible {
  outline: 2px solid var(--cip-laranja);
  outline-offset: 3px;
  border-radius: 4px;
}
