/* =========================================================
   HERO / DESKTOP (inalterado)
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  padding-top: 76px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

#brain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.logo-fallback-stage {
  position: absolute;
  right: 12%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 280px;
  max-width: 40vw;
  padding: 24px;
  border-radius: 14px;
  background: rgba(7, 12, 20, 0.72);
  border: 1px solid rgba(0, 240, 255, 0.28);
  box-shadow: 0 0 36px rgba(0, 240, 255, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.logo-fallback-stage img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.35));
}

.logo-fallback-label {
  font-family: monospace;
  font-size: 11px;
  color: rgba(0, 240, 255, 0.8);
  letter-spacing: 1px;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg-void) 0%, rgba(3, 5, 8, 0.82) 52%, rgba(3, 5, 8, 0.18) 100%),
    linear-gradient(180deg, rgba(3, 5, 8, 0.35) 0%, transparent 30%, var(--bg-void) 100%);
}

.hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 48px 0;
}

.hero-box {
  max-width: 640px;
}

.tag-hud {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-hud);
  background: rgba(0, 240, 255, 0.06);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.12;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 18px;
}

.hero h1 span {
  color: var(--cyan);
  text-shadow: 0 0 22px rgba(0, 240, 255, 0.45);
}

.hero-desc {
  font-size: 17px;
  color: #cbd5e1;
  margin-bottom: 24px;
  max-width: 560px;
}

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  max-width: 560px;
}

.search-bar input {
  flex: 1;
  padding: 13px 16px;
  border-radius: 6px;
  border: 1px solid var(--border-hud);
  background: var(--bg-card);
  color: #ffffff;
  font-size: 14px;
  outline: none;
}

.search-bar input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 32px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-top: 22px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  max-width: 560px;
}

.metric-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--cyan);
}

.metric-lbl {
  font-size: 12px;
  color: var(--text-muted);
}

.hud-telemetry {
  display: none;
  position: fixed;
  bottom: 18px;
  right: 24px;
  z-index: 20;
  font-family: monospace;
  font-size: 12px;
  color: rgba(0, 240, 255, 0.75);
  text-align: right;
  pointer-events: none;
  background: rgba(3, 5, 8, 0.72);
  padding: 8px 12px;
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 6px;
}

/* Toggle & Gaveta Mobile (ocultos no desktop) */
.mobile-header-actions,
.mobile-drawer,
.mobile-drawer-backdrop {
  display: none !important;
}

/* =========================================================
   SEÇÕES / CARDS (inalterado)
   ========================================================= */
section.block-sec {
  padding: 84px 0;
  border-top: 1px solid rgba(0, 240, 255, 0.12);
}

.sec-head {
  max-width: 680px;
  margin-bottom: 44px;
}

.sec-kicker {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 700;
  margin-bottom: 8px;
}

section.block-sec h2 {
  font-size: clamp(26px, 3.5vw, 38px);
  color: #ffffff;
  margin-bottom: 12px;
}

.sec-sub {
  color: var(--text-muted);
  font-size: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 22px;
}

.hud-card {
  position: relative;
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-hud);
  border-radius: 8px;
  padding: 24px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.hud-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.14);
}

.hud-card h3 {
  color: #ffffff;
  font-size: 18px;
  margin-bottom: 10px;
}

.hud-card p {
  color: var(--text-muted);
  font-size: 14px;
}

.card-footer-meta {
  margin-top: 12px;
  font-family: monospace;
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.6px;
}

footer.site-footer {
  border-top: 1px solid var(--border-hud);
  padding: 28px 0;
  background: var(--bg-hud);
  font-size: 13px;
  color: var(--text-muted);
}

.footer-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* =========================================================
   TABLET (inalterado)
   ========================================================= */
@media (max-width: 900px) {
  .logo-fallback-stage {
    position: static;
    transform: none;
    margin: 0 auto 20px auto;
    max-width: 240px;
  }
}

/* =========================================================
   MOBILE — layout do modelo + toggle lateral
   Ordem: tag -> cérebro com título sobreposto -> descrição
          -> busca -> botão BUSCAR -> TRILHAS | MÓDULOS
   ========================================================= */
@media (max-width: 768px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  body.drawer-open {
    overflow: hidden;
  }

  nav.desktop-nav {
    display: none !important;
  }

  .mobile-header-actions {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }

  .mobile-menu-toggle {
    width: 40px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.08);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--cyan);
  }

  .mobile-drawer-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(2, 5, 10, 0.72);
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .mobile-drawer-backdrop.is-open {
    opacity: 1;
  }

  .mobile-drawer {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: min(290px, 84vw);
    height: 100vh;
    z-index: 70;
    background: rgba(7, 12, 20, 0.98);
    border-left: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: -12px 0 36px rgba(0, 0, 0, 0.65);
    padding: 18px;
    transform: translateX(100%);
    transition: transform 0.24s ease;
    overflow-y: auto;
  }

  .mobile-drawer.is-open {
    transform: translateX(0);
  }

  .mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  }

  .mobile-drawer-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--cyan);
  }

  .mobile-drawer-close {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: transparent;
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-drawer-links a:not(.btn-hud) {
    padding: 10px 12px;
    border-radius: 8px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
  }

  .mobile-drawer-links a:not(.btn-hud):hover {
    color: var(--cyan);
    border-color: rgba(0, 240, 255, 0.25);
    background: rgba(0, 240, 255, 0.06);
  }

  .mobile-drawer-links .btn-hud {
    width: 100%;
    justify-content: center;
  }

  .hero {
    --brain-top: 148px;
    --brain-h: 320px;

    display: block;
    min-height: auto;
    padding-top: 76px;
  }

  /* Cérebro limitado à faixa central para não cobrir o badge nem empurrar o rodapé */
  #brain-canvas {
    inset: auto;
    top: var(--brain-top);
    left: 0;
    width: 100%;
    height: var(--brain-h);
  }

  .logo-fallback-stage {
    display: none !important;
  }

  .hero-vignette {
    inset: auto;
    top: var(--brain-top);
    left: 0;
    width: 100%;
    height: var(--brain-h);
    background:
      linear-gradient(180deg,
        var(--bg-void) 0%,
        rgba(3, 5, 8, 0) 22%,
        rgba(3, 5, 8, 0) 42%,
        rgba(3, 5, 8, 0.78) 74%,
        var(--bg-void) 100%);
  }

  .hero-content {
    padding: 20px 0 36px;
  }

  .hero-box {
    max-width: 100%;
    text-align: center;
  }

  .tag-hud {
    display: inline-flex;
    justify-content: center;
    width: auto;
    max-width: 100%;
    font-size: 11px;
    letter-spacing: 1.2px;
    padding: 8px 16px;
    margin: 0 auto 14px;
  }

  .hero h1 {
    font-size: 30px;
    line-height: 1.12;
    padding-top: calc(var(--brain-h) - 118px);
    margin-bottom: 14px;
    text-wrap: balance;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.92);
  }

  .hero-desc {
    font-size: 14px;
    line-height: 1.5;
    max-width: 100%;
    margin: 0 auto 20px;
  }

  .search-bar {
    flex-direction: column;
    max-width: 100%;
    gap: 12px;
    margin-bottom: 14px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .search-bar input {
    width: 100%;
    flex: none;
    padding: 14px 16px;
  }

  .search-bar > button,
  .search-bar > .btn-hud {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-actions > * {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .metrics {
    max-width: 100%;
    gap: 12px;
    text-align: center;
  }

  .metric-val {
    font-size: 20px;
  }

  .metric-lbl {
    font-size: 11px;
  }

  section.block-sec {
    padding: 56px 0;
  }

  .sec-head {
    margin-bottom: 32px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .footer-wrap {
    flex-direction: column;
    text-align: center;
  }

  .hud-telemetry {
    display: none !important;
  }
}

/* Telas muito pequenas */
@media (max-width: 380px) {
  .hero {
    --brain-h: 290px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .tag-hud {
    font-size: 10px;
    letter-spacing: 0.8px;
  }
}