/* ============================================================
   TAGUS — Animações e interações modernas
   Estilos dependentes de JS ficam atrás de `html.js`:
   sem JavaScript, todo o conteúdo permanece visível.
   ============================================================ */

/* ===== Reveal on scroll ===== */
html.js [data-reveal],
html.js .reveal-item {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
html.js [data-reveal].in-view,
html.js [data-reveal-stagger].in-view .reveal-item {
  opacity: 1;
  transform: none;
}

/* Linha decorativa dos títulos cresce ao entrar na tela */
html.js .section-rule {
  width: 0;
  transition: width 0.8s ease 0.15s;
}
html.js .section-rule.in-view { width: 60px; }

/* ===== Hero — Ken Burns + entrada do título ===== */
.slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.slide.active .slide-bg {
  animation: kenburns 16s ease-out forwards;
}
@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}
html.js .slide .slide-content h2 {
  opacity: 0;
  transform: translateY(18px);
}
html.js .slide.active .slide-content h2 {
  animation: slide-title 0.9s ease 0.25s forwards;
}
@keyframes slide-title {
  to { opacity: 1; transform: none; }
}

/* ===== Header ao rolar ===== */
.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 32, 56, 0.08);
}

/* ===== Tilt 3D + glow nos cards (aplicado via JS só em desktop) ===== */
html.js .tilt {
  position: relative;
  will-change: transform;
}
html.js .tilt:hover {
  transform: perspective(700px)
             rotateX(var(--rx, 0deg))
             rotateY(var(--ry, 0deg))
             translateY(-4px);
}
html.js .tilt::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 50%),
    rgba(110, 130, 181, 0.16),
    transparent 70%
  );
}
html.js .tilt:hover::after { opacity: 1; }

/* ===== Equipe — zoom suave + borda azul ===== */
.member-photo {
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}
.member-photo img {
  transition: transform 0.6s ease;
}
.member:hover .member-photo,
.member:focus-visible .member-photo {
  border-color: var(--azul);
  box-shadow: 0 12px 32px rgba(23, 55, 130, 0.25);
}
.member:hover .member-photo img,
.member:focus-visible .member-photo img {
  transform: scale(1.06);
}

/* ===== Botões — shine sweep ===== */
.btn,
.nav-cta,
.lamina-btn {
  position: relative;
  overflow: hidden;
}
.btn::after,
.nav-cta::after,
.lamina-btn::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 55%;
  background: linear-gradient(
    105deg,
    transparent,
    rgba(255, 255, 255, 0.28),
    transparent
  );
  transform: translateX(-180%) skewX(-15deg);
  pointer-events: none;
}
.btn:hover::after,
.nav-cta:hover::after,
.lamina-btn:hover::after {
  transform: translateX(320%) skewX(-15deg);
  transition: transform 0.7s ease;
}

/* ===== Stats — contadores institucionais ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 70px;
  border: 1px solid var(--cinza-100);
  background: var(--branco);
}
.stat {
  text-align: center;
  padding: 38px 20px;
  border-left: 1px solid var(--cinza-100);
}
.stat:first-child { border-left: 0; }
.stat strong {
  display: block;
  font-weight: 300;
  font-size: 2.6rem;
  color: var(--azul);
  line-height: 1.1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--cinza-600);
}

/* ===== Vídeo do rio Tejo no hover ===== */
.origem-imagem {
  position: relative;
  overflow: hidden;
}
.origem-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.origem-imagem.is-playing .origem-video { opacity: 1; }

/* ===== Tabelas — painel moderno ===== */
.fundos-tabela {
  border: 1px solid var(--cinza-100);
  background: var(--branco);
  box-shadow: 0 14px 40px rgba(0, 32, 56, 0.06);
  padding: 8px 18px 14px;
}

/* Cabeçalho gruda no topo ao rolar a tabela */
.fundos-tabela thead th {
  position: sticky;
  top: 76px;
  background: var(--branco);
  z-index: 5;
}

.fundos-tabela tbody tr,
.hist-perf tbody tr {
  transition: background-color 0.25s ease;
}
.fundos-tabela tbody tr:not(.grupo):hover,
.hist-perf tbody tr:hover {
  background-color: rgba(23, 55, 130, 0.05);
}
.fundos-tabela tbody tr:not(.grupo):not(.comparativo):hover td.col-nome {
  color: var(--azul);
}
.fundos-tabela tbody tr:not(.grupo):hover td:first-child {
  box-shadow: inset 3px 0 0 var(--azul);
}
.fundos-tabela tbody td {
  font-variant-numeric: tabular-nums;
}

/* Linhas entram em cascata (classes aplicadas via JS) */
html.js .row-reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
html.js .row-reveal.row-in {
  opacity: 1;
  transform: none;
}

/* Cards de dados dos fundos */
.fundo-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.fundo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(23, 55, 130, 0.1);
}
.fundo-card strong {
  font-variant-numeric: tabular-nums;
}

/* ===== Gráficos interativos dos fundos ===== */
.fundo-chart-canvas {
  position: relative;
  height: 360px;
  padding: 18px 16px 10px;
}

/* ===== Responsivo ===== */
@media (max-width: 1000px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--cinza-100); }
}
@media (max-width: 760px) {
  .fundo-chart-canvas { height: 260px; padding: 12px 8px 6px; }
  .stat strong { font-size: 2.1rem; }
  .fundos-tabela { padding: 4px 10px 10px; }
  .fundos-tabela thead th { position: static; }
}

/* ===== Acessibilidade — usuário prefere menos movimento ===== */
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal],
  html.js .reveal-item,
  html.js .slide .slide-content h2 {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  html.js .section-rule {
    width: 60px !important;
    transition: none !important;
  }
  html.js .row-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .slide.active .slide-bg { animation: none !important; }
  html.js .tilt:hover { transform: none; }
  html.js .tilt::after { display: none; }
  .member-photo img,
  .member-photo,
  .origem-video { transition: none !important; }
  .member:hover .member-photo img { transform: none; }
  .btn::after,
  .nav-cta::after,
  .lamina-btn::after { display: none; }
}
