:root {
  --bg: #0b0d13;
  --glass: rgba(255, 255, 255, 0.08);
  --stroke: rgba(255, 255, 255, 0.15);
  --blur: 14px;
  --txt: #e6e9ef;
  --accent-primary: #8238B3; /* Grape */
  --accent-secondary: #D7AC28; /* Gold (metallic) */
  --accent-hover: rgba(130, 56, 179, 0.2);
  --accent-gold-dark: #C78D17; /* Dark goldenrod */
  --accent-purple-light: #EFD9F7; /* Pale purple */
  --accent-indigo: #D00666; /* Indigo */
  --font-primary: 'Lato', system-ui, -apple-system, sans-serif;
  --font-secondary: 'Roboto', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-user-select: none; /* Chrome, Safari, Opera */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE/Edge */
  user-select: none;         /* Padrão */
  -webkit-touch-callout: none; /* iOS Safari */
}

/* Permite seleção apenas em campos de input e textarea */
input,
textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Desabilita arrastar imagens */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* Permite interação apenas em imagens dentro de links */
a img,
.latest-card-image {
  pointer-events: auto;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  color: var(--txt);
  background: var(--bg) url('assets/img/final-bg.jpg') center/cover no-repeat;
  background-attachment: fixed;
  overflow: hidden; /* libera no final */
  line-height: 1.6;
  min-height: 100vh;
  /* Compensa a largura da barra de rolagem */
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Melhora responsividade do background em mobile */
@media (max-width: 768px) {
  body {
    background-attachment: scroll; /* Melhor performance em mobile */
  }
}

/* Garante que o background cubra toda a área mesmo com scrollbar */
html {
  overflow-y: auto;
  scrollbar-gutter: stable; /* Reserva espaço para scrollbar */
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0; /* Usa right ao invés de width para compensar scrollbar */
  bottom: 0;
  background-image: url('assets/img/final-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  z-index: -1;
  pointer-events: none;
}

/* Overlay do vídeo */
.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 1000;
}

.overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.overlay video {
  width: min(900px, 100vw);
  height: auto;
  max-height: 100dvh;
  display: block;
}

.skip {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.skip:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: var(--accent-primary);
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #0b0d13;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-primary);
  transition: all 0.3s ease;
  box-shadow: 0 8px 30px rgba(130, 56, 179, 0.4);
  z-index: 10;
}

.play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 12px 40px rgba(130, 56, 179, 0.6);
}

.play-btn:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.play-btn svg {
  width: 32px;
  height: 32px;
  margin-left: 4px; /* Ajuste visual para centralizar o ícone */
}

/* Flash */
.flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
}

.flash.active {
  animation: flash 1.2s ease;
}

@keyframes flash {
  0% { opacity: 0; }
  15% { opacity: 1; }
  50% { opacity: 0.8; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* Sequência de imagens (rapidinho) */
.seq {
  position: fixed;
  inset: 0;
  margin: auto;
  width: 100vw;
  height: 100dvh;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  z-index: 998;
  display: none;
  transition: opacity 1.5s ease-in-out;
}

/* Conteúdo principal */
.content {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 40px);
  gap: 2rem;
}

.brand {
  text-align: center;
  margin-bottom: 0.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.content.ready .brand {
  opacity: 1;
  transform: translateY(0);
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 8px 30px rgba(130, 56, 179, 0.3), 0 0 0 4px rgba(130, 56, 179, 0.1);
  transition: transform 0.3s ease;
}

.avatar:hover {
  transform: scale(1.05);
}

.brand h1 {
  margin: 1rem 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 900;
  color: var(--txt);
  font-family: var(--font-primary);
}

.brand p {
  margin: 0;
  font-size: 1rem;
  color: var(--accent-secondary);
  font-family: var(--font-secondary);
  font-weight: 300;
}

/* Links principais */
.links {
  display: grid;
  gap: 12px;
  width: min(520px, 92vw);
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  backdrop-filter: blur(var(--blur)) saturate(120%);
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), 
              inset 0 1px 0 rgba(255, 255, 255, 0.08),
              0 0 0 1px rgba(130, 56, 179, 0.1);
  transform: translateY(12px);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.content.ready .links {
  opacity: 1;
  transform: translateY(0);
}

.link-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-decoration: none;
  color: var(--txt);
  padding: 16px 20px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  text-align: center;
  font-weight: 700;
  font-family: var(--font-primary);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.link-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.link-item:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(130, 56, 179, 0.3);
}

.link-item:hover::before {
  opacity: 0.1;
}

.link-item:active {
  transform: translateY(0) scale(0.98);
}

.link-item .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
  flex-shrink: 0;
}

.contact-btn {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: #0b0d13;
  font-weight: 900;
  display: none; /* Oculto temporariamente */
}

.contact-btn:hover {
  box-shadow: 0 4px 25px rgba(130, 56, 179, 0.5);
}

.contact-btn::before {
  display: none;
}

/* Seção de Últimos Conteúdos */
.latest-section {
  width: min(520px, 92vw);
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
}

.content.ready .latest-section {
  opacity: 1;
  transform: translateY(0);
}

.latest-title {
  font-family: var(--font-primary);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--txt);
  margin: 0 0 1rem;
  text-align: center;
  background: rgba(130, 56, 179, 0.3); /* Lilás baseado na cor Grape com transparência */
  padding: 12px 20px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.latest-grid {
  display: grid;
  gap: 12px;
}

.latest-card {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  backdrop-filter: blur(var(--blur)) saturate(120%);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.latest-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 30px rgba(130, 56, 179, 0.2);
}

.latest-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.latest-card-content {
  padding: 16px;
}

.latest-card-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-primary);
  color: #ffffff;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-secondary);
  margin-bottom: 8px;
}

.latest-card-title {
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--txt);
}

.latest-card-meta {
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  color: var(--accent-secondary);
  font-weight: 300;
}

/* Modal de Contato */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  backdrop-filter: blur(var(--blur)) saturate(120%);
  padding: 2rem;
  width: min(500px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal[aria-hidden="false"] .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.3);
  color: var(--txt);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.2s ease;
  font-family: var(--font-secondary);
}

.modal-close:hover {
  background: rgba(255, 0, 0, 0.2);
  border-color: #ff4444;
  transform: rotate(90deg);
}

.modal-title {
  font-family: var(--font-primary);
  font-size: 1.75rem;
  font-weight: 900;
  margin: 0 0 1.5rem;
  color: var(--txt);
  text-align: center;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-secondary);
}

.form-group input,
.form-group textarea {
  padding: 12px 16px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--txt);
  font-family: var(--font-secondary);
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(130, 56, 179, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.submit-btn {
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #0b0d13;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(130, 56, 179, 0.4);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

.form-status.success {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.5);
  color: #4caf50;
}

.form-status.error {
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid rgba(244, 67, 54, 0.5);
  color: #f44336;
}

/* Acessibilidade: reduzir movimento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .flash {
    display: none;
  }
}

/* Responsividade */
@media (max-width: 480px) {
  .avatar {
    width: 100px;
    height: 100px;
  }
  
  .links {
    padding: 16px;
  }
  
  .link-item {
    padding: 14px 16px;
    font-size: 0.9375rem;
  }
  
  .modal-content {
    padding: 1.5rem;
    border-radius: 20px;
  }
  
  .latest-card-image {
    height: 150px;
  }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* Footer */
.footer {
  position: relative;
  width: 100%;
  padding: 2rem clamp(16px, 3vw, 40px);
  text-align: center;
  z-index: 1;
  margin-top: 2rem;
}

.footer-text {
  font-family: var(--font-primary);
  font-size: clamp(0.875rem, 2vw, 1rem);
  font-weight: 700;
  color: var(--accent-purple-light);
  text-shadow: 
    0 0 5px rgba(130, 56, 179, 1),
    0 0 10px rgba(130, 56, 179, 0.9),
    0 0 15px rgba(130, 56, 179, 0.8),
    0 0 20px rgba(130, 56, 179, 0.7),
    0 0 25px rgba(130, 56, 179, 0.6),
    0 0 30px rgba(130, 56, 179, 0.5);
  letter-spacing: 2px;
  margin: 0;
  animation: neon-glow 2s ease-in-out infinite alternate;
}

@keyframes neon-glow {
  from {
    text-shadow: 
      0 0 5px rgba(130, 56, 179, 1),
      0 0 10px rgba(130, 56, 179, 0.9),
      0 0 15px rgba(130, 56, 179, 0.8),
      0 0 20px rgba(130, 56, 179, 0.7),
      0 0 25px rgba(130, 56, 179, 0.6),
      0 0 30px rgba(130, 56, 179, 0.5);
  }
  to {
    text-shadow: 
      0 0 8px rgba(130, 56, 179, 1),
      0 0 15px rgba(130, 56, 179, 1),
      0 0 20px rgba(130, 56, 179, 0.9),
      0 0 25px rgba(130, 56, 179, 0.8),
      0 0 30px rgba(130, 56, 179, 0.7),
      0 0 35px rgba(130, 56, 179, 0.6);
  }
}

/* Ajuste para reduzir movimento */
@media (prefers-reduced-motion: reduce) {
  .footer-text {
    animation: none;
    text-shadow: 
      0 0 5px rgba(130, 56, 179, 1),
      0 0 10px rgba(130, 56, 179, 0.9),
      0 0 15px rgba(130, 56, 179, 0.8);
  }
}
