/* ==========================================================================
   ESSID Lab — Palco 3D Interativo (WebGL / Three.js)
   ========================================================================== */
:root {
  --bg: #101118;
  --navy: #2b2d3f;
  --text: #fefefe;
  --text-muted: #b5b7c7;
  --text-subtle: #8d8fa3;
  --accent: #f9a431;
  --font-sans: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#webglCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.stage-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 68% 68% at 68% 48%, transparent 18%, rgba(16, 17, 24, 0.86) 92%),
    linear-gradient(90deg, rgba(16, 17, 24, 0.86) 0%, rgba(16, 17, 24, 0.35) 48%, transparent 80%);
}

/* Marcas de registro nos cantos */
.hud-corners {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  color: var(--accent);
  opacity: 0.55;
  transition: color 0.35s ease;
}
.corner.tl { top: 78px; left: 22px; }
.corner.tr { top: 78px; right: 22px; }
.corner.bl { bottom: 22px; left: 22px; }
.corner.br { bottom: 22px; right: 22px; }

/* Topbar */
.hud-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 10;
  border-bottom: 1px solid rgba(43, 45, 63, 0.65);
  background: rgba(16, 17, 24, 0.55);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-logo { height: 32px; width: auto; display: block; }
.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(249, 164, 49, 0.14);
  border: 1px solid rgba(249, 164, 49, 0.36);
  padding: 3px 9px;
  border-radius: 999px;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-link {
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.18s ease;
}
.top-link:hover { color: var(--accent); }

/* HUD Principal */
.stage-hud {
  position: relative;
  z-index: 5;
  height: 100vh;
  max-width: 1260px;
  margin: 0 auto;
  padding: 96px 32px 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.info-panel {
  max-width: 560px;
  pointer-events: auto;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.info-panel.switching {
  opacity: 0;
  transform: translateY(12px);
}

.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.tool-index {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.tool-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  background: rgba(22, 24, 36, 0.82);
  border: 1px solid var(--accent);
  padding: 4px 11px;
  border-radius: 999px;
}

.info-panel h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.tool-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.6;
}

.tool-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 26px;
}

.tool-highlights li {
  font-size: 0.86rem;
  color: #d6d7e4;
  padding-left: 20px;
  position: relative;
}

.tool-highlights li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 800;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(22, 24, 36, 0.78);
  backdrop-filter: blur(10px);
  color: var(--text);
  border-color: var(--navy);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.stage-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-subtle);
}

/* Telemetria à direita */
.hud-telemetry {
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: right;
  font-family: var(--font-mono);
  margin-bottom: 12px;
}

.tel-item span {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  color: var(--text-subtle);
}

.tel-item strong {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* Seletor Flutuante 3D na base */
.selector-dock {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(16, 17, 24, 0.82);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  max-width: calc(100vw - 24px);
  overflow-x: auto;
}

.dock-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease, color 0.18s ease;
}

.dock-btn span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
}

.dock-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transform: translateY(-4px);
}

.dock-btn.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  transform: translateY(-3px);
}

.dock-btn.active span {
  color: var(--bg);
}

@media (max-width: 900px) {
  html, body { overflow: hidden; height: 100dvh; }
  .hud-top { padding: 14px 16px; }
  .brand-logo { height: 24px; }
  .brand-badge { font-size: 0.62rem; padding: 3px 8px; }
  .stage-hud {
    height: 100dvh;
    padding: 68px 14px 78px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
  }
  .info-panel {
    max-width: 100%;
    background: linear-gradient(180deg, rgba(16, 17, 24, 0.72), rgba(16, 17, 24, 0.94));
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.48);
  }
  .meta-row { margin-bottom: 8px; }
  .info-panel h1 { font-size: 1.42rem; margin-bottom: 8px; }
  .tool-desc { font-size: 0.84rem; line-height: 1.5; margin-bottom: 14px; }
  .tool-highlights, .stage-hint, .hud-telemetry, .hud-corners { display: none; }
  .actions-row { gap: 8px; margin-bottom: 0; }
  .actions-row .btn { flex: 1; text-align: center; padding: 11px 12px; font-size: 0.82rem; }
  .selector-dock {
    left: 10px;
    right: 10px;
    bottom: 12px;
    transform: none;
    display: flex;
    justify-content: flex-start;
    max-width: none;
    padding: 6px;
    border-radius: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .selector-dock::-webkit-scrollbar { display: none; }
  .dock-btn { flex-shrink: 0; padding: 8px 11px; font-size: 0.74rem; }
  .top-right .top-link:nth-child(n+2) { display: none; }
}
