/* Refinos leves além do Tailwind CDN */
html {
  scroll-padding-top: 8.5rem;
  overflow-x: clip;
}

@media (max-width: 767px) {
  html {
    scroll-padding-top: 7rem;
  }
}

.touch-manipulation {
  touch-action: manipulation;
}

@media (max-width: 639px) {
  main h2.font-display.text-3xl {
    font-size: 1.625rem;
    line-height: 1.2;
  }
}

/* h2 (Playfair + marca): sombra suave para leitura em fundo claro ou escuro */
main h2.font-display.text-brand {
  text-shadow:
    0 0 1px rgba(6, 18, 24, 0.22),
    0 1px 2px rgba(6, 18, 24, 0.16),
    0 2px 16px rgba(6, 18, 24, 0.1);
}

main h2.font-display.text-white {
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(0, 0, 0, 0.28);
}

/* Painel admin: h2 brancos (cards, formulários) */
body.min-h-screen.bg-void main h2.font-semibold.text-white {
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 0 18px rgba(0, 0, 0, 0.22);
}

/* Header: logo grande no topo; encolhe ao rolar a página */
.site-header {
  transition:
    box-shadow 0.35s ease,
    background-color 0.35s ease,
    border-color 0.35s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  background-color: rgba(6, 10, 13, 0.94);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.site-header-inner {
  transition:
    padding-top 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    padding-bottom 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

@media (min-width: 768px) {
  .site-header-inner {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

.site-header.is-scrolled .site-header-inner {
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
}

.header-logo-img {
  display: block;
  width: auto;
  height: 5.25rem;
  max-width: calc(100vw - 4.75rem);
  object-fit: contain;
  object-position: left center;
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 640px) {
  .header-logo-img {
    height: 7rem;
  }
}

@media (min-width: 768px) {
  .header-logo-img {
    height: 8rem;
    max-width: none;
  }
}

@media (min-width: 1024px) {
  .header-logo-img {
    height: 9rem;
  }
}

.site-header.is-scrolled .header-logo-img {
  height: 3rem;
}

@media (min-width: 640px) {
  .site-header.is-scrolled .header-logo-img {
    height: 3.25rem;
  }
}

@media (min-width: 768px) {
  .site-header.is-scrolled .header-logo-img {
    height: 3.5rem;
  }
}

@media (min-width: 1024px) {
  .site-header.is-scrolled .header-logo-img {
    height: 3.75rem;
  }
}

.header-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 7rem;
  height: 7rem;
  transition:
    width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.header-logo-fallback svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

@media (min-width: 768px) {
  .header-logo-fallback {
    width: 8rem;
    height: 8rem;
  }
}

@media (min-width: 1024px) {
  .header-logo-fallback {
    width: 9rem;
    height: 9rem;
  }
}

.site-header.is-scrolled .header-logo-fallback {
  width: 3.5rem;
  height: 3.5rem;
}

@media (min-width: 768px) {
  .site-header.is-scrolled .header-logo-fallback {
    width: 3.75rem;
    height: 3.75rem;
  }
}

@media (min-width: 1024px) {
  .site-header.is-scrolled .header-logo-fallback {
    width: 4rem;
    height: 4rem;
  }
}

/**
 * Degradê na foto: base 100% opaca com a cor do card para não “vazar”
 * fundo claro da imagem nem o fundo da página atrás do card.
 */
.pillar-image-fade {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Base opaca = #121c28 (18,28,40) — mesma cor do corpo do card */
  background: linear-gradient(
    to top,
    rgb(18, 28, 40) 0%,
    rgb(18, 28, 40) 24%,
    rgba(18, 28, 40, 0.94) 42%,
    rgba(18, 28, 40, 0.58) 64%,
    rgba(18, 28, 40, 0.14) 86%,
    transparent 100%
  );
}

/* Fotos claras (monitoramento / app): degradê mais baixo para não “apagar” a imagem */
.pillar-image-fade--bright {
  background: linear-gradient(
    to top,
    rgb(18, 28, 40) 0%,
    rgb(18, 28, 40) 14%,
    rgba(18, 28, 40, 0.82) 32%,
    rgba(18, 28, 40, 0.35) 58%,
    rgba(18, 28, 40, 0.08) 82%,
    transparent 100%
  );
}

/* Entrada ao rolar a página */
.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(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.reveal-group > .reveal:nth-child(1) {
  --reveal-delay: 0ms;
}
.reveal-group > .reveal:nth-child(2) {
  --reveal-delay: 85ms;
}
.reveal-group > .reveal:nth-child(3) {
  --reveal-delay: 170ms;
}
.reveal-group > .reveal:nth-child(4) {
  --reveal-delay: 255ms;
}
.reveal-group > .reveal:nth-child(5) {
  --reveal-delay: 340ms;
}
.reveal-group > .reveal:nth-child(6) {
  --reveal-delay: 425ms;
}
.reveal-group > .reveal:nth-child(7) {
  --reveal-delay: 510ms;
}
.reveal-group > .reveal:nth-child(8) {
  --reveal-delay: 595ms;
}
.reveal-group > .reveal:nth-child(9) {
  --reveal-delay: 680ms;
}

/* Cards claros (faixa, figuras CFTV/alarme/acesso, formulário) */
.card-lift {
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
  .card-lift:hover {
    transform: translateY(-8px);
    box-shadow:
      0 22px 44px -16px rgba(15, 23, 42, 0.18),
      0 0 0 1px rgba(0, 242, 195, 0.22);
  }

  .card-lift:hover .card-lift-img {
    transform: scale(1.06);
  }
}

.card-lift .card-lift-img {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Pilares escuros */
.card-lift-dark {
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
  .card-lift-dark:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow:
      0 28px 56px -12px rgba(0, 0, 0, 0.55),
      0 0 0 1px rgba(0, 242, 195, 0.35),
      0 0 28px rgba(0, 242, 195, 0.12);
  }

  .card-lift-dark:hover .pillar-card-img {
    transform: scale(1.05);
  }
}

.card-lift-dark .pillar-card-img {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide {
    transition: none !important;
  }

  .site-header,
  .site-header-inner,
  .header-logo-img,
  .header-logo-fallback {
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .card-lift,
  .card-lift-dark,
  .card-lift .card-lift-img {
    transition: none;
  }

  @media (hover: hover) and (pointer: fine) {
    .card-lift:hover,
    .card-lift-dark:hover {
      transform: none;
    }

    .card-lift:hover .card-lift-img {
      transform: none;
    }

    .card-lift-dark:hover .pillar-card-img {
      transform: none;
    }
  }
}
