/* --------------------------------------------------
   HERO — Cabeçalho com Imagem e Névoa
-------------------------------------------------- */
.hero {
  height: 100vh;
  background: url('../img/casa.webp')
  no-repeat center center / cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;

  position: relative;
  overflow: hidden;
  color: #fff;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

/* --------------------------------------------------
   Névoa Animada
-------------------------------------------------- */
#fogCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1.0;
  pointer-events: none;
  z-index: 2;
}

/* --------------------------------------------------
   Títulos e Textos do Hero
-------------------------------------------------- */
.hero h2 {
  position: relative;
  z-index: 5;

  font-family: 'Cinzel', serif;
  font-size: 3rem;
  letter-spacing: 2px;

  margin-bottom: 15px;
  text-shadow: 0 0 20px #00ff99;
}

.hero p {
  position: relative;
  z-index: 5;

  max-width: 600px;
  font-size: 1.2rem;
  line-height: 1.6;

  text-shadow: 0 0 10px #009966;
}

/* --------------------------------------------------
   Botão Enigmático
-------------------------------------------------- */
.botao-enigmatico {
  position: relative;
  z-index: 5;

  padding: 12px 28px;
  font-size: 1.1rem;

  background: transparent;
  color: #e9fdf5;
  border: 1px solid rgba(150, 255, 200, 0.4);
  border-radius: 6px;

  cursor: pointer;
  backdrop-filter: blur(3px);
  transition: 0.4s ease;
}

.botao-enigmatico:hover {
  color: #fff;
  border-color: #b0ffe2;
  box-shadow: 0 0 12px rgba(160, 255, 220, 0.4);
  text-shadow: 0 0 8px rgba(180, 255, 230, 0.3);
}

/* --------------------------------------------------
   Caixa Enigmática (Modal)
-------------------------------------------------- */
.caixa-enigmatica {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);

  width: 70%;
  max-width: 600px;
  max-height: 80vh;
  padding: 40px 50px;
  overflow-y: auto;

  background: rgba(5, 8, 6, 0.93);
  color: #f5fff9;

  border: 1px solid rgba(180, 255, 220, 0.25);
  border-radius: 8px;
  box-shadow: 0 0 25px rgba(160, 255, 220, 0.25);

  opacity: 0;
  text-align: left;
  line-height: 1.6;

  font-family: 'Cinzel', serif;
  letter-spacing: 0.5px;

  transition: opacity 0.6s ease, transform 0.6s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 150, 0.3) rgba(0, 0, 0, 0.3);

  z-index: 1000;
}

.caixa-enigmatica.mostrar {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Scrollbar personalizada */
.caixa-enigmatica::-webkit-scrollbar {
  width: 6px;
}
.caixa-enigmatica::-webkit-scrollbar-thumb {
  background-color: rgba(0, 255, 150, 0.2);
  border-radius: 4px;
}
.caixa-enigmatica::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 255, 150, 0.4);
}

/* --------------------------------------------------
   Animação dos Parágrafos Internos
-------------------------------------------------- */
@keyframes surgimento-enigmatico {
  0% {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.caixa-enigmatica.mostrar #texto-conteudo p {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(3px);
  animation: surgimento-enigmatico 1.6s ease-out forwards;
}

.caixa-enigmatica.mostrar #texto-conteudo p:nth-child(1) { animation-delay: 0.3s; }
.caixa-enigmatica.mostrar #texto-conteudo p:nth-child(2) { animation-delay: 0.8s; }
.caixa-enigmatica.mostrar #texto-conteudo p:nth-child(3) { animation-delay: 1.3s; }
.caixa-enigmatica.mostrar #texto-conteudo p:nth-child(4) { animation-delay: 1.8s; }
.caixa-enigmatica.mostrar #texto-conteudo p:nth-child(5) { animation-delay: 2.3s; }

/* Responsividade da caixa */
@media (max-width: 768px) {
  .caixa-enigmatica {
    width: 85%;
    padding: 25px 30px;
    font-size: 0.9rem;
  }
}

/* --------------------------------------------------
   Contador de Visitantes
-------------------------------------------------- */
.visitante-container {
  text-align: center;
  margin: 100px 0 40px;

  color: #ccc;
  opacity: 0.8;

  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}

.visitante-texto {
  font-size: 1rem;
  margin-bottom: 10px;
  text-transform: lowercase;
}

.visitante-contador {
  display: inline-block;
  min-width: 150px;

  padding: 10px 20px;

  background: rgba(20, 20, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);

  color: #0ff;
  font-size: 1.5rem;
  font-family: 'Courier New', monospace;
  border-radius: 4px;

  text-shadow: 0 0 6px #0ff, 0 0 12px #0ff;

  animation: flicker 3s infinite alternate;
}

@keyframes flicker {
  0% {
    opacity: 1;
    text-shadow: 0 0 6px #0ff, 0 0 12px #0ff;
  }
  50% {
    opacity: 0.85;
    text-shadow: 0 0 2px #0ff;
  }
  100% {
    opacity: 1;
    text-shadow: 0 0 6px #0ff, 0 0 12px #0ff;
  }
}

/* --------------------------------------------------
   Cards dos Contos
-------------------------------------------------- */
.section-contos {
  padding: 80px 5vw;
  text-align: center;

  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(5, 10, 8, 0.98) 100%
  );
}

.section-contos h2 {
  font-family: 'Cinzel', serif;
  font-size: 2.4rem;
  color: #e0ffe7;
  letter-spacing: 1px;

  margin-bottom: 50px;
  text-shadow: 0 0 18px rgba(0, 255, 150, 0.35);
}

.cards-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
}

.card {
  width: 320px;
  position: relative;

  background: rgba(15, 25, 20, 0.75);
  color: #fff;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;

  box-shadow: 0 0 25px rgba(0, 255, 150, 0.05);
  transition: 0.4s ease;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;

  transition: transform 0.6s ease;
}

.card:hover img {
  transform: scale(1.08);
}

.card h3 {
  margin-top: 15px;
  font-size: 1.2rem;

  font-family: 'Cinzel', serif;
  color: #00ff9d;

  text-transform: uppercase;
  letter-spacing: 1px;
}

.card p {
  padding: 0 20px 25px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #ccc;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 30px rgba(0, 255, 150, 0.25);
}

/* Responsividade */
@media (max-width: 768px) {
  .cards-container {
    flex-direction: column;
    align-items: center;
  }

  .card {
    width: 90%;
  }
}

.grid {
  justify-content: center;
  justify-items: center; /* opcional */
}
